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

change 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
Ringo42



Joined: 07 May 2004
Posts: 263

View user's profile Send private message

change baud rate at runtime
PostPosted: Wed Oct 19, 2005 9:01 pm     Reply with quote

How do I change the baud rate using data from the eeprom?
I've tried things like
if(data==1)
{
#use rs232(baud=19200,xmit=TX_PIN,rcv=RX_PIN,errors,bits=8,parity=N,Restart_WDT)
printf("Setting baud rate to 19200\r\n");

}
if(data==2)
{
#use rs232(baud=57600,xmit=TX_PIN,rcv=RX_PIN,errors,bits=8,parity=N,Restart_WDT)
printf("Setting baud rate to 56700\r\n");
}

but this always sets the baud rate to 57600, even though the print statement in the data==1 statement is the only one that prints. I even put the #use statement in its own function and called the correct function based on data, but it has the same effect.
Any ideas How to do this? I want to allow the user to set up a baud rate, store it in eeprom, then from then on use that baud rate only.
Thanks
Ringo
_________________
Ringo Davis
Ringo42



Joined: 07 May 2004
Posts: 263

View user's profile Send private message

PostPosted: Wed Oct 19, 2005 9:10 pm     Reply with quote

I got it, I used
set_uart_speed(19200);
and it woks.
Ringo
_________________
Ringo Davis
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