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

switching between 8 and 9 data bits for usart tx

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



Joined: 29 Jun 2007
Posts: 62
Location: Raleigh, NC

View user's profile Send private message Visit poster's website

switching between 8 and 9 data bits for usart tx
PostPosted: Mon Mar 31, 2008 2:48 pm     Reply with quote

I need to send usart messages to multiple destination devices, switching between two different data formats: either (a) 38400 bps with 8 data bits, or (b) 250000 bps with 9 data bits. I'm using enable lines on two different hardware drivers to direct each format out a different physical port. Obviously, only one format will be in use at any given time, but the application will be switching back and forth quite rapidly.

Looking at the documentation for the setup_usart() function, there does not appear to be a parameter for selecting 8 or 9 data bits. Will I need to poke the usart config bits with a custom function, or is there an undocumented parameter or function for doing this?

The #use_rs232 directive provides support for 8 or 9 data bits, but I need to change this parameter on the fly, between data packets.

Thanks for your help,
Jim
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Apr 01, 2008 12:07 pm     Reply with quote

Quote:
Will I need to poke the usart config bits with a custom function ?

Yes.
John P



Joined: 17 Sep 2003
Posts: 331

View user's profile Send private message

PostPosted: Tue Apr 01, 2008 1:35 pm     Reply with quote

Sounds like someone is playing with DMX-512.

It ought to be possible to set up the system to use 9 data bits, then any time you only want to send 8, just set the 9th bit high. Then the receiving unit will think it was a character with 2 stop bits, or simply a pause between characters. Does that count as a "custom function"?
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