CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

multiple serial ports with interrupts on 18F8722

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jeffreyj



Joined: 24 Dec 2007
Posts: 2
Location: Pittsburgh PA area

View user's profile Send private message

multiple serial ports with interrupts on 18F8722
PostPosted: Mon Dec 24, 2007 12:31 am     Reply with quote

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
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 24, 2007 12:41 am     Reply with quote

See Humberto's post:
http://www.ccsinfo.com/forum/viewtopic.php?t=29457
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group