Greetings,
This should be a pretty simple and ubiquitous task on the MEGA2560, and I'm looking for some prior art somebody on forum might contribute. I would like to use a timer in the MEGA 2560 to generate a 1MHz clock at an I/O pin. The criteria for this clock generator are simply.
50% duty cycle
2)To run autonomously in background
To perform unperturbed by any other CPU activities being performed, ext interrupts, etc.
Basically, I'd like a clean 1MHz clock derived from the 16MHz MEGA's CPU clock for driving external hardware. There are probably many ways to do this, but I'm looking for the cleanest and most straight forward to implement.
Regards, Mark