Adc_integration_issue

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Adc_integration_issue

2,169 次查看
Vijay98
Contributor II

Hello NXP Team,

Thank you for your invaluable support and assistance. We truly appreciate your efforts and dedication in helping us achieve our goals.

Currently, we are facing one issue with integration of ADC peripherals with PWM configuration.

1. First with the help of Solved: Pwm_delay_in_trigger_pulse - NXP Community this post we can be able to generate PWM pulse using LCU logic.

But, in that model we are trying to integrate ADC peripherals.

while integrating the ADC peripherals, we are seeing that one ADC channel is working but other channels are not working in that particular model with PWM.

Vijay98_4-1737536751939.png

 

ADC0GROUP0 is used for channel 0 for getting the ADC counts value from pin PTE15

Vijay98_1-1737536595057.png

 

Vijay98_2-1737536626985.pngVijay98_3-1737536646407.png

 

Vijay98_0-1737536916723.png

 

 

 

ADC0GROUP1 is used for channel 1 for getting the ADC counts value from pin PTE10

 

Vijay98_1-1737537016986.pngVijay98_2-1737537035394.pngVijay98_3-1737537054495.pngVijay98_4-1737537088308.png

And the result is;

Vijay98_0-1737536289193.png

We can't able to see the output in Cnts 2 (PTE10).

We set the same configuration for both the channels 1 & 2.

We cannot be able to find the error in this.

We tried with other pins also; we are getting the same error.

Kindly help us with this.

I have attached the model with this post.

 

Thanks & Regards,

Vijay

0 项奖励
回复
9 回复数

2,124 次查看
stefanvlad
NXP Employee
NXP Employee

Hello @Vijay98 ,

 

Thank you for your appreciation, and a Happy New Year!

 

Regarding your attached project, i have tried to build and run on my S32K312EVB but it goes to a Hard Fault:

Screenshot 2025-01-31 191800.png

It seems to be a problem with the FreeMASTER over CAN.

Can you send me the latest working project ?

To help with your ADC problem i will take a closer look into s32k3xx_adc_single_read_s32ct.mdl example:

Screenshot 2025-01-31 193229.png

 

Here you can open the two instances of S32 Configuration Tools from C:\MathWorks\Toolboxes\NXP_MBDToolbox_S32K3xx_150\tools\S32ConfigTools.2024.R1.7\tools.exe

Then you can compare the two configurations side by side:

Screenshot 2025-01-31 193404.png

I will recommend to use the settings from s32k3xx_adc_single_read_s32ct.mdl and modify them in your configuration.

Also i saw in your model , that you are not using Hardware Interrupts for the ADC reading functions:

Screenshot 2025-01-31 193938.png

 

So let me know how the ADC works after you test your model with the settings from s32k3xx_adc_single_read_s32ct.mdl,

And send your the latest working model, not the one that goes into Hard Fault.

 

Thank you,

Stefan V.

0 项奖励
回复

1,993 次查看
Vijay98
Contributor II

Hello @stefanvlad,

Sorry for the late reply,

I have tested the ADC example and integrated a new model. The new ADC integrated model (located in the Adc_integration folder) is functioning correctly without any issues.

Screenshot (1).png

However, in the 'S323K312_pwm_Icu_mod_carrier_s32ctmodel' file, we are encountering a problem,

  • When configuring any pins in ADC_Group_0, we can successfully read and modify the count values.
  • However, when applying the same pin configuration to ADC_Group_1, it does not function as expected.
  • We have thoroughly reviewed both files and compared the configurations of Group_0 & Group_1, but we could not identify any differences. Despite this, Adc_Group_1 remains non-functional.
  • Additionally, when configuring ADC_Group_2, there is no output or digital count observed.
  • Screenshot (6).png

 We are unsure of the root cause of this issue and would appreciate any insights.

 

We have attached both the files with this post.

Kindly help us regarding this issue.

 

Thanks & Regards,

Vijay

0 项奖励
回复

1,948 次查看
stefanvlad
NXP Employee
NXP Employee

Hi @Vijay98 ,

 

I have checked the models you have attached and i found the following:

Integration_sen_adc

  • Adc0Group_0 -> Channel0 - AdcChannel_0 - P4_ChanNum4 -PTE16 - 815-890
  • Adc0Group_1  -> Channel1 -  AdcChannel_1 -  P3_ChanNum3 - PTE15 - 28-39
  • Adc0Group_2 -> Channel2 - AdcChannel_2 - P6_ChanNum6 - PTE11 - 10-800 - Works
  • Adc0Group_3 -> Channel3 - AdcChannel_3 - P5_ChanNum5 - PTE10 - 10-800 - Works

s32k312_pwm_lcu_s32ct

  • Adc0Group_0 -> Cnts_1 - AdcChannel_1 - P5_ChanNum5 - PTE10 - 10-800 - Works
  • Adc0Group_1 -> Cnts_2 - AdcChannel_0 - P3_ChanNum3 - PTE15 - FS26

The issues is in the schematic of the S32K312EVB-Q172:

PTE15 PTE16 connected to FS26.png

 We can see that both pins PTE16, PTE15 are connected to the FS26 chip, FCCU1 FCCU2 pins.

That means that we cannot use this pins as inputs for ADC, that is why in both cases we see the values are not good for both models:

FreeMaster_sensor_adc_int.png

