cancel
Showing results for 
Search instead for 
Did you mean: 

How to invert TIMER signal?

Endika Caño de Miguel
Associate II
Posted on October 30, 2017 at 11:45

Hello everybody:

I�m running my STM32L432  Timer 2 as a PWM and I need to take out from a pin the signal and same one inverted, but I don�t know how to do it. Any help would mean the world to me

I need something like the photo.

Thank you in advance.

0690X00000604B8QAI.jpg

#invert #signal #output #pwm #timer #stm32l4
8 REPLIES 8
RomainR.
ST Employee
Posted on October 30, 2017 at 13:57

Hello,

TIMER2 is a General Purpose 32bit. But it doesn't contains inverted channel.

You should use TIMER1 or TIMER15 or 16. 

See chapter 26.4.12 Complementary outputs and dead-time insertion in reference manual.

0690X00000608nyQAA.png

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Posted on October 30, 2017 at 14:05

Use a second channel in the opposite PWM mode, i.e. if you used the first pin in PWM1 mode, use the other in PWM2 mode.

You'll need to change the CCR value for both pins/channels simultaneously.

JW

Posted on October 31, 2017 at 10:01

Okey, thank you. I didn´t know about that

Posted on October 31, 2017 at 10:02

thank you

Posted on October 31, 2017 at 10:09

Hi,

Take a look at Timer AN 

http://www.st.com/content/ccc/resource/technical/document/application_note/group0/91/01/84/3f/7c/67/41/3f/DM00236305/files/DM00236305.pdf/jcr:content/translations/en.DM00236305.pdf

 

Regards

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Posted on November 02, 2017 at 10:28

Sorry to bother you again, but I´ve never used PWM Generation CH1 CH1N. 

So when I try to debug my program it appears an error and I don´t know what do I have to do. 

Do I have to setup the CH1N??? 

I´m using ECLIPSE  Ide, so if you know what do I have to do, please tell me.

Posted on November 02, 2017 at 13:57

Hello Endika Caño

So when I try to debug my program it appears an error and I don´t know what do I have to do.

- Can you provide more information concerning error you are facing during debug ? Any console capture image ?

- Do you Use CubeMX program configurator and generator ?

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Posted on November 06, 2017 at 10:02

Hello:

Finally I´ve been able to fix it. It didn´t set up correctly a HAL driver.

Thank you so much for your help, it has really helped me.