S32K311 ADC Configuration

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

S32K311 ADC Configuration

2,258 Views
yigitkartal
Contributor II

 

Hello all,

I’m working on an S32K311 project in S32 Design Studio (AUTOSAR mode) with the NXP MCAL ADC driver. I’ve configured an ADC group (Group 0) to read PTC8 and PTC9 in continuous conversion mode, using a software trigger. I can see that the ADC interrupt is firing correctly in the ADC_0_ISR function, so interrupts themselves seem fine.

 

However, whenever I call

Adc_GetGroupStatus(AdcGroup_0);

it always returns ADC_BUSY and never transitions to ADC_COMPLETED or ADC_STREAM_COMPLETED. I’ve attached screenshots of my ADC configuration (including AdcHwUnit_0 and AdcGroup_0 settings) as well as a ZIP file of my minimal S32DS project.

 

My goal:

 

Continuously read PTC8 and PTC9 (two channels in one group).

Use a software trigger approach (ADC_TRIGG_SRC_SW) so I can call Adc_StartGroupConversion(...) in a loop.

Confirm the ADC group completes conversions (or at least get updated data) without staying stuck in ADC_BUSY.

What I’ve done so far:

Pin Mux for PTC8/PTC9 → ADC function.

ADC Group with channels for PTC8 and PTC9, set to ADC_CONV_MODE_CONTINUOUS and ADC_TRIGG_SRC_SW.

Interrupt transfer type (ADC_INTERRUPT) enabled; ADC0_EOC interrupt is configured in the tool.

In code, I call:

Adc_SetupResultBuffer(AdcGroup_0, &ResultBuffer[0]);

Adc_EnableGroupNotification(AdcGroup_0);

Adc_StartGroupConversion(AdcGroup_0);

// ...

status = Adc_GetGroupStatus(AdcGroup_0); // Always ADC_BUSY

The ISR (ADC_0_ISR) does get triggered, so I know the hardware is firing interrupts.

Despite this, Adc_GetGroupStatus never leaves ADC_BUSY. How can I configure or handle the ADC in continuous mode so that it reaches a completed state (or a streaming completed state) and updates my result buffer? Is there a specific setting for continuous conversions that keeps the driver perpetually in busy state?

 

Any advice or example configs for continuous + software trigger on S32K3 MCAL would be greatly appreciated. I’ve attached:

 

A ZIP of my project with source code and config files.

Several screenshots of my ADC setup.

Thank you!

I look forward to any suggestions on getting the driver to report a completed status and properly update the results.

 

yigitkartal_1-1739800460726.pngyigitkartal_1-1739800460726.png

yigitkartal_5-1739800508483.pngyigitkartal_5-1739800508483.png

yigitkartal_6-1739800530903.pngyigitkartal_6-1739800530903.png

yigitkartal_7-1739800553873.pngyigitkartal_7-1739800553873.png

 

 

 

 

Tags (1)
0 Kudos
Reply
1 Reply

2,234 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@yigitkartal

For High-level you can choose Mcal to configure, for Low-level you can choose Driver to configure, but usually you can't mix the two, please delete the ADC component of Mcal, and select the ADC component in the Driver component to configure.

Senlent_0-1739845054285.pngSenlent_0-1739845054285.png

We provided a lot of demo on this topic for your reference, for example:

https://community.nxp.com/t5/S32K-Knowledge-Base/RTD400-LLD-K344-ADC-SW-HW-trigger/ta-p/1966179

 

 

0 Kudos
Reply