Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inverted PWM #40

Open
vangalvin opened this issue Aug 22, 2019 · 1 comment
Open

Inverted PWM #40

vangalvin opened this issue Aug 22, 2019 · 1 comment

Comments

@vangalvin
Copy link

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

@JensGrabner
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants