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 CCS Technical Support

example code for DUAL EUSART using streams

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

example code for DUAL EUSART using streams
PostPosted: Fri Feb 20, 2009 9:52 am     Reply with quote

about to undertake a project that requires two 38.4k RS232 channels, and i plan on using 18f8722.
some example code for uart stream channel setup would be invaluable, but a search of CCS compiler supplied doc and examples - and of old posts on this forum got nothing.
i'd be grateful for a link to any source code that clarifies the dual uart setup for streams procedure.
i think i'm for sure OK on using printf() and kdhit() - streamwise

its the pesky setup for the hardware that is unclear
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Feb 20, 2009 1:57 pm     Reply with quote

See these two threads. They have sample code for using dual UARTs
with streams:
http://www.ccsinfo.com/forum/viewtopic.php?p=95979
http://www.ccsinfo.com/forum/viewtopic.php?t=33700
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Fri Feb 20, 2009 9:13 pm     Reply with quote

so since i'm basically fast-polling and dealing with only short sequences ( that the fifo can accomodate ) no INTS

#use delay(clock=32000000) // defining the clock for Mr. compiler
#use rs232(baud=19200, xmit=PIN_C6,rcv=PIN_C7,ERRORS,UART1,STREAM=COMM)
#use rs232(baud=38400, xmit=PIN_G1,rcv=PIN_G2,ERRORS,UART2,STREAM=CARD)

then match the #use RS232 statements to a defined hardware UART pin set and Mr. compiler handles that too.

thats all there is to it huh ?

why do i feel that the CCS compiler is nicer and better than i deserve?

thanks for the lead PCM !!!!
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    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