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

RS232 changing baud rate at runtime

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







RS232 changing baud rate at runtime
PostPosted: Wed Mar 23, 2005 5:54 am     Reply with quote

I have an application that requires altering baud rate on the same output. The PCWH 3.222 compiler uses the baudrate of the last #USE_RS232 directive in the program irrespective of program flow. i.e. if I put a directive of 4800 as the first line of the program, followed by printf statements followed by the program ending in a directive of 19200 baud, all the printf's are transmitted at 19200 baud. Is this correct? If so, is there a simple way to switch baud rate during runtime please?
Paolino



Joined: 19 Jan 2004
Posts: 42

View user's profile Send private message

PostPosted: Wed Mar 23, 2005 6:05 am     Reply with quote

CCS has a function called SET_UART_SPEED() which allows you to modify uart speed run-time. See CCS help for details.

Paolo.
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Mar 23, 2005 12:27 pm     Reply with quote

Actually it works like this:

use RS232 for 9600 baud
print A
print B
print C
use RS232 for 1200 baud
Print XYZ

will print ABC at 9600 and XYZ at 1200 baud.
_________________
The search for better is endless. Instead simply find very good and get the job done.
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