Hi Joachim
First if TSI is working in a very peace enviroment the TSI_GENCS[MODE] will be read back as zero. Must be noise coupled to the TSI active channels and then TSI will signalize the noise level to 4bit number and return back to TSI_GENCS[MODE] for user to read.
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;
}
I hope this will help you.
Have a great day,
Vicente
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------