cancel
Showing results for 
Search instead for 
Did you mean: 

Timer PWM ETR functionality: ADC remap and ETR filter

Svish.2
Associate II

I have been working on a motor control project for a three phase BLDC motor. So far I have implemented the center aligned PWM output over Timer1 of STM32F303CB. I want to add a current limiting feature such that the PWM gets halted when a current beyond threshold is read.

I came across the ETR functionality through ADC remap of the MCU. I have configured the clearing source to be ETR and clear channels enabled. Questions I have:-

  1. Is the existing configuration for timer1 as shown in the figure correct? If not what are the required changes.
  2. Can I connect my current sensor and set an ADC watchdog for a throshold of current and further trigger the ETR.
  3. If yes what is the role of clear source filter. Will it act as a filter for my ADC channel?
  4. From the reference manual I found out that the ADC remap is ORed with the ETR. Does is mean I still need to provide an ETR source?

Thanks in advance

Attached is the STMCube configuration and snippets of material I found from reference manuals.

6 REPLIES 6
Laurent Ca...
Lead II

Dear Svish.2

Do you have still this problem to solve?

Best regards

Laurent Ca...

Assume yes. What can go wrong of you provide an "unsolicited" answer?

JW

Dear @Laurent Ca...​  ,

Thank you for the concern on the problem that I HAD.

Yes the issue is resolved.

Regards

Shwetank Vishnu.

Laurent Ca...
Lead II

Dear @Community member​ 

We have just decided to try to satisfy as many as possible all the contributors of this forum (the tag "STM32 Motor Control").

Best regards

Laurent Ca...

Hi Laurent,

> We have just decided to try to satisfy as many as possible all the contributors of this forum (the tag "STM32 Motor Control").

I've noticed, and I invite that.

As you've seen, many posts are initially wrongly formulated, of the "it does not work" type, with insufficient details given, and ultimately abandoned.

However, this one is different, Even if Shwetank Vishnu said he does not have the problem anymore, it is ultimately a case of inadequate documentation, and as such, it deserves a concise answer for others who may come across this thread in search for answer for a similar question.

Ultimately, it boils down to two items:

  • this is a question of much broader impact, which was never addressed by ST: is it guaranteed, that an AF signal, if NONE of the associated pins in GPIO are assigned to it, is stuck to 0? (a subquestion is, what happens if multiple pins are associated to it).

While both these questions deserve to be answered in the RM - and the latter in *all* RMs (except the ancient 'F1 perhaps), I also recommend to describe the particular issue of timers "safeguarding" using other modules' signals, in a separate Application Note - of course accompanied by concise and comprehensive examples in clean C.

You may have heard of my call for "dozens of appnotes"...

Jan

To:

@Laurent Ca...​ 

and

@Imen DAHMEN​  as "Documentation Moderator In Charge"

Laurent Ca...
Lead II

Dear @Community member​ 

Please open new posts for any issues you have.

Adding new issues in an existing one is not the strategy I intend to impulse to the forum "STM32 Motor Control".

But I am not going to use "double talk" (means "langue de bois") to avoid answering you although I will do it in a very general way.

Advanced functions in motor control applications are relatively recent in ST.

Now due to the results obtained, improving the support for our customers becomes a priority in order to become the best in class with a big leadership.

Therefore, I hope you will see in the coming weeks big improvements in all of the areas you mentioned.

Best regards

Laurent Ca...