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

#use RS232 question.

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



Joined: 21 Dec 2007
Posts: 41

View user's profile Send private message

#use RS232 question.
PostPosted: Wed Apr 15, 2009 1:45 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Apr 15, 2009 5:00 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Apr 16, 2009 7:34 am     Reply with quote

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!
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