Go Down

Topic: PWM (Read 979 times) previous topic - next topic


I am using an Arduino MEGA2560.

We are using the crystal timer in the chip to generate a PWM square wave
that we send out on a low voltage line.

That square wave must be within 985 and 1015 Hz.

The earlier boards we were using were generating a speed of exactly 980 and for some
reason it was working. But   newer boards are putting out 978 and it
will not work with the device communicating with the signal on the other

Because the raw clock speed is 16 MHz, and it only allows you to divide it
by multiples of 2, we can't fine tune the square wave to what we need.

How can we do this with either hardware or software?

Any assistance or suggestion would be greatly appreciated.

Coding Badly

How can we do this with either hardware or software?

This changes the PWM frequency for timer 1 pins to 10 KHz but the technique is the same for any frequency...


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131