 Hi, this is Saig from SD Microelectronics. In this video, I'm going to show you how to generate dead time in between complementary PDLVM signals using SDM32's advanced timer peripheral. The objective for this video is to generate dead time between complementary PDLVM signal to minimize the risk of two complementary transistors in bridge topologies from shorting and causing damage to the circuit. Just a side note, for accessing all the materials discussed in this video, please visit the link in the description. For this hands-on, you will need a Nucleo H745, a micro USB cable for connecting the board to the host, and a oscilloscope for measuring the output PDLVM signal with the inserted dead time. For my setup, I will be using a 200 MHz dual channel mixed oscilloscope. Why do we need dead time insertion? When operating multiple switches, for example those in the H-bridge configuration, we want to operate switches inversely, such that the top switch is on and the bottom switch is off, like the one shown in the right figure. However, due to delays in switching, there is a chance that top and bottom switches can both stay on at the same time, momentarily, which causes a shoot-through and ultimately destroys your H-bridge circuit. I'm going to briefly discuss a low-level setup of dead time configuration, although in the laboratory, we wouldn't be needing to worry about all of these details. Dead time insertion is enabled by setting both the CCXE and CCXNE bits of the capture-compare-enable register, timer 1 being in our case. If the break circuit is present, then you also need to enable the MOE bit in the timer break and dead time register. You can read more about the break function in the reference manual section using the break function. Output pulse will not be generated for dead time delays being longer than the OXC or the OCXN output pulse width. You can read more about the dead time insertion setup by referring to the section complementary output and dead time insertion. For this hands-on, we'll choose an arbitrary value of 10 microseconds between the output PWM and the negative PWM output signal. We'll be inserting a pause of dead time, which just means during the 10 microseconds both outputs are not inserted. Timer 1 will be selected for this application because we need the complementary output. This table can be found in the datasheet. Now we're going to start the hands-on exercise. Using STM32Q IDE, create a new STM32 project and select NUCLEO H745 board for this exercise. File, new, STM32 project. Type in STM32 H745. We're going to select this board here, click next. We're going to give it a name of dead time insertion PWM underscore demo. Click finish. Go to clock configuration. For the clock, we're going to work with a value of 64 megahertz. This value is chosen arbitrarily. Go to pinout and configuration. Go to timers. Select one of the advanced timers. We'll go with timer 1 because it can output complementary PWM signal. For runtime context, set it to cortex M7. We're going to load our project on the cortex M7 core. We're going to choose complementary output. So change channel 1 to PWM generation. Channel 1, channel 1N. PWM generation, channel 1, channel 1N. We want to create an output PWM signal of one kilohertz. Again, arbitrary chosen here. Let us use a prescalar of 64 to reduce our clock to one megahertz. Since the prescalar counts from zero, we'll enter 64 minus one for the prescalar. Counter mode up. County period. In order to get the PWM output one kilohertz, we need to have the timer counter reset every 1000 count because dividing one megahertz with 1000 gives us one kilohertz. Go to break and dead time management output configuration. Set dead time to 232. We input 232 ticks for generating 10 microseconds of dead time. Calculations will be shown in latest lights. Go to PWM generation channel 1 and channel 1N. For pulse, enter 500. Choosing pulse of 500 would give us 50% recycle because 500 divided by 1000 gives us 0.5. Note that pen PA7 is connected to timer 1, channel 1N and pen PE9 is connected to timer 1, channel 1. After finishing your IOC file configuration, click device configuration tool and code generation. For the last step, you need to enable complimentary PWM generation using the HAL API for the regular channel and the HAL API for the negated channel. In the link provided in the description, you'll come across as a folder called complimentary PWM dead time insertion. Extract it here. Open the text file code to be added and copy these two lines into your main code in the Cortex M7 core project. Add these two lines here. Say a brief overview of the HAL API is used over here. The first HAL API highlighted here starts the PWM for the normal channel, timer 1, timer channel 1. The second HAL API here starts the PWM for the negated channel, timer 1. Before running our Cortex M7 project, we need to upload the Cortex M4 project image into our board. Else, our project on the Cortex M7 core will get stuck inside a loop. So click on the Cortex M4 project, click on build, build finish, and click on run. Click OK. So now our Cortex M4 image is uploaded into our board, so we're ready to upload our Cortex M7 project next. Compile the project and ensure there are no errors or warnings. Zero errors, zero warnings. Now debug and flash your image into the nuclear board. Click Resume. Now the code is executing on the nuclear board. Connect your oscilloscope to pins PA7 and PE9. Then you should observe a complimentary output signal. Zooming in using the scope, you should observe a 10-microsecond dead time between channel 1 and channel 2 of your scope. Details about the calculations can be found on the PDF slide posted in the link. As well, you can reference the dead time generator set up in the reference panel. Connecting channel 1 of our scope to pin PA7 and channel 2 to PE9, we observe the fallen figure. You should see something similar. It's hard to see the dead time inserted into our signal, so we'll zoom in. When you zoom in, you should observe the figure shown. Using the cursor feature of your oscilloscope, you will measure the dead time to be approximately 10 microseconds. Relevant application notes, as well as reference manual and datasheet, can be found in the following links. We hope you found this video helpful. Thank you very much for watching.