Skip to main content
AFied.1
Associate II
February 11, 2021
Question

Is there a way to set timer CH1 pin (PA5) to LOW from code?

  • February 11, 2021
  • 3 replies
  • 1158 views

I have configured TIM2 to set CH1 to Force Active if x Pulses are reached. That's working fine.

Is there are a way to set it to LOW again from code (main loop)?

This seems not to work:

HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_RESET);

This topic has been closed for replies.

3 replies

Uwe Bonnes
Chief
February 11, 2021

Lopp in the reference manual for foirced output mode.

AFied.1
AFied.1Author
Associate II
February 11, 2021

Thanks for your answer! This one? https://www.st.com/resource/en/datasheet/stm32g431kb.pdf

Can you point me to the page please? I can't find it.

waclawek.jan
Super User
February 11, 2021

Reference Manual.

0693W000007Eul4QAC.png 

JW

AFied.1
AFied.1Author
Associate II
February 11, 2021

Nice, that's helpful. Thanks a lot!​

Uwe Bonnes
Chief
February 11, 2021

If nothing elpse help, consider also to switch to and back toGPIO alternate function to output with the right ODR value.