2021-02-11 04:44 AM
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);
2021-02-11 04:49 AM
Lopp in the reference manual for foirced output mode.
2021-02-11 04:58 AM
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.
2021-02-11 05:01 AM
Ah, I got it: https://www.st.com/resource/en/application_note/dm00042534-stm32-crossseries-timer-overview-stmicroelectronics.pdf
chapter 2.4
but
TIM2->CCR1 = 0;
seems not to set it to low. Do I miss something?
2021-02-11 06:01 AM
Reference Manual.
JW
2021-02-11 06:13 AM
If nothing elpse help, consider also to switch to and back toGPIO alternate function to output with the right ODR value.
2021-02-11 06:26 AM
Nice, that's helpful. Thanks a lot!