Part Number: CC2642R
Other Parts Discussed in Thread: SIMPLELINK-CC13XX-CC26XX-SDK
Hi,
I'm new using the sensor controller and sensor controller studio.
I need a fast response when the ADC exceeds the high threshold. I think the example ADC Windows Monitor does that.
I just changed the IO and the adcWindowHigh limit of this example and when I executing this example using the Task Testing, it works fine. I can see the expected behavior and correct values.


But when I import the project into the code composer studio, I can't see the same behavior, the interrupt never occurs.
I try to include a volatile variable to run continuously the application but this variable never changes.
This is my changed code:
...
// Task data
Task_Struct myTask;
Char myTaskStack[1024];
// Semaphore used to wait for Sensor Controller task ALERT event
static Semaphore_Struct semScTaskAlert;
volatile uint8_t state;
void scCtrlReadyCallback(void) {
} // scCtrlReadyCallback
void scTaskAlertCallback(void) {
// Wake up the OS task
Semaphore_post(Semaphore_handle(&semScTaskAlert));
} // scTaskAlertCallback
PIN_Config pLedPinTable[] = {
Board_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
Board_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
PIN_TERMINATE
};
PIN_State ledPinState;
void taskFxn(UArg a0, UArg a1) {
PIN_Handle hLedPins;
// Enable LED pins
hLedPins = PIN_open(&ledPinState, pLedPinTable);
// Initialize the Sensor Controller
scifOsalInit();
scifOsalRegisterCtrlReadyCallback(scCtrlReadyCallback);
scifOsalRegisterTaskAlertCallback(scTaskAlertCallback);
scifInit(&scifDriverSetup);
scifStartRtcTicksNow(0x00010000 / 8);
// Configure and start the Sensor Controller's ADC window monitor task (not to be confused with OS tasks)
scifTaskData.adcWindowMonitor.cfg.adcWindowHigh = 3300;
scifTaskData.adcWindowMonitor.cfg.adcWindowLow = 0;
scifStartTasksNbl(BV(SCIF_ADC_WINDOW_MONITOR_TASK_ID));
// Main loop
while (1) {
// Wait for an ALERT callback
Semaphore_pend(Semaphore_handle(&semScTaskAlert), BIOS_WAIT_FOREVER);
// Clear the ALERT interrupt source
scifClearAlertIntSource();
// Indicate on LEDs whether the current ADC value is high and/or low
if (scifTaskData.adcWindowMonitor.output.bvWindowState & SCIF_ADC_WINDOW_MONITOR_BV_ADC_WINDOW_LOW) {
PIN_setOutputValue(hLedPins, Board_GLED, 1);
state = 1;
} else {
PIN_setOutputValue(hLedPins, Board_GLED, 0);
state = 2;
}
if (scifTaskData.adcWindowMonitor.output.bvWindowState & SCIF_ADC_WINDOW_MONITOR_BV_ADC_WINDOW_HIGH) {
PIN_setOutputValue(hLedPins, Board_RLED, 1);
state = 3;
} else {
PIN_setOutputValue(hLedPins, Board_RLED, 0);
state = 4;
}
// Acknowledge the alert event
scifAckAlertEvents();
}
} // taskFxn
...
And this is the debugging information's:

And when I read the same DIO using just the HAL driver, I can read practically the same values as when I use the Task Testing.

This my adc configuration:

I use:
Sensor Controller Studio: Version 2.6.0.132.
Code Composer Studio: Version: 11.1.0.00011.
Both with SimpleLink CC13x2 26x2 SDK 3.40.00.02.
Thanks in advance,
Cristiane Bellenzier Piaia

