ADC on KL17

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ADC on KL17

1,019 Views
manonberthiaume
Contributor I

Hi,

I'm working on a KL17 chip but the reference board I had is a KL27. I try the example code for ADC on reference board and it works but on the KL17 the same code with modification (debugger set for a KL17) doesn't works. On pin PTE16 I read always 0xFFF but this pin is 0 with my multimeter. I looked registers and they look like the same value as KL27.What should I do to find the difference between these 2 chips?

0 Kudos
5 Replies

710 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Manon,

The main difference is ADC Reference:

For the MKL27Z64VLH4(64LQFP) on FRDM-KL27Z board, it contain dedicated VREFH and VREFL pins. The output of On-chip 1.2V high precision voltage reference VREF_OUT shares with VREFH.

For the MKL17Z64VFM4 (32QFN), both VREFH and VREFL pads are internally connected to VDDA and VSSA respectively.The output of On-chip 1.2V high precision voltage reference VREF_OUT shares with with PTE30 pin. When VREF_OUT is enabled, this pin needs to connect a capacitor to ground.

For the MKL17Z64VFM4 (32QFN):

1. When ADCx_SC2[REFSEL]=0, PTE30/VREF_OUT is selected as ADC Reference.

24.1.5 ADC Reference Options.png

 

2. When on-chip 1.2V VREF is enabled, PTE30 pin must be used as VREF_OUT and has to be configured as an analog input, such as ADC0_SE23.
It means you need to set PORTE_PCR30[MUX] = 000
PTE30 VREF0_B.png

 

3. PTE30 can also be used as an external reference voltage input as long as PTE30 is configured as analog input and VREF module is disabled.
It means you can connect external reference voltage to PTE30 and use it as ADC Reference. For example 3.3V. For the 36-pin and below packages the PTE30 is something like the VREFH pin of 48-pin and higher package.

PTE30 VREF_OUT and external reference voltage input.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

710 Views
albert_zhou
Contributor III

As the NOTe above, PTE30 pin as VREF_OUT and as ADC input (default). How to configure PTE30? very confuse...OUT? input?

I just use Vcc as Vrefrence, what should be PTE30? can this pin as ADC0SE23 like floating?

0 Kudos

710 Views
albert_zhou
Contributor III

When I connected PTE30(configured default for ADC0SE23) to Vcc. The ADC reading is OK.

0 Kudos

710 Views
albert_zhou
Contributor III

Hi Robin,

This helped me to solved my problem. Thanks,

Albert

0 Kudos

710 Views
albert_zhou
Contributor III

Hi Robin,

I configured PTE30 as default (ADC0SE23). The ADC reading is far from accuracy. 18mV reads 2300mV..., Since MKL27Z64VFM4(QFN32) VREFH is internal connected to VDDA, No Reference output needed, should VREF->TRM and VREF->SC all be default (=0)?. 

0 Kudos