J) Irq Interrupt - Motorola 68HC12 User Manual

Table of Contents

Advertisement

IRQ Interrupt:
Operation
The IRQ is used to generate external interrupts.
operation for the IRQ.
detection.
The mode of the IRQ is controlled by _H12INTCR.
on the IRQ.
When this bit is set to 1 the IRQ is enabled, when it is set to zero
the IRQ is disabled.
will be used.
When this bit is 0, the IRQ will use low level detection.
is 1 the IRQ will be falling edge triggered.
the hardware in the 68HC12.
There are a few differences between the IRQ on the HC11 and the HC12.
HC11, the IRQ is not time protected.
time.
The value of IRQE, however, may only be written once in the program.
_H12INTCR:
bit 7
bit 6
IRQE
IRQEN
Sample Code
This is sample code that triggers the IRQ every time a falling edge is detected.
This assumes there is a switch of some sort on the IRQ input to generate the
falling edge.
_ _mod2_ _ void IRQInt();
void _ _main()
{
DB12->SetUserVector(IRQ, IRQInt);
_H12INTCR=0xC0;
while(1)
{
}
}
_ _mod2_ _ IRQInt()
{
DB12->printf("IRQ triggered");
}
One is falling edge triggered, the other is low level
IRQE determines whether low level or edge triggered operation
bit 5
bit 4
DLY
unused
// function prototype
// set up the IRQ for falling edge triggered
// infinite loop
// IRQ ISR
There are two basic modes of
The IRQ is automatically cleared by
IRQEN may be written to and read from at any
bit 3
bit 2
unused
unused
// set up the vector
// display a message
26
IRQEN is used to turn
Unlike the
bit 1
bit 0
unused
unused
When it

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents