how to measure pulse width via AVR?

Discussion in 'Homework Help' started by eric_s88, Mar 14, 2012.

  1. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    Hi everyone!

    I have an ultrasonic device that is used to measure distance and detect objects. It works almost same as SRF05.

    the problem is that I want to measure the pulse width - that is generated on echo pin- in uS ...

    but I dont know how to do this, I know it is possible by uController timers..
    but I dont know its instructions..

    I work with atmega16 and codevision compiler..


    thank you
     
  2. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Take a look at the Atmega16 datasheet for the information on the input capture function.

    hgmjr
     
Loading...