Download Inhoudsopgave Inhoud Print deze pagina

Conrad Electronic C-Control Pro Mega 32 Gebruiksaanwijzing pagina 78

Inhoudsopgave

Advertenties

Tabel interrupt vectoren:
Nr Interrupt naam
0
INT_0
1
INT_1
2
INT_2
3
INT_TIM1CAPT
4
INT_TIM1CMPA
5
INT_TIM1CMPB
6
INT_TIM1OVF
7
INT_TIM0COMP
8
INT_TIM0OVF
9
INT_ANA_COMP
10
INT_ADC
11
INT_TIM2COMP
12
INT_TIM2OVF
5.3.9.9
IRQ voorbeeld
Voorbeeld: gebruik van interrupt routines
// Timer 2 loopt normaalgesproken in de 10msa maat. In dit
// voorbeeld wordt daarom de variabele cnt elke 10ms met 1 verhoogd
int cnt;
void
ISR(void)
{
int irqcnt;
cnt=cnt+1;
irqcnt=Irq_GetCountg(INT_TIM2COMP);
}
void
main(void)
{
cnt=0;
Irq_SetVect(INT_TIM2COMP,ISR);
while (true);
// Eindeloze lus
}
Beschrijving
Externe interrupt0
Externe interrupt1
Externe interrupt2
Timer1 Capture
Timer1 CompareA
Timer1 CompareB
Timer1 Overflow
Timer0 Compare
Timer0 Overflow
Analoge comparator
ADC
Timer2 Compare
Timer2 Overflow
78

Advertenties

Inhoudsopgave
loading

Gerelateerde Producten voor Conrad Electronic C-Control Pro Mega 32

Inhoudsopgave