Hi,
Thanks for the response. Is there anything unusual about channel 13 on the FRDM-KL02Z?
I can read channel 0 fine. I can read channel 13 (or at least I believe its 13), however if I tie the pins for channel 13 down to 0V the ADC values still shows a floating voltage level. I am using PTB13 for channel 13, which is J10 pin 3 on the FRDM-KL02Z.
To read channel 13 I am triggering the conversion with:-
ADC0_SC1A = ADC_SC1_AIEN_MASK | ADC_SC1_ADCH(13);
In init
PORTB_PCR13 |= PORT_PCR_MUX(0); // ADC use
Any idea why the ADC is not changing if I ties the pin to 0V?
Maybe I am triggering incorrectly. I am using TPM1 to HW trigger the ADC on an overflow.
In my ADC ISR I am reading the result from the ADC channel and then kicking off the conversion for the next ADC channel. On the next ADC ISR I grab the ADC result from the previous conversion and kick off the next channel conversion etc......
I'm kicking off the conversion with
ADC0_SC1A = ADC_SC1_AIEN_MASK | ADC_SC1_ADCH(channel);
Do I need to do this for HW triggering, only it seems the same as I what I used fro SW triggering ?