Hi, I'm working in a project with the MKL02Z32VFG4. In this project i need to read the ADC channel 6 placed ( according to KL02P32M48F0RM ) in the PORTB0 (pin 8) by default. When I put signals in the PIN 8 always read random values. After some days working in this mistake and without figure it out, I was able verify that the PORTB0 doesn't has assigned any ADC channel but, the ADC channels 6 and 4 are linked with the PORTB2 ( pin 10 ).
Could anybody verify this mistake?
thanks.
Solved! Go to Solution.
Hi Antonio,
For KL02Z32VFG4, ADC channel 6 is reserved, ADC0_SE6 is ADC channel 9, please check the following picture from the reference manual, page 63.
So, I think you configure the wrong ADC channel, you should choose SC1n[ADCH] = 01001.
Wish it helps you!
If you still have question, please contact me!
Have a great day,
Jingjing
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Antonio,
For KL02Z32VFG4, ADC channel 6 is reserved, ADC0_SE6 is ADC channel 9, please check the following picture from the reference manual, page 63.
So, I think you configure the wrong ADC channel, you should choose SC1n[ADCH] = 01001.
Wish it helps you!
If you still have question, please contact me!
Have a great day,
Jingjing
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Jingjing,
Thanks for your reply, I use to work with the specific data sheet ( KL02P32M48SF0) of the uC and didn't check the page 63 of the sub-family reference manual.
I thought that the name of ADC0_SE6 was related with Channel 6. but now I can see that to decode is needed a "conversion table".