S32K396 Multi-channel ADC read group from example

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

S32K396 Multi-channel ADC read group from example

Jump to solution
204 Views
agus_idiada
Contributor II

Hello,

I am using S32K396-BGA-DC1 board, with Simulink in matlab2024a.

I am trying to expand the example s"32k37x_s32k39x_adc_single_read_ebt" by adding a new channel for the group0 adc . After changing the .mex by adding the new channel and configuring it (see figure 1 & 2), I made the changes proposed also in [1] (image 3) but it does not work for me.

In freemaster I can only see this (Fig. 4).

Is there something that I missed? How can I properly configured freemaster?

Thanks, Agustin.

[1] https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K344-Multi-channel-ADC-read-group/td...

0 Kudos
Reply
1 Solution
140 Views
Irina_Costachescu
NXP Employee
NXP Employee

Hi @agus_idiada 

Thank you for sharing your project with us. I have downloaded the archive that you have sent, and I have noticed that the .mex file associated with the model does not contain the additional Adc channel in the configuration it enables for this component. However, the S32K396-Q289-copy.mex file contains the Adc group with 2 channels. Hence, can you please cleanup the folder where your model is placed, leaving only the slx file and try rebuilding the application?

I also see that the S32K396-Q289-copy.mex is specified as the Configuration Template inside the model's Configuration Parameters. Because of this, your local file will be brought next to the model and used throughout the build process.

It seems that somehow, your configuration got overwritten with the default one the toolbox provides. For more details about default and custom configuration projects, please check the following link, as it provides a detailed explanation on these terms and how MBDT works with such configurations. To make sure that your model is using the right configuration project, click the Configure button of any of the Simulink MBDT blocks present in your model. This action should open the S32CT and here you can check if the Adc is configured as required by your application.

With the S32K396-Q289-copy.mex file, I have added both Channel0[0] and Channel0[1] inside the FreeMASTER project, obtaining the following results:

Irina_Costachescu_1-1725000056145.png

 

Please let us know if this solves the issue you are currently encountering.

Thank you,

Irina

View solution in original post

4 Replies
176 Views
agus_idiada
Contributor II

Thanks @Irina_Costachescu for your response. Unfortunately it is still not working.

Maybe with the complete model other wrong configurations can be identified. Could you please check this?

Thanks

0 Kudos
Reply
141 Views
Irina_Costachescu
NXP Employee
NXP Employee

Hi @agus_idiada 

Thank you for sharing your project with us. I have downloaded the archive that you have sent, and I have noticed that the .mex file associated with the model does not contain the additional Adc channel in the configuration it enables for this component. However, the S32K396-Q289-copy.mex file contains the Adc group with 2 channels. Hence, can you please cleanup the folder where your model is placed, leaving only the slx file and try rebuilding the application?

I also see that the S32K396-Q289-copy.mex is specified as the Configuration Template inside the model's Configuration Parameters. Because of this, your local file will be brought next to the model and used throughout the build process.

It seems that somehow, your configuration got overwritten with the default one the toolbox provides. For more details about default and custom configuration projects, please check the following link, as it provides a detailed explanation on these terms and how MBDT works with such configurations. To make sure that your model is using the right configuration project, click the Configure button of any of the Simulink MBDT blocks present in your model. This action should open the S32CT and here you can check if the Adc is configured as required by your application.

With the S32K396-Q289-copy.mex file, I have added both Channel0[0] and Channel0[1] inside the FreeMASTER project, obtaining the following results:

Irina_Costachescu_1-1725000056145.png

 

Please let us know if this solves the issue you are currently encountering.

Thank you,

Irina

169 Views
agus_idiada
Contributor II
It is like when I configure a new volatile variable, displace the value or register in the freemaster and then, I read 0. Make that sense?
0 Kudos
Reply
181 Views
Irina_Costachescu
NXP Employee
NXP Employee

Hi @agus_idiada 

The settings you have done seem to be correct. Could you please let us know what is the name of the variable holding the group (containing 2 ADC channels) conversion results? If that is Channel0, please try and add in FreeMASTER both Channel0[0] and Channel0[1] to inspect their values. 

Please check this thread as well for more details on how the Channel0 value can be easily added inside your FreeMASTER project.

Please let us know if this helps or if further investigations are needed from our side.

Thank you,

Irina