Signal frequency control

beenthere

Joined Apr 20, 2004
15,819
Use the internal counters. As an example, clock the counter at a 1 MHz rate. If you accumulate a count of 50, the division is 1,000,000/50, or 20,000. If you run the counter at that rate and switch an output pin at that count, the output frequency will be 10 KHz with a 50% duty cycle, although the actual rate will be affected by time spent by the uC executing instructions.
 
Top