Made frequency value in microcontrollers by timer0

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi i work on a project by atmega16 that i made a pulse with 50% dutycycle that i code it in atmel. Now i have that pulse. But i want to find micro its exact value and show it in lcd. Noe my i question is that how can u measure port B0 pulse exact value and show it in lcd.

Aasshh

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Use timer capture feature.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note that you cannot display the frequency, without out a secondary reference.  Since the micro is generating the wave, you could certainly use some timers & lcd to measure & show the freq (say 27.83 KHz).  However,  say the clock drifted 15% faster.  Then the generated freq would increase by 15%, but the measurement time would decrease likewise & you'd (wrongly) still display 27.83 KHz.   Duty cycle measuring & display does not depend on the timebase freq, so such measurement would be more suitable.   

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!