iMX93 read ADC

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

iMX93 read ADC

1,994 次查看
Vitus
Contributor I

Try to read the ADC of the iMK93, using the M33 core, the first ADC. But I do not get a value

Pin-mux:

in the fsl_iomuxc.h I do not find a #define IOMUX so I assume this is a not muxed pin. and did not do anything here. Maybe this is my mistake

Initialization:

 ADC1->MCR = 
SAR_ADC_MCR_OWREN(1) //overwrite values
| SAR_ADC_MCR_MODE(1) //Scan continuous
| SAR_ADC_MCR_NSTART(1) //start scanning
;

I init as above. This is basically a value 0xA1000000. Interestingly, the bit NSTART resets itself after writing, even according to the CPU manual should stay set when in Scan mode

cyclical (all 5msec or so):

uint32_t steps = SAR_ADC_PCDR_CDATA(ADC1->PCDR[0]); //AD 0

the value "steps" is always zero

summary:

does not run. This may be a wakeup at init needed or the pins are muxed but it is somehow hidden or I messed up the registers,. Did not find an example in the SDK. Does anyone has a quick help or a link to an example?

 

0 项奖励
回复
1 回复

1,970 次查看
Manuel_Salas
NXP TechSupport
NXP TechSupport

Hello @Vitus 

I hope you are doing very well.

 

Answering your question, the ADC pads are not multiplexed with others, those are dedicated ADC pins.

Unfortunately we have not an ADC example from Cortex M33 yet, but you can find information in the API reference guide included on the SDK. You can find it under SDK_2_16_000_MCIMX93-EVK/docs.

Also, you can refer to the imx93_adc.c linux driver to take as reference.

 

Best regards,

Salas.

0 项奖励
回复