Hello Everyone,
I am currently working with the KL46Z mcu
and trying to use ADC with PE 10.4 and averaging enable.
When I enable averaging of 32 Samples per channel
my readings jump all over the place, but when setup for less than 32
my readings are OK.
The KL46Z is power from 5V using internal VREG
VREFH is tied to VDDA which is tied to VOUT33 from mcu.
VREFL is tied to VSSA which is tied to Board's GND (VSS1 to 4).
The ADC is setup for 12-Bit Resolution and 20us Conversion Time
Now if the averaging are set below 32 samples but ADC resolution is set for 16-Bit
the readings are jump around not as much as when 32 Aver setup but readings are
not correct.
Has any body else experience similar issue?
Hi, Moises
This jumper setting will not affect your measure value. My suggestion for you is using internal bandgap as ADC reference voltage, then test again.
Best Regards
Paul
Hello Paul,
Thank you for your response and suggestion.
I am using PE to setup the ADC and other peripherals
and even with PE set to Expert, I don't see an option to use the bandgap as the ADC reference.
I am using the ADC_LDD component and for ADC Reference all I get is
High Voltage Reference
1) VREFH
2) VDDA
Low Voltage Reference
1) VREFL
2) VSSA
That is It.
Must be a bug on PE 10.4.
The other strange thing I notice is that with my current Settings of 12-Bits, 16 HW averaging, 20uS conversion time, and 2 Channels
1) ADC0_DP3
2) Temperature Sensor
The ADC0_DP3 always returns 0 volts
The Temperature Sensor returns correctly.
I know for a fact that at Pin 20 of the KL46Z 100 LQFP package (PORTE Bit 22) there is 1.75 DC Volts with respect to VSSA.
because that is the voltage I am connecting to the Pin.
If I set the ADC for Differential Mode my all readings jump all over the place whether it is 12-Bit or 16-Bit resolution.
Here some of the settings that I have tried in trying to read the ADC0_DP3 analog Pin of the KL46Z 100 LQFP chip.
ADC reference are set to VREFH and VREFL. VREFH is tie to VDDA and VREFL to VSSA. There is a 100nF Ceramic Capacitor across VDDA and VSSA.
1) 16-Bit Single Ended Mode, HW averaging with 1:
Internal Temperature Reads OK,
ADC0_DP3 always returns 0 volts when there is 1.75 DC on the Pin with respect to VSSA.
2) 16-Bit, Single Ended Mode, HW averaging with 2:
ADC0_DP3 returns values that change every other reading.
Internal Temperature Sensor returns OK, but some times returns wrong value.
3) 16-Bit, Single Ended Mode, HW averaging with 4,6,8,16, and 32:
ADC0_DP3 returns values that jump around all the time
Internal Temperature returns values that jump around all the time.
It seems to me that some thing is not correct with the ADC_LDD Component from PE 10.4 suite.
I don't think it is the chip's ADC, but can't rule it out yet, since I have 4 other prototypes that use the same KL46Z chip and they all do the same thing.
4) 12-Bit, Single Ended Mode, HW averaging with 1:
ADC0_DP3 always returns 0 volts
Internal Temperature Sensor returns OK, with good readings. At my current room temperature the voltage is around 0.71 volts which is about 28.7 degrees C.
5) 12-Bit, Single Ended Mode, HW averaging with 2:
ADC0_DP3 always returns 0 volts
Internal Temperature Sensor returns OK, with good readings. At my current room temperature the voltage is around 0.71 volts which is about 28.7 degrees C.
6) 12-Bit, Single Ended Mode, HW averaging with 4:
ADC0_DP3 always returns 0 volts
Internal Temperature Sensor returns OK.
7) 12-Bit, Single Ended Mode, HW averaging with 8:
ADC0_DP3 always returns 0 volts
Internal Temperature Sensor returns OK.
8) 12-Bit, Single Ended Mode, HW averaging with 16:
ADC0_DP3 always returns 0 volts
Internal Temperature Sensor returns OK.
9) 12-Bit, Single Ended Mode, HW averaging with 32:
ADC0_DP3 returns values that jump around
Internal Temperature Sensor returns values that jump around as well.
Don't know what to make of this other than I can't get the ADC on the KL46Z to read correctly the ADC0_DP3 pin on either 12-Bit or 16-Bit Modes.
Internal Temperature Sensor works with either 12-Bit Mode as long as HW averaging is below 32 and in 16-Bit Mode as long as averaging is 1.
Any other ideas?