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 support@ccsinfo.com

Set_uart_speed()

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







Set_uart_speed()
PostPosted: Sun Dec 01, 2002 3:18 pm     Reply with quote

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()
PostPosted: Sun Dec 01, 2002 3:35 pm     Reply with quote

:=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()
PostPosted: Mon Dec 02, 2002 3:36 pm     Reply with quote

:=:=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()
PostPosted: Mon Dec 02, 2002 4:03 pm     Reply with quote

:=:=:=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
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