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

my INT_RDA2 does not respond quickly enough

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



Joined: 30 Sep 2003
Posts: 89

View user's profile Send private message

my INT_RDA2 does not respond quickly enough
PostPosted: Wed Apr 26, 2006 4:35 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Apr 26, 2006 4:48 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed Apr 26, 2006 9:36 pm     Reply with 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.
pfournier



Joined: 30 Sep 2003
Posts: 89

View user's profile Send private message

PostPosted: Thu Apr 27, 2006 6:21 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Apr 27, 2006 9:10 am     Reply with quote

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