Hi, i have been trying to read the ADC in the FRDM KL25, i can't read the channel ADC0_SE7b(PDT6) and ADC0_SE6b (PTD5),with other channels if i can read the ADC, but only with the PDT5 and PTD6 i had having problems.
Can somebody support me please???
this is my code.
greetings.
Solved! Go to Solution.
Jose
if you want to sample ADC0_SE7b rather than ADC0_SE7a (which your code is doing) set the MUX selection bit to B in the ADC0_CFG2 register.
That is, add
ADC0_CFG2 |= 0x10;
after
ADC0_SC1A = ADC_SC1_ADCH(31);
For ADC0_SE6b the same MUX bit must be set (there is no ADC0_SE6a input on your device).
Regards
Mark
http://www.utasker.com/kinetis.html
P.S: The uTasker project also includes DMA driven ADC/DAC drivers for KL devices!
Jose
if you want to sample ADC0_SE7b rather than ADC0_SE7a (which your code is doing) set the MUX selection bit to B in the ADC0_CFG2 register.
That is, add
ADC0_CFG2 |= 0x10;
after
ADC0_SC1A = ADC_SC1_ADCH(31);
For ADC0_SE6b the same MUX bit must be set (there is no ADC0_SE6a input on your device).
Regards
Mark
http://www.utasker.com/kinetis.html
P.S: The uTasker project also includes DMA driven ADC/DAC drivers for KL devices!
Hi Mark,
Maybe you will be able to help me. I am new to FS.
I am using KDS and the PE on the same board and I am facing the same problem. how can I read the ADC0_SE7b? (I understood I will need to change the mux but I am not sure how to do it in real time)
Thanks,
Avner
Avne
What do you mean with real-time?
To switch the input mux between a and b
ADC0_CFG2 &= ~0x10;
and
ADC0_CFG2 |= 0x10;
is all that is needed.
Regards
Mark
Kinetis: http://www.utasker.com/kinetis.html
KL25: http://www.utasker.com/kinetis/FRDM-KL25Z.html / http://www.utasker.com/kinetis/TWR-KL25Z48M.html
ADC/DAC: http://www.utasker.com/docs/uTasker/uTaskerADC.pdf
For the complete "out-of-the-box" Kinetis experience and faster time to market
Thanks Mark, my program is working now, i don't know why my program was not function when i had ADC0_CFG2 |= ADC_CFG2_MUXSEL_MAKS; but when i indicated the direction in HEX the program coming to function correctly.