View previous topic :: View next topic |
Author |
Message |
lucas Guest
|
RS232 with two stop bits? |
Posted: Wed Mar 05, 2003 6:51 am |
|
|
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
|
Re: RS232 with two stop bits? |
Posted: Wed Mar 05, 2003 7:31 am |
|
|
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? |
Posted: Wed Mar 05, 2003 9:08 am |
|
|
:=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
|
Re: RS232 with two stop bits? |
Posted: Wed Mar 05, 2003 12:00 pm |
|
|
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? |
Posted: Thu Mar 06, 2003 3:02 am |
|
|
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
|
Re: RS232 with two stop bits? |
Posted: Thu Mar 06, 2003 1:38 pm |
|
|
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 |
Posted: Fri Mar 07, 2003 5:36 am |
|
|
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 |
|
|
|