F) Pulse Accumulator Overflow Triggered Interrupt - Motorola 68HC12 User Manual

Table of Contents

Advertisement

Pulse Accumulator Overflow Triggered Interrupt:
Operation
This operation triggers an interrupt every time the pulse accumulator overflows.
Whenever the pulse accumulator overflows from 0xFFFF to 0x0000, the ISR will
trigger.
The set up of this interrupt is very similar to the edge triggered
interrupt, although PAMOD and PAEDGE
other settings are the same as for the edge triggered operation of the Pulse
Accumulator.
However instead of setting PAI to one, for Overflow operation PAOVI
is set to one.
The user must clear the flag in the ISR by writing a 1 to PAOVIF in the _H12PAFLG
register.
_H12PACTL:
bit 7
bit 6
unused
PAEN
_H12PAFLG:
bit 7
bit 6
unused
unused
Sample Code
This code simply displays when the interrupt is triggered.
_ _mod2_ _ void PAOvfInt();
void _ _main()
{
DB12->SetUserVector(PAOvf, PAOvfInt);
_H12PACTL=0x46;
while(1)
{
}
}
_ _mod2_ _ void PAOvfInt()
{
DB12->printf("triggered");
_H12PAFLG=0x02;
}
bit 5
bit 4
PAMOD
PEDGE
bit 5
bit 4
Unused
unused
// function prototype
// set for pulse accumulator overflow
// wait
// Pulse Accumulator ISR
// clear the flag
have no effect on the interrupt.
bit 3
bit 2
CLK1
CLK0
bit 3
bit 2
unused
unused
22
bit 1
bit 0
PAOVI
PAI
bit 1
bit 0
PAOVIF
PAIF
Most of the

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents