I try to use the internal temperature sensor, I'm using kea8 kinetis microcontroller.
When I sample an ordinary analog input, from external pin, it is all right, but when I try to sample an internal analog channel (Vbandgap or temperature sensor) the value that I have obtained is not consistent, very unstable and change if I start the conversion mode. For example, starting the bandgap sampling by:
ADC_SC1 &= ~0x0000001f;
ADC_SC1 |= 23; // sampling bandgap channel
obtain the result from about 0x300 to 0xaff
elsewhere by setting
ACD_SC1 = 23 | INTERRUPT_ENABLE_MASK;
the result is from 0x100 to 0x12f;
The ADC is configured for long sample time and with different clock frequency (busclock = 5 to 20 MHz, ADCLK = busclock /4 to 16).
Any suggestion to solve my problem?
I can't especially help with your 'inconsistent ADC reads' -- you will certainly need to solve THAT! (Did you enable the bandgap device?).
But as for AN3031, I highly recommend my more comprehensive post:
Hello Alessio De Marchi,
I apologize for this delay, please check this Application note, it is for 8bit but the process is the same hope this help you solve your problem.
have a great day !
Best Regards