I have a need to capture and calculate frequency of an incoming signal. I've landed the signal on ADC_EXT_TRIG (pin 8) for me. I'm struggling to find the right combination of pin enables, iomux mapping, and interrupt enables to allow the rising (or falling) edge to trigger standard_interrupt(). Here's a snip of code (I've built from having something simple to throwing the kitchen sink you see below):
// Setup PWM0(SYNC) for TCAP
MiscAnalogRegs.GLBIOEN.bit.ADC_EXT_TRIG_IO_EN = 1;
MiscAnalogRegs.IOMUX.bit.EXT_TRIG_MUX_SEL = 1; // EXT_TRIG ALT functioned as TCAP
MiscAnalogRegs.GLBIOOE.bit.ADC_EXT_TRIG_IO_OE = 0;
TimerRegs.T24CAPCTRL.bit.CAP_SEL = 3; // TCAP sourced from (SYNC) pin
TimerRegs.T24CAPCTRL.bit.EDGE = 0x1; // Trigger on rising edge only
TimerRegs.T24CAPCTRL.bit.CAP_INT_ENA = 1; // Enable interrupt
disable_fast_interrupt(); //make sure fast interrupt is disabled
disable_interrupt();
write_reqmask(CIMINT_ALL_TMR_CAPT0); //(0x00100000) //enable T24 TCAP
enable_interrupt();
enable_fast_interrupt(); //make sure fast interrupt is enabled for OVP shutdown
In standard_interrupt I check for
if( 1 == TimerRegs.T24CAPCTRL.bit.CAP_INT_FLAG )
Not seeing any interrupts when I'm darn sure I've got solid edges/signal at the micro's pin. Thoughts?