interrupts - On return interrupts are re-enabled Each...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Interrupts
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Interrupts
Background image of page 2
uC operation Typically the uC is running in a continuous loop. We have seen the trap This loop is called the main loop or main process. Main loop program
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
uC Interrupts When an event occurs the uC stops processing the main loop Control is sent to a routine to deal with the event causing the interrupt. Similar to executing a subroutine.
Background image of page 4
Interrupt Service Routines An ISR is a block of code that is run for a given interrupt event. The AVR automatically Dissables interrupts Jumps to your code
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: On return interrupts are re-enabled Each interrupt has a specified location to place the code. This is performed the same as the reset vector. ATMEGA169 Interrupt vector table Add an rjmp or jmp to your Interrupt service routine. ISRs The code for an ISR is similar to a subroutine. The ret instruction is replaced with a reti All registers used and the SREG should be stored on the stack and returned to the origional values to preserve the main loop logic....
View Full Document

Page1 / 7

interrupts - On return interrupts are re-enabled Each...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online