Issue in ADC configuration

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Issue in ADC configuration

跳至解决方案
1,625 次查看
pandi
Contributor III

Hi Everyone,InWhatsApp Image 2023-12-23 at 4.02.17 PM.jpeg 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 adcScreenshot 2023-12-23 161512.pngScreenshot 2023-12-23 162058.png 

0 项奖励
回复
1 解答
1,586 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

 

 

xiangjun_rong_1-1703497045957.png

 

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,546 次查看
pandi
Contributor III

thank you for reply

0 项奖励
回复
1,587 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

 

 

xiangjun_rong_1-1703497045957.png

 

0 项奖励
回复