Square wave using adurino

Discussion in 'General Electronics Chat' started by Sathishk, Nov 26, 2015.

  1. Sathishk

    Thread Starter New Member

    Feb 3, 2014
    4
    0
    Hi guys!
    I am new here. I am working on square wave generator using audrino.
    Frequency range: 0 Hz to 5k Hz
    4 different frequencies have to be produced on 4 pins.

    Please guide and help.

    Thanks in advance.
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    Can you use the output compare module?
     
  3. Sathishk

    Thread Starter New Member

    Feb 3, 2014
    4
    0
    Hi paps,
    I am new to this stuff. Can you please give more info about output compare module? ​
     
  4. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
  5. Sathishk

    Thread Starter New Member

    Feb 3, 2014
    4
    0
    Hi,
    first tutorial says that max 170hz can be produced by that method.
    And using, tone function, 4 different frequencies can't be produced simultaneously on different pins.
    Regards
     
  6. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    In simple terms it is a free running timer and a comparison register. Whenever the timer is equal to the value in the comparison register the OCM (Output Compare Module) posts an interrupt request. When the interrupt is serviced an output pin can be toggled. If you have four OCM channels then you can have four squarwave outputs.
     
Loading...