Hi Michael,
I've receive the reply about the TSI_GENCS[MODE] verification from the AE team and the detail information as follows, please refer to it for details.
- About noise generating
KL noise detection mode is used especially for IEC61000-4-6 test, in which the noise (range from 150KHz to 230MHz) is injected into 220V AC power supply, other than from the touch pad.
- How to verify TSI_GENCS[MODE]
Set MODE[3:2] = 0b11, and inject noise into power supply, then read MODE bits, the MODE[3:0] is the noise level (value ranges 0-15), which is proportional to the noise injected.
Attached below is the example code:
//Measure TSI channel noise level value in noise mode
void tsi_measure_noise(unsigned char uChN)
{
//enable noise mode
TSI0_GENCS |= (TSI_GENCS_ESOR_MASK
| TSI_GENCS_MODE(12u) // auto noise detection
| TSI_GENCS_DVOLT(0) // select voltage rails
| TSI_GENCS_EXTCHRG(0) // use 32Kohm Rs, no filter
| TSI_GENCS_REFCHRG(Iref0p5u)
| TSI_GENCS_PS(3)
| TSI_GENCS_NSCN(16)
);
//start channel scan
TSI0_DATA &= ~TSI_DATA_TSICH(0xF); // clear channels
TSI0_DATA |= TSI_DATA_TSICH(uChN); // set channel ID
TSI0_DATA |= TSI_DATA_SWTS_MASK; // start sampling
// wait for sampling done
while (!(TSI0_GENCS & TSI_GENCS_EOSF_MASK));
// read noise level
uNoiseLevel[uChN] = (uint16_t)((TSI0_GENCS & TSI_GENCS_MODE_MASK) >> TSI_GENCS_MODE_SHIFT);
// clear the flag
TSI0_GENCS |= TSI_GENCS_EOSF_MASK;
}
For more details, please refer to KL05 Reference Manual “Automatic noise mode”.
Have a great day,
Ping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------