Generating 200khz inverted pwm with dead time

Hi, there
I am using Arduino UNO and I need to generate a 200khz pwm signal on pins D9 and D10 with deadtime of at least 3ns.

TCCR1A = 0b10110000 | (TCCR1A & 0b00001111);
analogWrite(9,Output - 48);
analogWrite(10,Output);

I am using this to invert pwm with deadtime. But I need a way to change the frequency to 200khz

The timers can't automatically introduce deadtime.

Does dutycycle - 40 work for creating deadtime

OK, in that case, change the clock prescaler. I was confused by your use of the word "invert" (the timers can automatically produce both normal and inverted signals).

I am new to arduino and i don't know what you mean by "clock prescaler" :slight_smile:

At 200kHz, it will only be a bit more than a 5-bit PWM....

Regards,
Ray L.

Bits 0-2 of TCCR1B are the clock prescaler. They divide the CPU clock down to use as the timer clock.

As described the data sheet, choices are CPU clock divided by 1, 8, 64 and 256. On Arduino, the choice defaults to 64, for 490 Hz PWM. If you set TCCR1B=1, you get about 31 kHz, which is the best you can do in the default PWM mode.

Unlike a UNO, an Arduino DUE can easily output a PWM pulse at 200 KHz with a dead time.

For 200KHz complementary pwm with deadband between the outputs, check out this thread. It may be of help.
https://forum.arduino.cc/index.php?topic=438667.msg3022439#msg3022439

cattledog:
For 200KHz complementary pwm with deadband between the outputs, check out this thread. It may be of help.
two 200kHz complementary PWM Signals - #10 by cattledog - Programming Questions - Arduino Forum

Thank you for that :slight_smile: