Issue in ADC configuration

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue in ADC configuration

Jump to solution
1,456 Views
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 Kudos
Reply
1 Solution
1,417 Views
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

 

View solution in original post

0 Kudos
Reply
2 Replies
1,377 Views
pandi
Contributor III

thank you for reply

0 Kudos
Reply
1,418 Views
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 Kudos
Reply