PSoC 1 SmartSense_EMC and SmartSense_EMCplus Module Initialization Special Point – KBA222962

Version: **

 

Question:

When I use the SmartSense_EMCplus module together with a custom Rawdata Filter, the sensor gets stuck always.

 

Answer:

In PSoC® 1 CapSense® modules, sensor rawdata and baseline are always stored in waSnsResult[] and waSnsBaseline[] arrays. In general, both these arrays are updated after the InitializeBaselines() API is executed, but this is not true for SmartSense_EMC and SmartSense_EMCplus modules.

In SmartSense_EMC and SmartSense_EMCplus modules, waSnsResult[] remains in an unassigned state until ScanSensor() (or ScanAllSensors()) functions are executed. Therefore, if you use a custom filter in your project, execute ScanSensor() (or ScanAllSensors()) functions once before initializing the filter.

Correct code template is as follows:

     /****************************************/ 

           M8C_EnableGInt;

CapSense_Start();

CapSense_InitializeBaselines();

     CapSense_ScanAllSensors();

     Filter_Init(); // Initialize customize filter

     ……

  /****************************************/