Tool/software: Code Composer Studio
Hello Ti,
I have a question regarding the ADC selftest capability and its current design implementation in the safety lib.
What is the purpose of the SL_Approx calculation which is called several times in the source code?
In general, you measure your boundaries (RefLow and RefHigh) in calibration mode which should be in 0 and 0xFFF. Here I am facing several times that my RefLow voltage is 2 and RefHigh voltage is 4090 in decimal.
When changing into ADC self-test mode, the ADC channel input is connected to VrefHigh or VrefLow to the parallel resistor structure.
As a result of this, a self-test with pull-up produces a result (Vu) that is above the normal conversion (Vn). The same counts for the self-test with pulldown (Vd) which produces a result below the normal conversion (Vn).
Theoretically speaking you just need to check against valid ranges whether the pin is good or not via the following statement (VrefLow < Vd < Vn < Vu < VrefHigh).
Therefore, I don't undestand why this approximation in the lib is performed several times. Then, I noticed due to my external circuit which is connected to the ADC Pin, sampling the normal voltage (Vn) during this test provides always a "0" in decimal although VrefLow provides me a result of 2 in decimal. Sometimes even Vd ( = 2) is smaller than VrefLow (= 4).
Here I come into a condition I cannot recover anymore as it is a failure for the ADC pin test
I have increased the sampling and discharge time in the adc register to the maximum as it was suggested in the forum to overcome the issue provided by the example files from the lib, but somehow still few ADC channels don't survive this test.