I havent written any code yet, but i want to make sure i understand how this thing works. I want to measure the time between pulses on the signal i'm feeding into the capture port.
If i'm understanding this right, an event is a rising edge, falling edge, or a mutiple of edges. i want to use the rising edge. (every rising edge).
So when the capture port sees the event, it starts the timer. then when it sees the event again, it stores the timer values in ECCPR1H:ECCPR1L. (16bits). so when i read these values i have a unit of 'ticks' right? and i assume a tick is determined by my clock speed. so if i'm running at 20MHz, then a tick is 0.00000005 seconds.
im measuring pulses from a wheelspeed sensor so i was thinking of doing my math by measure the distance between pulses and from that figuring my MPH. i've found that (.0923/Tpulse(s)) or 923/(10000*Tpulse(s)) should give me my MPH for my tire circumference. so i just need to convert ticks to secods and i'm set.
i chose this option over say counting pulses per second or even half second because that would take too long to get a sample. does this make sense?
So i thought id run this by you guys before i started trying to code it up. thanks!
If i'm understanding this right, an event is a rising edge, falling edge, or a mutiple of edges. i want to use the rising edge. (every rising edge).
So when the capture port sees the event, it starts the timer. then when it sees the event again, it stores the timer values in ECCPR1H:ECCPR1L. (16bits). so when i read these values i have a unit of 'ticks' right? and i assume a tick is determined by my clock speed. so if i'm running at 20MHz, then a tick is 0.00000005 seconds.
im measuring pulses from a wheelspeed sensor so i was thinking of doing my math by measure the distance between pulses and from that figuring my MPH. i've found that (.0923/Tpulse(s)) or 923/(10000*Tpulse(s)) should give me my MPH for my tire circumference. so i just need to convert ticks to secods and i'm set.
i chose this option over say counting pulses per second or even half second because that would take too long to get a sample. does this make sense?
So i thought id run this by you guys before i started trying to code it up. thanks!