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

RS232 with two stop bits?

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







RS232 with two stop bits?
PostPosted: Wed Mar 05, 2003 6:51 am     Reply with quote

Please:
could anyone tell me the way to obtain
a serial communications with 2 stop bits, using
the RS232 directive
Thank you very much
___________________________
This message was ported from CCS's old forum
Original Post ID: 12370
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

Re: RS232 with two stop bits?
PostPosted: Wed Mar 05, 2003 7:31 am     Reply with quote

Setup the PIC for 9 bit data and keep the 9th bit high.

:=Please:
:=could anyone tell me the way to obtain
:=a serial communications with 2 stop bits, using
:=the RS232 directive
:=Thank you very much
___________________________
This message was ported from CCS's old forum
Original Post ID: 12372
Sherpa Doug
Guest







Re: RS232 with two stop bits?
PostPosted: Wed Mar 05, 2003 9:08 am     Reply with quote

:=Please:
:=could anyone tell me the way to obtain
:=a serial communications with 2 stop bits, using
:=the RS232 directive
:=Thank you very much

Are you sending or receiving, or both? If you are only receiving you can use 1 stop bit and you will just have a gap between characters. For sending use Mark's 9 bit idea.

If you are using a software UART you could modify the assembly code, then use it as included assembly. It would be a good exercise for the student ;-)

___________________________
This message was ported from CCS's old forum
Original Post ID: 12376
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

Re: RS232 with two stop bits?
PostPosted: Wed Mar 05, 2003 12:00 pm     Reply with quote

The software UART supports 9 bit data through the BITS=9 and bit 7 of the RS232_Errors.


:=:=Please:
:=:=could anyone tell me the way to obtain
:=:=a serial communications with 2 stop bits, using
:=:=the RS232 directive
:=:=Thank you very much
:=
:=Are you sending or receiving, or both? If you are only receiving you can use 1 stop bit and you will just have a gap between characters. For sending use Mark's 9 bit idea.
:=
:=If you are using a software UART you could modify the assembly code, then use it as included assembly. It would be a good exercise for the student ;-)
:=
___________________________
This message was ported from CCS's old forum
Original Post ID: 12383
lucas
Guest







Re: RS232 with two stop bits?
PostPosted: Thu Mar 06, 2003 3:02 am     Reply with quote

Please: could you explain more this solution?
Thanks

:=The software UART supports 9 bit data through the BITS=9 and bit 7 of the RS232_Errors.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12418
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

Re: RS232 with two stop bits?
PostPosted: Thu Mar 06, 2003 1:38 pm     Reply with quote

Are you using the hardware uart or are you going to use a software uart? If you plan on using the software uart, the CCS manual says that it supports 9 bit data. To accomplish this, you should have the BITS=9 in your #USE RS232 statement. The manual also states that bit 7 of the RS22_ERRORS is used for the 9 data bit. You would just keep this bit high. I am not sure what you are trying to do, but 8 data bits and 1 stop bit will probably work for you so long as the delay between bytes is at least 1 bit time.


=Please: could you explain more this solution?
:=Thanks
:=
:=:=The software UART supports 9 bit data through the BITS=9 and bit 7 of the RS232_Errors.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12441
lucas
Guest







Re: RS232 with two stop bits? THIS WORKs FINE
PostPosted: Fri Mar 07, 2003 5:36 am     Reply with quote

Thanks to Mark & Sherpa.
This code works fine
.....
#use rs232(baud=9600,bits=9,parity=N,xmit=PIN_D4,rcv=PIN_D5, ERRORS)
void put_puerto_rob(char b)
{
putchar(b);
}

main()
{
....
set_tris_d(0b00100000); // D5 input data
bit_SET(rs232_errors, 7);
put_puerto_rob(0x0d);
delay_ms(500);
}
___________________________
This message was ported from CCS's old forum
Original Post ID: 12457
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