Internal ADC on T4, different value using ON/OFF button

danixdj

Well-known member
I have a problem.. I have totally different values form internal ADC if I reboot T4 by ON/OFF button or after an sketch update by usb.

I don't not why. It are totally different!


Code:
value = adc->analogRead(ADC_INTERNAL_SOURCE::VREFSH);


the value is around 1000 after a sketch update.
the value is around 35 after a reboot using on/off button.

what am I doing wrong?

Thank u
 
Have you considered waiting some time before reading the analog value? The internal capacitor may take a while to get saturated after a complete power loss.
 
Have you considered waiting some time before reading the analog value? The internal capacitor may take a while to get saturated after a complete power loss.

Yes but the value is fixed even after a long time (about 10 minutes), value = 35 instead of 1000
 
After some tests I could see that the values are absolutely random and the behavior is the same as an analogread on a pin not connected.
I don't know if this is a library problem or a hardware problem.
Anyway it is definitely a bug.
 
After some tests I could see that the values are absolutely random and the behavior is the same as an analogread on a pin not connected.
I don't know if this is a library problem or a hardware problem.
Anyway it is definitely a bug.

I have noticed something similar on analogreads where the noise will double ocassionally. I can solve it by recompiling and adding a small change in the code. It could be anything, like adding another task to something unrelated.
 
Back
Top