MBDT 1.4, S32k358, ADC not reading anything

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

MBDT 1.4, S32k358, ADC not reading anything

811 Views
primo
Contributor II

Hello to all NXP community,

I am currently working with the ADC reading on the S32k358 to achieve the closed loop current control on the contactor driver. However, I was unable to retrieve any readings from the ADC port.

The ADC port that I am using is the PTE_21 and PTE_2. I have enabled the interrupt in Platform section, defined AdcHwUnit, AdcHwTrigger, and BctuHwUnit. The clock in the MCU section is also enabled. I tried to stick to the configuration pattern in the example for S32k396 (ADC CTU S32k396). However, the interrupt callback is not triggered once and there is no ADC value. I tried the same way with the single read example, still nothing working.

Considering that there is not error when compiling, I am assuming this is is a software issue, but i could not tell where was wrong or missing. The matlab code snippet is attatched in the screenshot. I have also included the configuration file if that helps.

Thank you for your patience.

Sincerely

Primo

primo_0-1719981842034.pngprimo_1-1719981866541.pngprimo_2-1719981980547.png

 

0 Kudos
Reply
4 Replies

546 Views
Kalcorpse
Contributor II

Thank you so much @primo ,

I would like to know whether you used dma or interrupt, and also how did you decide adc group hardware trigger source, is there any other way than CTU function, i would like to know whether you made with work without CTU function.

Basically, I have to read analog values in my s32 board. "So can you please attach an example or mex file" which would be helpful for me
Thank you in advance
Kalcorpse

0 Kudos
Reply

564 Views
Kalcorpse
Contributor II

Hi @primo 

Could you let me know if this issue has been solved? 

0 Kudos
Reply

560 Views
primo
Contributor II

Hello, I did manage to solve it. It turns out that you will need to manually initialize some ports in the "configure board initialization" config. You can see the screenshot for my configurations.

primo_0-1732773832992.png

primo_1-1732773889732.png

 

544 Views
Kalcorpse
Contributor II
Thank you so much @primo ,

I would like to know whether you used dma or interrupt, and also how did you decide adc group hardware trigger source, is there any other way than CTU function, i would like to know whether you made with work without CTU function.

Basically, I have to read analog values in my s32 board. "So can you please attach an example or mex file" which would be helpful for me
Thank you in advance
Kalcorpse

0 Kudos
Reply