S scomi New Member Apr 6, 2009 #1 I need to initialize my serial routine before i can use it, below is the code: Code: serial_init: banksel SPBRG ;bank 1 movlw 2580 ;set baud rate movwf SPBRG movlw b'00100100' ;8-bit transmit, transmitter enabled, movwf TXSTA ;asynchronous mode, high speed mode banksel PORTA ;bank 0 movlw b'10010000' ;8-bit receive, receiver enabled, movwf RCSTB ;serial port enabled return However, I am using OCS2 pin instead of port A or B. How to define it using OSC2? Thank you.
I need to initialize my serial routine before i can use it, below is the code: Code: serial_init: banksel SPBRG ;bank 1 movlw 2580 ;set baud rate movwf SPBRG movlw b'00100100' ;8-bit transmit, transmitter enabled, movwf TXSTA ;asynchronous mode, high speed mode banksel PORTA ;bank 0 movlw b'10010000' ;8-bit receive, receiver enabled, movwf RCSTB ;serial port enabled return However, I am using OCS2 pin instead of port A or B. How to define it using OSC2? Thank you.
blueroomelectronics Well-Known Member Apr 6, 2009 #4 movlw 2580 seems wrong. W is only 8 bits wide. I am using OCS2 pin instead of port A or B. How to define it using OSC2 Click to expand... What do you mean? You want to reassign the UART pins to OSC2?
movlw 2580 seems wrong. W is only 8 bits wide. I am using OCS2 pin instead of port A or B. How to define it using OSC2 Click to expand... What do you mean? You want to reassign the UART pins to OSC2?