Hi,
I tried to create an example just with the COMPA and the COMPA event trigger. To do that a linked the COMPA to the DIO30. DIO30 is an ADC powered with 3.3V. My trigger is set to occurs when the DIO30 falling edge.
This is my code:
Initialization Code
state.exec = 1; // Enable COMPA compaEnable(COMPA_PWRMODE_ACTIVE); // Select COMPA reference GND PIN and input //its works with COMPA_REF_ADC_REF, COMPA_REF_DCOUPL and VSS compaSelectIntRef(COMPA_REF_VSS); compaSelectGpioInput(AUXIO_A_ADC_DIO_30); // Wait for the COMPA output to settle fwDelayUs(10); compaGetOutput(output.compaValue); // Setup the first event trigger, on high level //0: eventIndex 0:falling edge evhSetupCompaTrigger(0, 0, EVH_COMPA_TRIG_ON_EDGE);
Execution Code
compaGetOutput(output.compaValue);
Event Handler A Code
state.exec = 3; // Check the COMPA output // The comparator output value, 0 if low, 1 if high compaGetOutput(output.compaValue); // Setup the next event trigger, on low level evhSetupCompaTrigger(0, 0, EVH_COMPA_TRIG_ON_EDGE);
Termination Code
// The currently enabled event trigger must be cancelled manually evhCancelTrigger(0); // Disable COMPA compaDisable();
In the Task Testing I can see the compaValue changing but the variable state.exec never changes to 3 (it seems that the event never happens).
What I'm missing?
I tried with the Sensor Controller Studio: Version 2.6.0.132 (simplelink_cc13x2_26x2_sdk_3_40_00_02) and 2.9.0.208 (simplelink_cc13xx_cc26xx_sdk_6_10_00_29).
Thanks in advance.