This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-CC26X2R1: Sensor Controller Studio Generated Interrupt in User Application

Part Number: LAUNCHXL-CC26X2R1
Other Parts Discussed in Thread: SIMPLELINK-CC13X2-26X2-SDK

Hi folks,

I am developing a low-power project on the CC26x2R1 launchpad with the Sensor Controller Studio (2.7.0.155) and Code Compositor Studio (9.3.0.00012).  I have modified the LaunchPad + ULP Sense Booster Pack example project, "Capacitive Touch" with the following code to ensure reliable capacitive sensing. I would like to take this project a step further by generating an interrupt from the SCS. This interrupt would be handled by the user application and shall notify the user that the battery is too low for the device to operate.

U16 voltage;


// Get voltage from AON_BATMON [unsigned, unit = 1/256 volts]
sysGetBatmonVolt(voltage);
output.cellVoltage = voltage;

if (voltage > VADC_COUNT_2V85) {

// Clear Critical Battery Flag
output.BatteryCriticalAlert = 0;

// Run Capacitive Sensor Sampling

} else {

// Set Critical Battery Flag
output.BatteryCriticalAlert = 1;

// Alert the User Application
fwGenAlertInterrupt();

}

I read the sensor controller studio documentation on "fwGenAlertInterrupt()" and "fwGenQuickAlertInterrupt()" and believe that I would need to use the former in this case.
The following code exists within the User Application (where the SCS and User Application interface is coded) and handles MCU wake-up from capacitive sensor input via "fwSwitchOutputBuffer()"

void scTaskAlertCallback(void) {

// Wake up the OS task
Semaphore_post(Semaphore_handle(&semScTaskAlert));

} // scTaskAlertCallback

Q: It is possible to generate a specialized interrupt?

Q: Am I better off modifying my User Application to check the value of "Output->BatteryCriticalAlert" to handle the condition?

Thank you,

Ken

  • Hi Ken,

    Have you already completed the Sensor Controller SimpleLink Academy Labs?  Several of these include tasks/instructions for adding fwGenAlertInterrupt to your application.  I also recommend that you ensure your CCS version matches the recommendation from the SIMPLELINK-CC13X2-26X2-SDK Release Notes.

    That being said, the CC2652R1 has an on-board temperture and battery monitor that exists outside of the Sensor Controller interface, you can review the temperatureNotify example and Temperature.h TI Drivers API for more details.

    Regards,
    Ryan

  • Hi Ryan,

    I am afraid I have not completed all projects.  Considering that this current project features task level integration, I think I will try to extend the functionality through the SWI/HWI interrupts. 

    I am aware of the incompatibility of the SDK, CCS, and SCS installations - unfortunately I am continuing development of the SCS source used within an older project. I have reviewed the tutorials for updating the project SDK, however I am not capable yet of addressing problems that could arise during the transition in the larger multi-device (multiple BLE stacks) project.

    Thank you for your advice - this is very helpful.

    Best,

    Ken