|
|
View previous topic :: View next topic |
Author |
Message |
Detienne Guy Guest
|
Set_uart_speed() |
Posted: Sun Dec 01, 2002 3:18 pm |
|
|
I use the PIC 16F876 and CCS Compiler version 3.15.
In the projet, I use two RS232 communication with PC1 and PC2 as stream identifier.
#use rs232(baud=4800,parity=N,xmit=PIN_C0,rcv=PIN_C1,stream=PC2,errors)
#use rs232(baud=4800,parity=N,xmit=PIN_C6,rcv=PIN_C7,stream=PC1)
I wish have the possibility to change the BaudRate of PC1 in regard of the setting of
pin B1. Therefore, in te main, I write the following code :
#use rs232(baud=4800,parity=N,xmit=PIN_C6,rcv=PIN_C7,stream=PC1)
switch (input(PIN_B1))
{
case 0 :
set_uart_speed (4800);
break;
case 1 :
set_uart_speed (9600);
break;
}
The Baud rate stay on 4800 Baud. Port B1 is input.
What is my error ? Thanks for your suggestions.
___________________________
This message was ported from CCS's old forum
Original Post ID: 9656 |
|
|
R.J.Hamlett Guest
|
Re: Set_uart_speed() |
Posted: Sun Dec 01, 2002 3:35 pm |
|
|
:=I use the PIC 16F876 and CCS Compiler version 3.15.
:=In the projet, I use two RS232 communication with PC1 and PC2 as stream identifier.
:=
:=#use rs232(baud=4800,parity=N,xmit=PIN_C0,rcv=PIN_C1,stream=PC2,errors)
:=#use rs232(baud=4800,parity=N,xmit=PIN_C6,rcv=PIN_C7,stream=PC1)
:=
:=I wish have the possibility to change the BaudRate of PC1 in regard of the setting of
:=pin B1. Therefore, in te main, I write the following code :
:=
:=#use rs232(baud=4800,parity=N,xmit=PIN_C6,rcv=PIN_C7,stream=PC1)
:=switch (input(PIN_B1))
:= {
:= case 0 :
:= set_uart_speed (4800);
:= break;
:= case 1 :
:= set_uart_speed (9600);
:= break;
:= }
:=
:=The Baud rate stay on 4800 Baud. Port B1 is input.
:=
:=What is my error ? Thanks for your suggestions.
:=
If you are using streams, then add the stream identifier to the set_uart_speed call. As:
set_uart_speed(9600,PC1);
Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 9659 |
|
|
Detienne Guy Guest
|
Re: Set_uart_speed() |
Posted: Mon Dec 02, 2002 3:36 pm |
|
|
:=:=I use the PIC 16F876 and CCS Compiler version 3.15.
:=:=In the projet, I use two RS232 communication with PC1 and PC2 as stream identifier.
:=:=
:=:=#use rs232(baud=4800,parity=N,xmit=PIN_C0,rcv=PIN_C1,stream=PC2,errors)
:=:=#use rs232(baud=4800,parity=N,xmit=PIN_C6,rcv=PIN_C7,stream=PC1)
:=:=
:=:=I wish have the possibility to change the BaudRate of PC1 in regard of the setting of
:=:=pin B1. Therefore, in te main, I write the following code :
:=:=
:=:=#use rs232(baud=4800,parity=N,xmit=PIN_C6,rcv=PIN_C7,stream=PC1)
:=:=switch (input(PIN_B1))
:=:= {
:=:= case 0 :
:=:= set_uart_speed (4800);
:=:= break;
:=:= case 1 :
:=:= set_uart_speed (9600);
:=:= break;
:=:= }
:=:=
:=:=The Baud rate stay on 4800 Baud. Port B1 is input.
:=:=
:=:=What is my error ? Thanks for your suggestions.
:=:=
:=If you are using streams, then add the stream identifier to the set_uart_speed call. As:
:=set_uart_speed(9600,PC1);
:=
:=Best Wishes
Thanks for your help. Sorry for the question but this possibility is not provide in the reference manual.
___________________________
This message was ported from CCS's old forum
Original Post ID: 9704 |
|
|
R.J.Hamlett Guest
|
Re: Set_uart_speed() |
Posted: Mon Dec 02, 2002 4:03 pm |
|
|
:=:=:=I use the PIC 16F876 and CCS Compiler version 3.15.
:=:=:=In the projet, I use two RS232 communication with PC1 and PC2 as stream identifier.
:=:=:=
:=:=:=#use rs232(baud=4800,parity=N,xmit=PIN_C0,rcv=PIN_C1,stream=PC2,errors)
:=:=:=#use rs232(baud=4800,parity=N,xmit=PIN_C6,rcv=PIN_C7,stream=PC1)
:=:=:=
:=:=:=I wish have the possibility to change the BaudRate of PC1 in regard of the setting of
:=:=:=pin B1. Therefore, in te main, I write the following code :
:=:=:=
:=:=:=#use rs232(baud=4800,parity=N,xmit=PIN_C6,rcv=PIN_C7,stream=PC1)
:=:=:=switch (input(PIN_B1))
:=:=:= {
:=:=:= case 0 :
:=:=:= set_uart_speed (4800);
:=:=:= break;
:=:=:= case 1 :
:=:=:= set_uart_speed (9600);
:=:=:= break;
:=:=:= }
:=:=:=
:=:=:=The Baud rate stay on 4800 Baud. Port B1 is input.
:=:=:=
:=:=:=What is my error ? Thanks for your suggestions.
:=:=:=
:=:=If you are using streams, then add the stream identifier to the set_uart_speed call. As:
:=:=set_uart_speed(9600,PC1);
:=:=
:=:=Best Wishes
:=
:=Thanks for your help. Sorry for the question but this possibility is not provide in the reference manual.
True.
Look at the 'readme' that comes with the compiler. It covers the changes from the manual. :-)
Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 9706 |
|
|
|
|
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
|