Mechatronics_Interrupts_Supplemental

Mechatronics_Interrupts_Supplemental - Interrupts...

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

View Full Document Right Arrow Icon
Interrupts Fundamentals of Mechatronics Engineering 10/16/08
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 Interrupts are similar to subroutines except that you don’t call interrupts, they happen whenever a particular event happens. ISR=Interrupt Subroutine Internal interrupts are generated from several sources like timer/counters. I could set up a counter to interrupt when it reaches a certain value. When it interrupts, the main program would stop and the interrupt routine would be executed. After completion, the reti command (return from interrupt) would load our return location into the program counter where it had been stored on the stack. External interrupts have a similar operation except that their source is from pins on the mP. I could set an interrupt to occur when a certain pin on the chip went high.
Background image of page 2
Read Inputs (A/D or digital) Process: Apply conversions and/or filtering Control Law Decide what to do, such as calculate outputs with PI control Actuate Devices Set pin high/low, PWM, Control SPI, serial output Initialization Interrupt (an internal or external event) Ex: pin goes high/low or timer reaches a certain count Reset is a type of interrupt anywhere
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

Mechatronics_Interrupts_Supplemental - Interrupts...

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

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