cancel
Showing results for 
Search instead for 
Did you mean: 

dynamically dead time

AKULC.1
Associate II

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

3 REPLIES 3
gbm
Lead III

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.1
Associate II

thank you for your quick reply

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

gbm
Lead III

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