ADC usage S32K3xx with s32 design studio without AUTOSAR

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

ADC usage S32K3xx with s32 design studio without AUTOSAR

1,460 次查看
SAL_111
Contributor II

Hello, I'm a beginner in embedded systems programming. In my current project I want to read the voltage at an analog input pin and print it somewhere to check the reading, I use the S32K311. I would need some examples because I don't know how to initialise the ADC i already routed the pin in the PINS section and updated the code, but I can't find functions to read the analg input. Please provide me some help.

0 项奖励
回复
3 回复数

1,427 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @SAL_111,

The RTD packages include various examples for the modules. Have you used the ADC example as reference?

Julin_AragnM_0-1727366447247.png

It shows how to use the APIs to configure, calibrate and start a conversion for the ADC:

Julin_AragnM_1-1727366486928.png

Best regards,
Julián

 

0 项奖励
回复

1,406 次查看
SAL_111
Contributor II

Thanks for the reply, but I can't do much with this example, I just need an example where one analog input pin is used and where I see how to init the adc and how to get the readings.

标记 (2)
0 项奖励
回复

1,386 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @SAL_111,

I'm not sure I understand, why is this example not valid for you? The example configures one ADC channel and reads the value for it in the notification function. You can simply modify the channel used for whichever channel you need to read.

For example, in the S32K344 EVB board, the included potentiometer is wired to ADC1_S10 (channel 34). You can simply modify the example to measure ADC1_S10 instead:

Julin_AragnM_0-1727467555093.png

Julin_AragnM_1-1727467559602.png

Julin_AragnM_2-1727467591085.png

Best regards,
Julián

 

0 项奖励
回复