Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top