[Icc-avr] Interrupt Help Please (Happy New Year)
John Baraclough
j_baraclough at zetnet.co.uk
Tue Jan 1 15:53:30 PST 2008
Hi Johannes,
Actually page 84 of the AT90USB162 data sheet says:
/*When the external interrupt is enabled and is configured as level
triggered, the interrupt will trigger as long as the pin is held low.
Note that recognition of falling or rising edge interrupts on INT7:4
requires the presence of an I/O clock, described in “System Clock and
Clock Options” on page 25. Low level interrupts and the edge interrupt
on INT3:0 are detected asynchronously. This implies that these
interrupts can be used for waking the part also from sleep modes other
than Idle mode. The I/O clock is halted in all sleep modes except Idle
mode.*
/
So INT7..4 can only wake up the part from all sleep modes if it is used
as a level interrupt and that level is maintained until the part has
completed the wake-up. INT3..0 can be used as edge or level triggered
interrupts to wake up the part from all sleep modes as they are detected
asynchronously.
INT1 cannot be used as a pin-change interrupt, but must be programmed to
respond to a defined edge or level. According to Andrew's specification
in his original post this is fine. At startup, first check that the
level is not high already and then set the interrupt to respond to a
rising edge. If you don't do the first check then the interrupt may
never be triggered. When a rising edge is detected, in the ISR reset the
interrupt to respond to a falling edge and set a semaphore for 'main()'
that indicates the edge has been seen. 'main()' must then tidy up
everything before executing the 'sleep' command.
HTH
All the best for now,
John
Johannes Assenbaum wrote:
> Hi Andrew,
>
> as datasheet tells, only INT7..4 level interrupts are able to wake up CPU from sleep mode other than idle.
>
> As I understand, this will not fit your needs.
>
> Best regards,
> Johannes
>
>
More information about the Icc-avr
mailing list