2024-07-10 06:10 AM - last edited on 2024-07-18 06:51 AM by Amel NASRI
hi I'm using NUCLEOG4 series controller. configuring TIM1 in both normal and complimentary PWM. PWM is generating, no problem in that. but i want 24 micro seconds of dead time between top and bottom pwm. but i can able to achieve maximum of 6 micro seconds only. As per the datasheet and calculation, dead time insertion value for 24 micro seconds is 244, but output dead time is maximum 6 micro seconds.
can anyone suggest how to achieve 24 us deadtime in nucleog4 and I'm running at 170MHZ.
2024-07-10 06:29 AM
@Srinath_03 wrote:I'm using NUCLEOG4 series controller
Which one. Please provide exact product name or a link.
@Srinath_03 wrote:dead time insertion value for 24 micro seconds is 244, but output dead time is maximum 6 micro seconds.
Please upload your ioc file and user code.
2024-07-10 06:37 AM
2024-07-10 07:24 AM - edited 2024-07-18 07:43 AM
That's not the full ioc file, just a screenshot of a single value.
From what I read in RM0440 the dead time value is a 10 bits value, so it should work from 0 to 1023. So 244 ticks should work.
DTG is 3 bits and has 4 possible values: 1,2,8,16 * DTS
Can you post the register values?
Can you post an oscilloscope/logic analyzer capture? Pick a sane duty cycle. Use several values for dead time.
2024-07-11 07:37 AM
Hello below i have attached the IOC file and main.c of deadtime code. iam using stm32g474ret6 controller at 170MHZ of both system clock and timer clock. iam using TIM1 for PWM generation both normal and complimentary at 10khz frequency and 50 percent duty iam checking the dead time.
A i mentioned previously above that at 170MHZ i can't go more than 4 microseconds of deadtime. i don't know why.
As i have changed the both system and timer clock frequency at 50MHZ, and i have checked at different deadtime values say 2.4us, 5us , 10us and 20us all are working fine and iam able to generate that desired deadtime at 50MHZ.
But at 170MHZ i can't able to achieve.
at last i have tried for 10us deadtime at 170MHZ, its deadtime decimal value to be set in ioc is coming as 234.i have tested with this also but i can't get the desired 10us deadtime.
i don't know why it is working at 50MHZ clock , but not in 170MHZ, and the deadtime DTG register is having only 8bit not 10bits , it can hold only 0 to 255 value.
can anyone suggest how to increase deadtime at 170MHZ more then 4us.
2024-07-19 01:17 AM - edited 2024-07-19 01:21 AM
I think I figured it out. I didn't know anything about this particular MCU or how these timers worked, but after reading the reference manual (RM0440) I think I found it:
/*
from RM0440 Rev 8:
"Bits 9:8 CKD[1:0]: Clock division
This bitfield indicates the division ratio between the timer clock (tim_ker_ck) frequency and
the dead-time and sampling clock (tDTS )used by the dead-time generators and the digital
filters (tim_etr_in, tim_tix)"
*/
looking at the block diagram you will see tim_ker_ck, tim_psc_ck and tim_cnt_ck
The prescaler divides tim_psc_ck and outputs tim_cnt_ck, but the dead time uses tim_ker_ck.
You generally want tiny dead time values, even with high prescaler values, so it makes sense the dead time block is clocked separately. So set Internal Clock Division in STM32CubeMX.