Hi @Automan
Thank you for using our latest NXP Model-Based Design Toolbox for S32K3 version 1.6.0.
We also have a guide on how to enable a new ADC channel for S32K3 boards Controlling LED intensity with ADC and PWM - NXP Community
In your case with the the S32K31XEVB-Q100 EVB board, there is only one ADC1 channel configured in the S32CT.
If you want to add an ADC0 channel, we need to first add a pin intro Pin Manager:
stefanvlad_0-1742911736443.png
For example PTE11 pin is on ADC0 and connected to TOUCHO_A on the board.
Next we need to add thisPTE11 pin in Peripherals -> Port Configuration:
stefanvlad_1-1742912080185.png
Then we need to enable the ADC0 interrupt in Platform Configuration -> Interrupt Controller:
stefanvlad_2-1742912269324.png
Scroll down the Interrupt Controller page and find and enable ADC0:
stefanvlad_3-1742912355616.png
Then we need to enable the ADC0 peripheral clock in MCU Configuration -> McuModuleConfiguration -> McuModeSettingConfig:
stefanvlad_4-1742912461293.png
We need to add ADC0_EOC and ADC0_WD in ADC Configuration-> ADC Interrupt:
stefanvlad_9-1742915526937.png
Then we need to add another ADC Hardware Instance in ADC configuration:
stefanvlad_10-1742915808361.png
After we need to configure the Channel configurations array P6_ChanNum6:
stefanvlad_11-1742915864741.png
Update the Adc0Group_2 with the Adc_Adc0Group2Notification in the Group configuration array:
stefanvlad_17-1742917058907.png
Select the AdcChannel_1 in the AdcGroupDefinition:
stefanvlad_8-1742915342488.png
After this we can Update Code and a pop-up Update Files will appear, press OK:
stefanvlad_5-1742912566074.png
After this process is done, we can close S32CT and go back to the model.
Update in the s32k3xx_adc_single_read_s32ct model, with Adc0Group_2:
stefanvlad_13-1742916459810.png
stefanvlad_14-1742916500213.png
Then go back to MATLAB and delete the following:
- s32k3xx_adc_single_read_s32ct_ert_rtw
- slprj
- s32k3xx_adc_single_read_s32ct.slxc
stefanvlad_6-1742912930708.png
Select Yes to all, then go back to the s32k3xx_adc_single_read_s32ct.mdl and press on Build, Deploy &Start (keyboard shortcut CTRL+B
stefanvlad_15-1742916594361.png
After the generated code is automatically flashed into the S32K311EVB, open FreeMaster and watch the newly added Channel_1:
stefanvlad_16-1742916888981.png
Hope the steps above help you,
Stefan V.