blo
Joined: 11 May 2009 Posts: 22
|
Is possible to change baud rate during program execution? |
Posted: Wed Aug 26, 2009 8:33 am |
|
|
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. |
|