Issue in ADC configuration

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Issue in ADC configuration

ソリューションへジャンプ
4,498件の閲覧回数
pandi
Contributor III

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

0 件の賞賛
返信
1 解決策
4,459件の閲覧回数
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.pngxiangjun_rong_1-1703497045957.png

 

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
4,419件の閲覧回数
pandi
Contributor III

thank you for reply

0 件の賞賛
返信
4,460件の閲覧回数
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.pngxiangjun_rong_1-1703497045957.png

 

0 件の賞賛
返信