View previous topic :: View next topic |
Author |
Message |
Heath
Joined: 21 Dec 2007 Posts: 41
|
#use RS232 question. |
Posted: Wed Apr 15, 2009 1:45 pm |
|
|
Hi guys,
I'm using this for my program to talk with devices using 9 bit communication.
Code: | #use rs232(STREAM=DV, baud=9600, xmit=PIN_G1, rcv=PIN_G2, PARITY=N, ENABLE=PIN_G0, BITS=9, LONG_DATA) |
I'm on a PIC18F6527.
I have in my controller that if I lose communications I will reboot the controller in an attempt to 'discover' the devices I have connected to this controller. I haven't been around to actually see it but I think my controller is rebooting as I'm doing my testing.
My question is that, since I don't have an ERRORS in there could it be possible that I could have a parity error or something on the port, which would cause the port to lock up and thus 'lose' communications?
Or, is that not how ERRORS works?
Thanks! |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Wed Apr 15, 2009 5:00 pm |
|
|
What is your compiler version?
As far as I know the parity is not calculated by the CCS compiler and should be handled by your firmware. Are you doing this?
The ERRORS directive is used for several reasons:
- Causes storing the error status of the UART in the RS232_ERRORS variable.
- The PIC UART will shut down on overflow (3 characters received by the
hardware with a GETC() call). The "ERRORS" option prevents the shutdown
by detecting the condition and resetting the UART.
The shut down on receive buffer overflow in the hardware UART might be the cause of your problem. |
|
|
Heath
Joined: 21 Dec 2007 Posts: 41
|
|
Posted: Thu Apr 16, 2009 7:34 am |
|
|
No, I'm not checking the parity. I am however doing a checksum. (There is a checksum embedded in the message.)
I'm using 4.064.
Thanks for the help! |
|
|
|