iMX93 read ADC

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

iMX93 read ADC

1,831件の閲覧回数
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,807件の閲覧回数
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 件の賞賛
返信