View previous topic :: View next topic |
Author |
Message |
pfournier
Joined: 30 Sep 2003 Posts: 89
|
my INT_RDA2 does not respond quickly enough |
Posted: Wed Apr 26, 2006 4:35 pm |
|
|
18f8622, PCWH 3.249
I have searched this forum for similar circumstances but have not found any.
I am receiving data through my serial port #2. I hooked up a logic analyzer to the serial line and I set up my interrupts to toggle some unused outputs on entry and exit. What I see is that I sometimes don't get into my receive interrupt until after 2 or 3 characters have been sent to it. Well after 3 characters I now have an over-run condition and that 3rd character is lost. Other times I'll respond immediately after the stop bit of the first character.
As I said, I have set up all my other interrupts to control unused outputs so I can see their duration. I can't see ANYTHING else happening while the serial stream is coming in. I would put out some code, but this thing is huge and I am kind of hoping someone will recognize the problem right off. _________________ -Pete |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Apr 26, 2006 4:48 pm |
|
|
Make a test program that just tests the 2nd serial port. See if you still
get the delay. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Apr 26, 2006 9:36 pm |
|
|
If you are not spending too much time in other interrupts, then the most likely problem is that interrupts are being disabled in some function. Are you disabling interrupts or are you calling a function from both main and an interrupt. |
|
|
pfournier
Joined: 30 Sep 2003 Posts: 89
|
|
Posted: Thu Apr 27, 2006 6:21 am |
|
|
Quote: | Make a test program that just tests the 2nd serial port. See if you still
get the delay. |
That's my next step.
Quote: | If you are not spending too much time in other interrupts, then the most likely problem is that interrupts are being disabled in some function. Are you disabling interrupts or are you calling a function from both main and an interrupt. |
Only Rx/Tx and AD interupts do anything, and they are just copy routines.
I'm going to start remarking out chunks of code. Fotunately, I made it "chunky" so it's easy to do. _________________ -Pete |
|
|
pfournier
Joined: 30 Sep 2003 Posts: 89
|
|
Posted: Thu Apr 27, 2006 9:10 am |
|
|
Found it!!!
Although I read that writing to the eeprom turns off the interrupts, I didn't realize writing to the eeprom took so long to do!
I also didn't realize I had an eeprom write where I did. I thought I moved it. _________________ -Pete |
|
|
|