Signal frequency control

Discussion in 'The Projects Forum' started by Cerkit, Feb 2, 2009.

  1. Cerkit

    Thread Starter Active Member

    Jan 4, 2009
    275
    3
    How can I create signals of specific frequencies using an attiny chip??
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    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.
     
Loading...