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

UART How do you change parity or data len within program?

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



Joined: 27 Mar 2006
Posts: 2
Location: UK

View user's profile Send private message

UART How do you change parity or data len within program?
PostPosted: Tue Nov 11, 2008 5:47 am     Reply with quote

Hi

Can anyone help me? I am aiming to write a serial port analyzer and have been looking through the CCS C manual regarding changing the serial port data bits and parity within the program code? The only functions I found are listed below.

#use rs232 - Preprocessor no good for dynamically changing parameters within code?
setup_uart - only changes baud rate and stream.

Has anyone had any experience or example code of changing the parity or data bits within programs code?
Ttelmah
Guest







PostPosted: Tue Nov 11, 2008 8:53 am     Reply with quote

There is a bigger problem than this....
The PIC, doesn't really support parity at all. The only support is via software, generating the extra bit if needed.
This is why it is not configurable 'on the fly', since code has to be added to provide the support. Some layouts are basically impossible (so for example, - 7bit, no parity, one stop, which the hardware cannot generate).
You can give yourself an even/odd parity software selectable, by either declaring two streams,and selecting the required one, which then results in both sets of code being generated, or simply selecting 9bits, no parity, and generating the parity bit yourself.

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