How to configure adc_etc in rt1170?

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

How to configure adc_etc in rt1170?

跳至解决方案
1,170 次查看
JungleHuang
Contributor I

HI:NXP Technical support

I think I'm having difficulties with the configuration of ADC_ETC and would like to seek your help.I want to use ADC_ETC to measure the current of a BLDC motor.My motor driver chip is the TI DRV8316C.I configured my PWM in SignedCenterAligned mode.Referring to the example in the diagram below, I set the PWM to trigger output at the VAL0 value.

However, when I actually read the SOA current, I found that it was a fixed value. After troubleshooting, I discovered a phase difference between SOA and the PWM signal.JungleHuang_0-1730973569575.png

In fact, I did achieve the effect I wanted, as shown in the diagram below.

JungleHuang_1-1730973590457.jpeg

However, when I actually read the SOA current, I found that it was a fixed value. After troubleshooting, I discovered a phase difference between SOA and the PWM signal.

Currently, I am reading the ADC at position 1, but it should be read at position 2.

JungleHuang_2-1730973630830.jpeg

Referring to the Center Aligned PWM example diagram, I believe setting the PWM to trigger at the VAL1 value would be effective.So I modified my code.

I changed PWM_OutputTriggerEnable(PWM1, kPWM_Module_1, kPWM_ValueRegister_0, true); to PWM_OutputTriggerEnable(PWM1, kPWM_Module_1, kPWM_ValueRegister_1, true);.

But it didn't works.

I'm certain that the value of this register has been correctly modified.

JungleHuang_3-1730973703839.png

I don't know why this is happening, so I would like to seek your help. Thank you very much.

 

i.MX-RT1170 

 

 

标记 (2)
0 项奖励
回复
1 解答
1,096 次查看
JungleHuang
Contributor I

Hi,

Thank you for your patient response.I have already resolved this issue.The key to the problem lies in the image below.

JungleHuang_0-1731049823870.png

Trigger 1 is activated when the counter matches VAL 1, VAL 3, or VAL 5 register.I should configure it to be triggered by Trigger 1.Now I can collect ADC values according to my requirements.
Thank you very much for your patient response. Have a wonderful day!

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,132 次查看
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

Thank you so much for your interest in our products and for using our community.

You can refer to the SDK examples evkbmimxrt1170_mc_bldc or evkbmimxrt1170_mc_pmsm_enc (v2.16.000).

Both examples perform the same eFlexPWM + ADC_ETC synchronization, almost equal to yours. The difference is that it uses a different compare value (val4) for ADC triggering.

_Leo__0-1731015334401.png

Documentation comes in the SDK examples:

_Leo__1-1731015343717.png

Hope it helps you.

Have a nice day!

0 项奖励
回复
1,097 次查看
JungleHuang
Contributor I

Hi,

Thank you for your patient response.I have already resolved this issue.The key to the problem lies in the image below.

JungleHuang_0-1731049823870.png

Trigger 1 is activated when the counter matches VAL 1, VAL 3, or VAL 5 register.I should configure it to be triggered by Trigger 1.Now I can collect ADC values according to my requirements.
Thank you very much for your patient response. Have a wonderful day!

0 项奖励
回复