|
|
View previous topic :: View next topic |
Author |
Message |
enrico
Joined: 17 Mar 2008 Posts: 2 Location: ITALY
|
same RS232 (hardware) at different speed |
Posted: Mon Mar 17, 2008 6:22 am |
|
|
Kindly ask help to use the same RS232 at different speed
this code:
while(1)
{
#use rs232(baud=19200,xmit=TXSER_A,rcv=RXSER_A,parity=N,bits=8)
putc(0x0f);
delay_ms(2);
#use rs232(baud=9600,xmit=TXSER_A,rcv=RXSER_A,parity=N,bits=8)
putc(0xf0);
delay_ms(2);
}
seems don't switch the speed like I need
I've also tryed to define 2 different function:
#use rs232(baud=19200,xmit=TXSER_A,rcv=RXSER_A,parity=N,bits=8)
writeHigh()
{
putc(0xf0);
}
---
#use rs232(baud=9600,xmit=TXSER_A,rcv=RXSER_A,parity=N,bits=8)
writeSlow()
{
putc(0xf0);
}
and then call them... but I'm always not able to switch the speed
working condition:
PIC16F916
TXSER_A= PIN_C6
RXSER_A= PIN_C7
hardware rs232
THANKS in advance for the help !
Have a nice day !
Enrico
Last edited by enrico on Mon Mar 17, 2008 7:45 am; edited 2 times in total |
|
|
Ttelmah Guest
|
|
Posted: Mon Mar 17, 2008 6:26 am |
|
|
Just use the set_uart_speed function...
Best Wishes |
|
|
Matro Guest
|
|
Posted: Mon Mar 17, 2008 6:32 am |
|
|
All instructions beginning by # are for prepocessor so will never do any hardware changes.
Just use SET_UART_SPEED() as said by Ttelmah or SETUP_UART() for a complete setup.
Regards,
Matro |
|
|
enrico
Joined: 17 Mar 2008 Posts: 2 Location: ITALY
|
THANKS ! |
Posted: Mon Mar 17, 2008 7:40 am |
|
|
Simply, BIG thanks !
it works perfetcly
Have a nice day !
Enrico |
|
|
|
|
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
|