Motorola 68HC12 User Manual page 21

Table of Contents

Advertisement

_H12PAFLG:
bit 7
bit 6
unused
unused
The value of the pulse accumulator is stored in _H12PACNT.
Sample Code
This code detects the edge and triggers an interrupt.
_ _mod2_ _ void PAEdgeInt();
void _ _main();
{
DB12->SetUserVector(PAEdge, PAEdgeInt);
_H12PACTL=0x55;
while(1)
{
}
}
_ _mod2_ _ void PAEdgeInt()
{
DB12->printf("Pulse Accum triggered \n");
_H12PAFLG=0x01;
}
bit 5
bit 4
unused
unused
// function prototype
// set the pulse accumulator - rising edge
// wait
// Pulse Accumulator ISR
// clear the flag
bit 3
bit 2
unused
unused
21
bit 1
bit 0
PAOVIF
PAIF

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents