Creating a clock

I need to create a clock going about 1-5khz coming from arduino. I need it to operate in the back round to clock in serial data I am streaming to a serial to parallel converter. How would I go about doing this?

Thanks

If you are not using the PWM for anything else try changing the PWM frequency to the rate you want and doing an analogue write of 128 to give you a square wave out.

Use the tone library, works with any pin.

http://code.google.com/p/rogue-code/wiki/ToneLibraryDocumentation

Lefty

The tone generator is a good idea. Is there a way to count pulses? I need to send a few signals out every eight pulses as I am using an 8 bit parallel input LCD. I need a strobe and an output signal.

Thanks