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

Is possible to change baud rate during program execution?

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



Joined: 11 May 2009
Posts: 22

View user's profile Send private message

Is possible to change baud rate during program execution?
PostPosted: Wed Aug 26, 2009 8:33 am     Reply with quote

Hi, I'm bulding a simple interface between my board and the PC, I've done a function that permit me to change the baud rate of the PIC.
The baud rate doesn't change. So I'm in trouble.
Anyone know how is possible to change the rs232 speed?

here is a part of my code:
Code:
 
  switch (a)
  {
case 0:
   #use rs232(baud=2400,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,restart_wdt)
   write_ext_eeprom(0x000A, 0);
   break;
   
   case 1:
   #use rs232(baud=4800,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,restart_wdt)
   write_ext_eeprom(0x000A, 1);
   break;
   
   case 2:
   #use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,restart_wdt)
   write_ext_eeprom(0x000A, 2);
   break;
   
   case 3:
   #use rs232(baud=19200,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,restart_wdt)
   write_ext_eeprom(0x000A, 3);
   break;

and so on.
but it doesn't work.
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

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

PostPosted: Wed Aug 26, 2009 8:38 am     Reply with quote

setup_uart(baud, stream)
setup_uart(baud)

set_uart_speed (baud, [stream])
blo



Joined: 11 May 2009
Posts: 22

View user's profile Send private message

PostPosted: Wed Aug 26, 2009 9:02 am     Reply with quote

thank you. now it works
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