I'm using the LPC1114.
So, this is what I have so far: I've set up CT32B0 to generated an interrupt on a capture event. The capture event occurs when it sees a rising edge on PIO1.5.
Here is pseudocode for the relevant IRQ handler:
void TIMER32_0_IRQHandler (void)
// reset the timer (I want to reset the timer ASAP so that timing for the next cycle is accurate)
// clear the capture interrupt (no other interrupts are enabled for this timer)
// record the captured value into a circular buffer
For // resetting the timer, there are two options unless I'm mistaken. I can enable the reset bit in the timer control register. This will reset the counter on each rising edge of the peripheral clock (36 MHz). Or I can manually load zero into the count register (TMR32B0TC).
Does this general approach seem to make sense?
Please sign in to leave a comment.