jeffreyj
Joined: 24 Dec 2007 Posts: 2 Location: Pittsburgh PA area
|
multiple serial ports with interrupts on 18F8722 |
Posted: Mon Dec 24, 2007 12:31 am |
|
|
I have a need to use 2 serial port on the 18F8722 (which has 2 USARTS). I have set up:
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7) and
#use rs232(baud=9600, xmit=PIN_G1, rcv=PIN_G2).
FOR TRANSMITTING, I understand that the #use statement must precede the printf function so that it sends to the appropriate port.
For RECEIVING, My confusion (and lack of understanding) begins here......
will the serial interrupt occur when a character is received from either port? or the from the last #USE?
If so, I would miss incoming data on the "other port"
If not, how would I differentiate which port has the character awaiting. If I test both the getc will hand if there is nothing to get..
I have done many single port project but never 2 that have unsolicited serial RX that require interrupts to queue incoming data from 2 possible streams.
any help, clarity, or advice would be appreciated..
Thanks
Jeff |
|