View previous topic :: View next topic |
Author |
Message |
KentR
Joined: 21 Jun 2010 Posts: 11
|
UART question - Not receiving after reset |
Posted: Fri Oct 01, 2010 8:41 am |
|
|
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: 1615 Location: Central Illinois, USA
|
|
Posted: Fri Oct 01, 2010 8:43 am |
|
|
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
|
|
Posted: Fri Oct 01, 2010 10:43 am |
|
|
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: 1615 Location: Central Illinois, USA
|
|
Posted: Fri Oct 01, 2010 10:46 am |
|
|
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
|
|
Posted: Tue Oct 26, 2010 7:15 pm |
|
|
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. |
|
|
|