How to integrate peripheral ADC?

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

How to integrate peripheral ADC?

跳至解决方案
2,488 次查看
ZD-Zhengkun
Contributor II

Hello, dear working staffs and others,

I'm currently using the MPC5748G DEVKIT and I want to convert the analog signal from the peripheral potentiometer. I've checked several examples, but they are all using the Potentiometer on the board (ADC0 CH9). 

Thus, I want to ask about the possibility to include the analog signal in PG13 and convert the signal using ADC1

ZD-Zhengkun_0-1617810721194.png

And if possible, how should I know the corresponding channel number since I want to enable the channel but I can't find the information about the channel number.

ADC_DRV_EnableChannel(INST_ADCONV1, ADC_CONV_CHAIN_NORMAL, ADC_CHAN_NUM);

Best regards,

Zhengkun

0 项奖励
回复
1 解答
2,475 次查看
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Simply connect your analog signal to pin header J14 pin 1.

petervlna_0-1617864054414.png

 

Next you need to check internal routing of ADCs: In this case it is channel35

 

ADC.jpg

 as you can see from routing table:

Screenshot_1.jpg

Last thing you need to se it APC bit in SUIL unit for corresponding MCSR register. Which is in this case MCSR 109.

Screenshot_2.jpg

After setting this you are ready for measurement of PG[13] channel via ADC1 channel 35.

Best regards,

Peter

 

 

 

在原帖中查看解决方案

3 回复数
2,473 次查看
ZD-Zhengkun
Contributor II

Thank you, this answer solved my problem perfectly

0 项奖励
回复
2,476 次查看
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Simply connect your analog signal to pin header J14 pin 1.

petervlna_0-1617864054414.png

 

Next you need to check internal routing of ADCs: In this case it is channel35

 

ADC.jpg

 as you can see from routing table:

Screenshot_1.jpg

Last thing you need to se it APC bit in SUIL unit for corresponding MCSR register. Which is in this case MCSR 109.

Screenshot_2.jpg

After setting this you are ready for measurement of PG[13] channel via ADC1 channel 35.

Best regards,

Peter

 

 

 

2,461 次查看
ZD-Zhengkun
Contributor II

Thank you for your reply, now I got the ADC running.

But I still have some questions. According to the reference manual, the ADC1 should be a 12 bits ADC, but the conversion result I got is only 8 bits result. The input ranges from 0 volts to 3,3 volts.

Did I make the configuration wrong or the input voltage signal is not high enough? Could you please give me a hint?

Best regards!

0 项奖励
回复