AnsweredAssumed Answered

Fluctuation/Instability in ADC of K60

Question asked by Rafael Werneck on May 11, 2015


My tests were based on the sample project "adc_demo" of the IAR directory (C:\Program Files\IAR Systems\Embedded Workbench 6.5\arm\examples\Freescale\Kinetis\adc_demo).

This example make the measurement of the potentiometer on the ADC1_DM1 channel, as shown below:

When the potentiometer is at 0V position (I also put the ADC1_DM1 pin on GND to make sure that the value is 0V), I have unstable measurements of this ADC channel after a reset (either at reset button SW3, or reset by IAR software).

Below the stable measurement:


After the reset, we have the following values, with a wide variation in R1B (potentiometer channel):


After a few more resets it back to be stable.

In the original example of IAR, only made some small modifications, such as:

- PMC_REGSC |= 1;        // To enable the bandgap buffer to read bandgap value.

- Master_Adc_Config.STATUS1A = AIEN_ON | DIFF_SINGLE | ADC_SC1_ADCH(0x1B); // Bandgap Read in ADC0_RA.

- Master_Adc_Config.STATUS1B = AIEN_ON | DIFF_SINGLE | ADC_SC1_ADCH(0x1B); // Vrefsh read in ADC0_RB.

- Master_Adc_Config.STATUS1A = AIEN_ON | DIFF_SINGLE | ADC_SC1_ADCH(0x1E); // Vrefsl read in ADC1_RA.

- Master_Adc_Config.STATUS1B = AIEN_ON | DIFF_SINGLE | ADC_SC1_ADCH(ADC1_CHANB);             // Potentiometer read.

- printf("Bandgap=%6d  VREFSH=%6d  VREFSL=%6d  R1B=%6d\r\n", result0A,result0B,result1A,result1B);        // To show the results in console (UART).



The sample project is attached.

Original Attachment has been moved to: