
19-01-2006, 12:04
|
|
"why cant i install Linux?" guy
AKA: Roman Tetelman
None #0100
Team Role: Programmer
|
|
Join Date: Feb 2005
Rookie Year: 2005
Location: Belmont, CA
Posts: 11
|
|
|
Re: Interupts on the Pic18
Quote:
|
Originally Posted by Kevin Watson
The 2.4 compiler is brain-dead when it comes to automatically saving data when a low-priority ISR is called. You have to pretty much manually tune the ISR with different compiler #pragma statements. Because I can't anticipate how someone will use my code, I have to err on the conservative side and save quite a bit of data, which introduces a bunch of latency. Trying to capture a 38us pulse when you've got ~50us of latency is a problem. Yes, I know that I don't necessarily have to time the width of the pulse, I could simply check to see if the output is still high when my ISR code finally executes and if it's low, conclude the pulse width is narrower than my latency and therefore one of the 38us pulses flew by. But the problem is this solution is half-arsed and I don't do anything half-arsed <grin>. This and other possible solutions are being explored.
If you'd like to see the RC malfunction, load up the ADC code I posted and change this line in user_routines_fast.c from:
#pragma interruptlow InterruptHandlerLow save=PROD,section(".tmpdata")
to:
#pragma interruptlow InterruptHandlerLow save=PROD
And you should see the RC do things it shouldn't.
-Kevin
|
speaking of which: does the comment preceding that still have the wrong page number in the compiler manual 
|