Hi Everyone,In mkv31f512vll12 (image is attached below)while configuring single channel adc in Mcuxpresso IDE the actual process of reading the adc value was confusing and i actually tried by reading the adc result data register ADC_RD but i can't able to view the register value in runtime in Mcuxpresso IDE is there any method is available to view register or variable value in runtime and i am new to the nxp so any lead to reading adc value let me know
Here I have attached few snippets of code(image)
for configuring adc
Solved! Go to Solution.
Hi,
This is the ADC working mechanism, for software triggering mode as you have done, writing the ADCx_SC1n register with channel bits ADCH will start the ADC conversion automatically, you can check the COCO bit to know if the conversion is over, if it is over, you can read the result.
The ADC16_SetChannelConfig(...,DEMO_ADC16_CHANNEL_GROUP,&adc16ChannelConfigStruct) line writes the ADCx_SC1n register, at the same start ADC conversion.
The ADC16_GetChannelStatussFlag() read the ADCx_SC1n register and poll the COCO bit.
Hope it can help you
BR
XiangJun Rong
thank you for reply
Hi,
This is the ADC working mechanism, for software triggering mode as you have done, writing the ADCx_SC1n register with channel bits ADCH will start the ADC conversion automatically, you can check the COCO bit to know if the conversion is over, if it is over, you can read the result.
The ADC16_SetChannelConfig(...,DEMO_ADC16_CHANNEL_GROUP,&adc16ChannelConfigStruct) line writes the ADCx_SC1n register, at the same start ADC conversion.
The ADC16_GetChannelStatussFlag() read the ADCx_SC1n register and poll the COCO bit.
Hope it can help you
BR
XiangJun Rong