ADC config problem on devkit-MPC5744P(MBD)

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

ADC config problem on devkit-MPC5744P(MBD)

1,473 Views
haoxue1027
Contributor IV

Hi,community

When I config the ADC model, there is an error like following.

pastedImage_2.png

but , I have already check the ADC configuration,there is no other pin shared with other module。

Can you give me some ideas

pastedImage_3.pngpastedImage_4.png

pastedImage_5.png

Thank you very much.

best regards

hao

0 Kudos
11 Replies

1,307 Views
haoxue1027
Contributor IV

Hello,community

Have anyone experienced the same problem?

We can discuss it together.

best regards

hao

0 Kudos

1,307 Views
mariuslucianand
NXP Employee
NXP Employee

Hello haoxue1027@qq.com‌,

Unfortunately, I can't reproduce the issue you encounter. I've tried making the same configuration but "it works on my machine".

pastedImage_1.png

What you can try to do is to select more pins, reselect the ADC Instance (on the ADC instance selection all the displayed pins are refreshed) and then select back the desired number of pins. Make sure that you check with other blocks like GPIO and so on to not using one of the selected PIN.

Can you please tell us what MBDT version are you using? (Type 'ver' in Matlab and send use the line related to MBDT).

If not, please consider sending us the model and we'll check.

Hope this helps,

Marius

0 Kudos

1,307 Views
haoxue1027
Contributor IV

Hello,Marius

Thank you for replying.

My MBDT ver is 

Model-Based Calibration Toolbox 版本 5.7 (R2019b)
Model-Based Design Toolbox for MPC57xx Series 版本 3.1.0 (R2016a-R2019b).

I have updated the my simulink"test 1" ,Please check it if the same error occurs?

 In addition, I have two more questions to ask you for help.

1, I have tried every pin one by one. At last ,I found that the PB13 is the so called "shared pin"

After change the PB13 to other ADC pin, I can get the right data for 4 ADC singal.

But when I want to get the five ADC signal together,the reveived data is volatile.

I don't know why it occures.

2,Based demo,the pwm0 can work without the module "FlexPWM_Disable_Enable"

But  it must be needed in my own simulink.

3,It is the same as https://community.nxp.com/thread/539415 

When I use the modules provided by modules in simulink , instead of copying the module in the demo.

the CTU ISR is not triggered(the red LED cannot work ),and no data was received. 

Could you please help me make sure that if  this example(test2) can works on your computer or not?.

Thank you very much.

best regards

hao

0 Kudos

1,307 Views
mariuslucianand
NXP Employee
NXP Employee

Hello haoxue1027@qq.com‌,

1. Make sure that the pins on which you feed signals are the right ones

2. If the PWMs are not generated without the FexPWM_Disable_Enable this means that in your model, the FlexPWM block might have the following option unchecked;

pastedImage_1.png

3, Please start developing your model from our provided example pwm_ctu_Adc_mpc574xP.

Hope this helps,

Marius

0 Kudos

1,307 Views
haoxue1027
Contributor IV

Hello,Marius,

Sorry to trouble you,

Could you give me a hand with this problem,

Any helps will be appreciated,

best regards

hao

0 Kudos

1,307 Views
mariuslucianand
NXP Employee
NXP Employee

Hello haoxue1027@qq.com‌,

Are the ADC conversion results right? You might encounter this case:

pastedImage_1.png

I will have a look later on you model, but if you are using ADC dual conversion command, maybe sometimes the second value is converted first so this might be the reason for bouncing.

Hope this helps,

Marius

0 Kudos

1,307 Views
haoxue1027
Contributor IV

Hello,Marius

Sorry to trouble you.

Can you duplicate my mistake on your computer?

Waiting for your answer.

best regards

hao

0 Kudos

1,307 Views
haoxue1027
Contributor IV

Hello,Marius

For the PWM - CTU - ADC sampling, I did some tests based on the above model.

The ADC block is set to

PB12 ADC1[14] CH1:14  Vdc ;

PB15 ADC1[2]  CH2:2  Idc;

PB11 ADC1[13]  CH3:13 Ia;

PB7  ADC0[0]  CH4:0 Ib;

Firstly,I do the calculation outside of the CTU ISR by the trigger which is same as demo "PMSM_ClosedLoop_mpc5744p"

The CTU config is following. 

case1: The CHs interfere each other.

pastedImage_49.png

case2:  As you said, the ch3 and ch4 exchanged each other in the dual mode.

pastedImage_52.png

case3: ch1 and ch2 is not stable. ch3 and ch4 exchanged.

pastedImage_1.png

I'm really confused about this result. Can you test my model on your computer and give me some suggestion about the CTU config?

Waiting for your replying

best regards

hao

0 Kudos

1,307 Views
haoxue1027
Contributor IV

Hello,Marius

The ADC conversion is right here. The normal Vbus is 24, The normal current is 0.

There is a little tolerance beacuse of zero drift in my opinion.

pastedImage_1.png

But when I add the calculation module, the adc channel change each other.

Waiting for your answer.

Thank you very much.

best regards

hao

0 Kudos

1,307 Views
haoxue1027
Contributor IV

Hello,@marius

I have updated MBD to VER 3.2.
Now I'm using the new model for ADC sampling based demo pwm_ctu_adc_mpc574xP
But when I used the Freemaster observation, the ADC channels kept switching between each other,

For example,when I dont add the sample calculation module,the sample data and adc channel is same as configuration.

pastedImage_2.pngpastedImage_1.png

But when I add the calculation module, the adc channel change each other.

pastedImage_1.pngpastedImage_4.png
May I set something wrong configuration?

Any help will be appreciated.

best regards

hao

0 Kudos

1,306 Views
haoxue1027
Contributor IV

Hello,Marius.

Thank you for replying,

Firstly, I do not use PB13 in my module. So I don't know why the error occured

and when I want to get the five ADC signal together,All the five reveived data is volatile and inaccurate.

So Did I need to update my version(now MBD ver3.1.0)

best regards

hao

0 Kudos