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

How to use "setup_uart" for 2 hw uarts? How flush

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







How to use "setup_uart" for 2 hw uarts? How flush
PostPosted: Sat Aug 11, 2007 6:11 am     Reply with quote

1. How can I specifically assign the command setup_uart to ether the hardware uart1 or uart2 in my 18F87J10?

2. How are the RX/TX buffers of the uarts flushed?

Thx & rgds
Urs
Ttelmah
Guest







PostPosted: Sat Aug 11, 2007 8:10 am     Reply with quote

When you use #use RS232, it allows you to assign a stream 'name', to a particular UART (selected by the pins). You then use this name in setup_uart to say which UART is being referred to.
Read the characters...
The buffers wake up 'empty'. The output buffer empties itself as characters are sent. The input buffer is emptied as you read it. If you are using extended 'software' buffering, then it is up to your code to initialise these to the empty state.

Best Wishes
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