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

Continuous Serial Reception

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



Joined: 26 Jan 2011
Posts: 31

View user's profile Send private message

Continuous Serial Reception
PostPosted: Sat Jan 29, 2011 6:56 am     Reply with quote

I am trying to communicate with the GSM modem through Serial communication of PIC16F877A. I can get the values for the first time. But then I have to reset the controller for further data reception.
What may be the problem?
I am using onboard USRT and CCS compiler for programming.
Ttelmah



Joined: 11 Mar 2010
Posts: 19504

View user's profile Send private message

PostPosted: Sat Jan 29, 2011 7:47 am     Reply with quote

You are probably receiving characters while you are doing something else. Not handling them, so the internal UART buffer overflows. Only a couple of characters needed for this to happen. Once it does, the UART will hang until the error is cleared.
Enable the 'ERRORS' option in the #use RS232 declaration. One thing this does 'behind the scenes', is copy the error flag into a variable called 'RS232_ERRORS', and _automatically_ clear the error.
If you don't use the variable you will get a warning about the variable being unused (but this is just a warning, and doesn't matter at all), but the UART will remain operational if this happens.
ERRORS, really ought to be the default setting with the UART....

Another answer, use interrupt driven serial receive, and while stuff is arriving that you don't want, have this throw away received characters.

Best Wishes
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