Newest Viewed Downloaded

Preview – How this work?

Seminar #7 Interrupt & External - Interrupt

15th, J.H Won

Preview – How this work?

Contents

What is Interrupt? External Interrupt? - Resister Setting How to Code?

What is Interrupt?

What is Interrupt?

Execute Main Function Interrupt Request Save Return Adress Execute Interrupt Function Return Main Func Load Return Adress

External Interrupt?

External : 외부의 INTn Pin에 대한 입력으로인한 이벤트 발생 Rising Edge, Falling Edge, Low Level 논리값에 의한 변환

External Interrupt?

Resister Setting

MCUCR – MCU Control Resister Bit 3 ~ 0 : Interrupt Sense Control Resister

External Interrupt?

MCUCSR – MCU Control and Status Resister Bit 6 : Interrupt Sense Control Resister 2

External Interrupt?

GICR – General Interrupt Control Resister Bit 7 ~ 5 : External Interrupt Enable 0 ~ 2

External Interrupt?

GIFR – General Interrupt Flag Resister Bit 7 ~ 5 : External Interrupt Flag 0 ~ 2

How To Code ?

#include Int main(void) { DDRD = 0x00; // Data direction : Input DDRA = 0xff; // Data direction : output : LED MCUCR = 0x03; // Sense Control Resister 0, 1 : INT0 Falling Edge MCUCSR = 0x00; // Sense Control Resister 2 : None GICR = 0x40; // Interrupt Control : INT0 Enable GIFR = 0x00; // Flag Resister : None __SEI(); // = Enable_Interrupt();; for(;;) { } } #pragma vector=INT0_vect // Interrupt Function __interrupt void INT0_interrupt(void) { PORTA = 0xff; // QnA }

Repeat

Any Question?

Showing 1 - 14 of 14 items Details

Name: 
1194037281
Author: 
End-User
Company: 
N/A
Description: 
Preview – How this work?
Tags: 
interrupt | resister | external | control | int0 | bit | sense | void
Created: 
3/30/2010 2:32:30 PM
Slides: 
14
Views: 
0
Downloads: 
0
Rating: 
0


> Comment



Share this presentation
|

Comments

Share this presentation:

|
Sitemap