How to configure adc_etc in rt1170?

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

How to configure adc_etc in rt1170?

Jump to solution
1,186 Views
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 

 

 

Tags (2)
0 Kudos
Reply
1 Solution
1,112 Views
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!

View solution in original post

0 Kudos
Reply
2 Replies
1,148 Views
_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 Kudos
Reply
1,113 Views
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 Kudos
Reply