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

UART question - Not receiving after reset

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



Joined: 21 Jun 2010
Posts: 11

View user's profile Send private message

UART question - Not receiving after reset
PostPosted: Fri Oct 01, 2010 8:41 am     Reply with quote

I am using the uart on a PIC18F67J10, to communicate with a PC. The PC transmits a message every 125mS, and when the PIC receives it, it sends a response. If I power up the PIC, and then start the PC program, everything works fine. However, if I powerup (or reset) the PIC, while the PC is sending it's serial messages, the PIC never responds.

I put an LED flash statement within the PIC's uart receive interrupt. When I do the reset, while PC is transmitting, I stop getting any flashes. This means that it is no longer entering the receive interrupt (even though the PC is transmitting).

Has anyone else run into this? Is there maybe some kind of error flags that could be getting set, that I need to clear? Any help would be appreciated.


Last edited by KentR on Fri Oct 01, 2010 10:47 am; edited 1 time in total
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Oct 01, 2010 8:43 am     Reply with quote

If your program is short, then post it.

If not, post a short test program that gives us the gist of what's broken.

We also need the compiler version.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
KentR



Joined: 21 Jun 2010
Posts: 11

View user's profile Send private message

PostPosted: Fri Oct 01, 2010 10:43 am     Reply with quote

I figured this out. The PIC received too many bytes (while it was powering up) and shut down the uart. To solve this, I had to add the ERRORS switch to my #use rs232 setup.
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Oct 01, 2010 10:46 am     Reply with quote

Sounds good. Consider changing your topic header to include [SOLVED]..

Cheers,

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
cheehow



Joined: 15 Sep 2010
Posts: 28

View user's profile Send private message

PostPosted: Tue Oct 26, 2010 7:15 pm     Reply with quote

hai!! KentR, I'm also facing the same problem as well but haven't solved it yet. I'm using PIC 16F877A MCU to communicate with my PC through USB to UART. Once I click my VB interface, it will send a data to the PIC and meanwhile the PIC also will send back a ASCII code character to PC to shows that it had received the data. But my problem is the PIC cannot be sent back the data by pressing the push button, because I have construct a circuit that once I press the push button, it will send data to PC also. My USB and UART device shown it had received data but then the PC application show nothing. So can you please tell me what's the problem ? Your answer would be appreciated. Very Happy
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