Can i even sense the pulse duration whit Input Cpature?

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

Hello,

 

i maded program that senses the duration beetwen 2 rising or falling edges of a pulse on Atmega328. I also have an distance sensor that outputs distance in a form of a pusle length (147us = 1inch). But now i cant figure how to config ICP to capture first rising edge and then also the falling edge of the signal. Is the ICP even capable of doing this? Or should i simply read if input pin on MCu is high and count timer pulses until the pin goes low?

This topic has a solution.

Last Edited: Thu. Nov 23, 2017 - 07:20 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Search for Atmel App Note AVR135

 

 

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

ki0bk wrote:
Search for Atmel App Note AVR135

first hit on the above search!

 

cool

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Thanks all, the post about SFR04 solved it.