PaulStoffregen/TimerOne

Inverted PWM

vangalvin opened this issue · 1 comments

Is there an option for inverted PWM?
I have a motor driver that requires an inverted PWM signal of around 32Khz.

I use these:
Timer1.initialize(Time_LOW); // sets timer1 to a period of "Time_LOW" microseconds
TCCR1A |= (1 << COM1B1) | (1 << COM1B0); // inverting mode for Pin OC1B --> D4
Timer1.attachInterrupt( timerIsr ); // attach the service routine here
Timer1.pwm(13, duty_cycle); // "duty_cycle" goes from 0 to 1023
works fine with ATmega1284 or ATmega1284p.