My advice is to change the pins, and check the S32K312EVB-Q172 board schematic, to see if that ADC pin is free and not connected to anything else on the board.

 

Best regards,

Stefan V.

 

0 项奖励
回复

1,878 次查看
DrKarthi
Contributor II

Hi @stefanvlad 

Thanks for your reply.

But the problem not solved. 

Like to brief for better clarity.

Board Used: custom S32k312 board, FS26 not used.

Problem: After integrating LCU, PWM only generating. ADC group only Group0 working, configure to Group1- not working.

Two model configured:

 Integration_sen_adc-all works fine. (LCU was not configured model)

s32k312_pwm_lcu_s32ct_initialize: ADC group only Group0 working, if any pin configure to Group1- not working.(LCU Configured model).

Observation and doubt:

We seen BCTU configured in s32k312_pwm_lcu_s32ct_initialize model only for Emios. Not for ADC. is it problem?.

For two model we seen, model configuration setting are different, can  you look it may be the problem. refer image.

Please suggest solution or will set a teams call for better understanding, this issue was open for long.

 
 

Thanks 

Dr. Karthi

@Vijay98 @irina 

 

 

 

 

 

标记 (2)
0 项奖励
回复

1,686 次查看
stefanvlad
NXP Employee
NXP Employee

Hi @DrKarthi  and @Vijay98 ,

 

I have updated the configuration and the model with the additional Adc_Groups:

stefanvlad_0-1742499712791.png

Please use the attached configuration file.mex and tested on your end,

 

Best regards,

Stefan V.

 

0 项奖励
回复

1,826 次查看
stefanvlad
NXP Employee
NXP Employee

Hi @DrKarthi  and @Vijay98 ,

 

I have modified the ADC configuration for s32k312_pwm_lcu_s32ctConfig.mex and looking into the issue with ADC0Group1, 

Updated the ADC0Group1 with all the settings as in the Integration_sen_adcConfig.mex, but for some reason there is no update in the Cnts_2 variable.

There is also the problem with the pin PTE15:

  • Adc0Group_1 -> Cnts_2 - AdcChannel_0 - P3_ChanNum3 - PTE15 - reads constant 10

Because this is connected to FS26 chip on the S32K312EVB-Q172 board and is pulled low.

 

I am investigating further this problem and will let you know, when I have a solution,

Best regards,

Stefan V.

0 项奖励
回复

1,697 次查看
Vijay98
Contributor II

Hello @stefanvlad ,

Sorry for the late reply.

I have tested the ADC example and integrated a new ADC model. The new ADC integration model (located in the Adc_Integration folder) is functioning correctly without any issues.

Screenshot (1).png

However, in the s32k312_pwm_lcu_mod_carrier_s32ct model file, we are encountering a problem.

  • When configuring any pins in ADC_Group_0, we can successfully read and modify the count values.
  • However, when applying the same pin configuration to ADC_Group_1, it does not function as expected.
  • We have thoroughly reviewed both files and compared the configurations of Group_0 and Group_1, but we could not identify any differences. Despite this, ADC_Group_1 remains non-functional.
  • Additionally, when configuring ADC_Group_2, there is no output or digital count observed.
  • Screenshot (6).png

We are unsure of the root cause of this issue and would appreciate any insights

 

 

We have attached both the files with this post.

Kindly help us regarding this issue.

 

 

Thanks & Regards,

Vijay

 

0 项奖励
回复

1,699 次查看
Vijay98
Contributor II

Hello @stefanvlad,

Sorry for the late reply.

I have tested the ADC example and integrated a new ADC model. The new ADC integration model (located in the Adc_Integration folder) is functioning correctly without any issues.

 

Screenshot (1).png

However, in the s32k312_pwm_lcu_mod_carrier_s32ct model file, we are encountering a problem.

  • When configuring any pins in ADC_Group_0, we can successfully read and modify the count values.
  • However, when applying the same pin configuration to ADC_Group_1, it does not function as expected.
  • We have thoroughly reviewed both files and compared the configurations of Group_0 and Group_1, but we could not identify any differences. Despite this, ADC_Group_1 remains non-functional.
  • Additionally, when configuring ADC_Group_2, there is no output or digital count observed.
  • Screenshot (6).png

We are unsure of the root cause of this issue and would appreciate any insights.

 

We have attached both the files with this post.

Kindly help us regarding this issue.

 

 

Thanks & Regards,

Vijay

0 项奖励
回复

1,695 次查看
Vijay98
Contributor II

Hello @stefanvlad,

Sorry for the late response.

I have tested the ADC example and integrated a new ADC model. The new ADC integration model (located in the Adc_Integration folder) is functioning correctly without any issues.

Screenshot (1).png

However, in the s32k312_pwm_lcu_mod_carrier_s32ct model file, we are encountering a problem.

  • When configuring any pins in ADC_Group_0, we can successfully read and modify the count values.
  • However, when applying the same pin configuration to ADC_Group_1, it does not function as expected.
  • We have thoroughly reviewed both files and compared the configurations of Group_0 and Group_1, but we could not identify any differences. Despite this, ADC_Group_1 remains non-functional.
  • Additionally, when configuring ADC_Group_2, there is no output or digital count observed.
  • Screenshot (6).png

We are unsure of the root cause of this issue and would appreciate any insights.

I have attached both the files with this post.

 

Kindly help us on this issue ASAP.

Thanks & regards,

Vijay

 

0 项奖励
回复