Skip to main content
Associate
October 18, 2022
Question

dynamically dead time

  • October 18, 2022
  • 3 replies
  • 2071 views

Hello

I created pwm as "TIM1 Channel1 PWM Generation CH1 CH1N" in a project where I use STM32F103C8T6 MCU.

My problem is that I couldn't find how to dynamically change the dead-time I set for pwm CH1 CH1N using the HAL library.

I will be glad if you help

This topic has been closed for replies.

3 replies

gbm
Super User
October 18, 2022

No idea on how to do this with HAL. Without HAL it takes just single assignment instruction:

TIM1->BDTR = new_dead_time | maybe_some_flags;

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
AKULC.1Author
Associate
October 18, 2022

thank you for your quick reply

Is there a working example? I tried with TIM1->BDTR before but without success.

gbm
Super User
October 18, 2022

I don't know what kind of working example you need for writing a value to a register. This will work, provided you don't lock the timer by writing a non-zero value to bits 9:8 of BDTR.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice