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