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

serial port hangs on 16f876

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



Joined: 19 Nov 2003
Posts: 30

View user's profile Send private message

serial port hangs on 16f876
PostPosted: Mon Jul 19, 2004 7:10 am     Reply with quote

I'm using the serial h/w port on 16f876.
The port hangs if char are rx'ed to fast. (seems about 3 or 4 char, so I'm wondering if it is something to do with the buffer).The rest of the s/w is still running.
Can anyone tell me what is happening and better still how to over come it.
Many thanks
Les
Birdie
Guest







PostPosted: Mon Jul 19, 2004 9:43 am     Reply with quote

I had a similar problem with PIC18F6720 and the following helped prevent lock-ups:

//Check for receive buffer overrun error and clear if error.
if(bit_test(*RCSTA1, OERR))
{
bit_clear(*RCSTA1, CREN);
bit_set(*RCSTA1, CREN);
}

Hope this leads to a solution.
lucky



Joined: 12 Sep 2003
Posts: 46
Location: South Coast - England

View user's profile Send private message Visit poster's website

RS232 Hang
PostPosted: Mon Jul 19, 2004 10:15 am     Reply with quote

If the 3 Byte H/W buffer is over run then the RS232 will hang until the error is cleared.

You can include the ERRORS option in your #use_rs232 statement to automaticly clear these errors as they occour. It will also copy the errors into a variable that you can then read.
_________________
Lucky
www.mpic3.com - MPIC3 player project, Forum, Downloads, Online Shop
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