does External Interrupt Flag clear SREG Bit 7 – I: (Global Interrupt Enable)?

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi,

 

does the SREG - I - bit get cleared when an External Interrupt Flag is set but no External Interrupt Request is enabled, i.e no there is no corresponding interrupt Handling Vector (ISR)? I know that ISR's do it automatically, (although I was not able to find a cli instruction within the ISR body in the lss dis-assembly file), but not sure about flags.

 

thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

does the SREG - I - bit get cleared when an External Interrupt Flag is set but no External Interrupt Request is enabled, i.e no there is no corresponding interrupt Handling Vector (ISR)? I know that ISR's do it automatically, (although I was not able to find a cli instruction within the ISR body in the lss dis-assembly file), but not sure about flags.

 Re-read the datasheet sections on interrupt handing, and the description of your particular bit.

 

Then, if you have any further questions not answered there, bring them here.

 

Short answer:  How do you think it works?  How does an AVR8 know "there is no vector"?  So, if the vector is at say address 4, what are the byte values there if "there is no vector"?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Sun. Mar 15, 2015 - 01:39 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok, this is from the SREG description of Atmega8a:

 

The I-bit is cleared by hardware after an
interrupt has occurred, and is set by the RETI instruction to enable subsequent interrupts.

so that's why I did not find a cli instruction in the INT1 ISR routine in the disassembly of my code, it's not done by software.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But that is not at all what you posted--

no External Interrupt Request is enabled

 As I mentioned, read all pertinent datasheet sections, in particular Interrupt Handing.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The global interrupt flag is cleared when an interrupt is >>handled<<, not when interrupt flags are >>set<<.

Regards,
Steve A.

The Board helps those that help themselves.