void PAA_Init(void){ PAEN = 1; // 16 bit pulse accumulator A system enabled. PAMOD = 0; // set to "event counter" mode PEDGE = 1; // rising edge CLK1 = 0; // not sure why this is zero CLK0 = 0; // not sure why this is zero PAOVI = 1; // interrupt if PAOVF os set PAI = 0; // don't want an interrupt every time there's a pulse on PA}
void Flow_Init(void){ PBEN = 1; // 16 bit pulse accumulator B system enabled. PB0VI = 1; // interrupt if PBOVF is set}
Message Edited by Alban on 02-06-2006 09:19 AM
Seems that I forgot to set the bits in TCTL4 that set the input edge detect for pulse accumulator B. I want to capture on the rising edge, so I set EDG0A = 1;
Now it works properly. It was in a bit of an obscure location so I couldn't find it right away.
Thanks anyway,
Bernie