Skip to main content
JChan.0
Associate II
January 10, 2019
Question

How do you set a pin used for Timer Channel PWM generation to initial state of logic LOW?

  • January 10, 2019
  • 1 reply
  • 574 views

I am using a particular pin as a timer channel for a PWM Generation signal. For some reason, this pin is always set to logic HIGH before I have the PWM timer begin. Is there a way to set this PWM pin to logic LOW, before the PWM timer begins? I am currently using a L476RG board, and using Timer 2 Channel 1 if that information is relevant. Thanks.

This topic has been closed for replies.

1 reply

waclawek.jan
Super User
January 10, 2019

> For some reason, this pin is always set to logic HIGH before I have the PWM timer begin.

That of course depends on how do you set the timer before the PWM timer begins - whatever that means.

Try to use the other PWM mode (PWM2, if you currently use PWM1); of course you would then need to load the respective TIMx_CCRy by the value complement to the current value, with regard to TIMx_ARR.

JW