151
C-Control Pro Mega Series
© 2008 Conrad Electronic
irqnr
specifies the interrupt type (see
Return Parameter
The return value expresses how often a interrupt got triggered until the function Irq_GetCount() has been
called. A value greater 1 shows that the interrupts
are triggered more rapidly than the interrupt service routine is processed.
6.9.4
Irq_SetVect
Interrupt Functions
Syntax
void Irq_SetVect(byte irqnr,float vect);
Sub Irq_SetVect(irqnr As Byte,vect As Single)
Description
Defines an interrupt service routine for a specified interrupt. At the end of the interrupt service routine the
function
() has to be called, otherwise the interrupt service routine gets called continuously.
Parameter
irqnr
specifies the interrupt type (see
vect is the name of the interrupt function to be called
Remark
The floating point data type seems not suitable for an interrupt vector, but a 4 byte data type is
needed to specify a function in the Mega128 environment.
6.9.5
IRQ Example
Example: Usage of Interrupt Routines
// normally Timer 2 is called every 10ms. In this example the variable
// cnt gets increased by one every 10ms
int cnt;
void ISR(void)
{
int irqcnt;
cnt=cnt+
1
;
irqcnt=Irq_GetCount(INT_TIM2COMP);
}
Содержание C-Control Pro Mega Series
Страница 1: ... 2008 Conrad Electronic C Control Pro Mega Series ...
Страница 9: ...VIII Inhalt 2008 Conrad Electronic ...
Страница 10: ...Part 1 ...
Страница 17: ...Part 2 ...
Страница 23: ...Part 3 ...
Страница 41: ...32 Hardware 2008 Conrad Electronic 3 3 5 3 Component Parts Plan ...
Страница 57: ...48 Hardware 2008 Conrad Electronic 3 4 5 3 Component Parts Plan ...
Страница 58: ...Part 4 ...
Страница 91: ...82 IDE 2008 Conrad Electronic ...
Страница 92: ...Part 5 ...
Страница 135: ...126 Compiler 2008 Conrad Electronic 31 1F US 63 3F 95 5F _ 127 7F DEL ...
Страница 136: ...Part 6 ...
Страница 231: ...Part 7 ...
Страница 240: ......