Mechatronics_12_02_08_extInt_AVR

Mechatronics_12_02_08_extInt_AVR - Generally, dont need to...

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

View Full Document Right Arrow Icon
External Interrupts, AVR Studio other Random Stuff Fundamentals of Mechatronics Engineering 12/02/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
(Pre lecture Comments) Have you signed up for project demo time slot? Demo is next Tuesday, 12/09 Next class, 12/04: I will be in the Mechatronics lab to help you with any last minute project troubles. Any lecture related questions/help also welcome. So, don’t come to lecture if you want to talk to me, go to Mechatronics Lab.
Background image of page 2
External Interrupts EICRA (External Interrupt Control Register A) for ext int. 3 to 0 Sets interupt on low, rising or falling EICRB same as A, but for ext. int. 7 to 4
Background image of page 3

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

View Full DocumentRight Arrow Icon
External Interrupts EIMSK (External Interrupt MASK) Set corresponding bit to enable that external interrupt. EIFR (External Interrupt Flag Register) Sets flag bit when interrupt happens
Background image of page 4
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

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

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

Unformatted text preview: Generally, dont need to worry about this if interrupt is enabled. Setting Up External Interrupts EICRA=0x03; //rising edge (11) for ext. int. 0 EIMSK=0x01; //external int. 0 enable ISR( theInterruptVectorName) //this is the interrupt routine { // put your code here that will calculate the speed } Where are the ext. int. pins? Just like everything else, check the pin configuration diagram. INT4-7 INT0-3 Using AVR Studio (in class demo) Using the Watch window Options: Optimization, math library, etc. Saving Port Data Thread (interrupt) completion check Using program memory Random The application notes on Atmega site are great. Check out the one on PID control. Has code too....
View Full Document

This note was uploaded on 09/08/2010 for the course ME 106 at San Jose State University .

Page1 / 8

Mechatronics_12_02_08_extInt_AVR - Generally, dont need to...

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

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