The FRDM-KL25Z is an ultra-low-cost development platform for Kinetis L Series KL1x (KL14/15) and KL2x (KL24/25) MCUs built on ARM® Cortex™-M0+ processor. Features include easy access to MCU I/O, battery-ready, …

Unable to get AnalogIn on all 16 advertised ADC pins

12 May 2016

I am unable to get analog input voltages on all 16 advertised ADC pins of the FRDM-KL25Z. I'm not sure if it's an issue with MBED, the Freescale board or the microprocessor itself. According to https://elmicro.com/files/freescale/frdm-kl25z_pinouts_rev_1_0.pdf, there are 16 ADC pins. As I have tested them, there are:

Thirteen functional ADC pins:

  • PTE20 is a functional 16bit ADC pin
  • PTB0, PTB1, PTB2, PTB3, PTC0, PTC1, PTC2, PTD5, PTD6, PTE22, PTE30 are all functional 12bit ADC pins
  • PTE29 is a functional 12bit ADC pin, but the voltage connected to it also goes to PTE21

Three non-functional ADC pins:

  • PTD1 is not a functional ADC pin but seems to be stuck at 3.3V
  • PTE21 is advertised as a 16 bit ADC pin, but it not an independent ADC pin. Rather it reads the voltage connected to pin PTE29 instead.
  • PTE23 is advertised as a 12 bit ADC but logs a floating voltage instead of the correct voltage

The code I used to test these pins and make these observations is here: https://developer.mbed.org/users/skanderian/code/TestAnalogInPins/

I am particularly interested in getting pin PTE21 as a 16 bit ADC pin if at all possible. Thanks in advance for your help!

- Sami Kanderian

11 May 2016

I see that pin PTD1 is tied to the on board blue LED, so that would explain why I can not use PTD1 for ADC. However, I'm still interested in using PTE21 as a 16bit ADC pin if at all possible.

18 Feb 2017

Thank you for your post. Sorry that I can't be of any help. Hopefully you already managed to get PTE21 to work as a 16bit ADC. I am very curious to know how you tested the ADC bits. Could you please tell me how you managed to know that PTE20 is a functional 16 bit ADC? Thanks!