cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt pending

franco
Associate II
Posted on September 21, 2005 at 12:00

Interrupt pending

5 REPLIES 5
franco
Associate II
Posted on September 20, 2005 at 08:45

Hi,

How can I do to erase an unwanted pending interrupt? Interrupt generated by an interruptable pin...I use a Flite09 and its datasheet says:

''To clear an unwanted pending interrupt

by software, the sensitivity bits in the EICR register

must be modified.''

And this is my simple code:

''bset EICR,#7

bres EICR,#7

iret''

As just the program exit from interrupt routine,it come back in it because pending interrupt has not cleared....Why??

Thanks a lot for your help!!

wolfgang2399
Associate II
Posted on September 21, 2005 at 05:13

Hi,

to help you we need more detailed information:

- what is the value of EICR:bit6?

- what is the level of port B0 while entering the interrupt?

WoRo

franco
Associate II
Posted on September 21, 2005 at 07:58

Thanx...

I keep EICR bit6 equal to ''1'',then the sensitivity changes from ''Rising and falling edge'' to ''Rising edge only''.The level of port B0 is always low and when a rising spike happens,then the interrupt occurs correctly....when the interrupt routine ends,the port B0 level is perfectly low and I don't understand cannot clear the interrupt pending!!! I checked the port B0 level with an oscilloscope and there aren't hardware problem,it's only a pending interrupt not cleared correctly!!!

wolfgang2399
Associate II
Posted on September 21, 2005 at 09:31

Hi,

my only idea - if we rule out a hardware error - is, that the falling edge of your ''spike'' appeares after you've been modifiing the flag. But I see: it must take effect between ''bres EICR,#7'' and ''iret'' ....

BTW: why do you select sensitivity on both edges and not only on the rising one?

WoRo

franco
Associate II
Posted on September 21, 2005 at 12:00

Thanx for your help,but the falling edge of my spike appears before (many ms before!!) critical point :between ''bres EICR,#7'' and ''iret''...Oscilloscope says so...

I select sensitivity on both edges and I change it immediately only for clear pending interrupts....in main code,the sensitivity is always ''only rising edge''....only at end of interrupt routine I change and re-change it for reasons described above.

Thanx however WoRo