Go Down

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

Aviator

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
end.

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

Quote
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...

http://arduino.cc/forum/index.php?topic=58757.0

Go Up