Serial Initilisation

Status
Not open for further replies.

scomi

New Member
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.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…