Feature suggestion for "Clock divider"

Discussion on the RaceCapture App - Windows, Android, OSX and Linux.

Moderators: JeffC, stieg

Post Reply
GTIspirit
Posts: 249
Joined: Wed Jan 09, 2013 11:20 am
Location: SE Michigan

Feature suggestion for "Clock divider"

Post by GTIspirit »

Instead of listing the Clock divider as CLOCK/2, 8, 32, 128, 1024 how about listing instead the appropriate timerange for the pulses?
Image
CLOCK/128 doesn't mean anything to me since I don't know the logic behind it. How about instead listing the dropdowns as say 1-100Hz, 100-1000Hz or 1-1000us, 1-100ms, etc. Or at least give us a cheat sheet so we can know what frequency range/pulse time period is appropriate for each of these settings. :)

brentp
Site Admin
Posts: 6282
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Yes! that's a great suggestion. I was searching for a better way to represent that setting.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

GTIspirit
Posts: 249
Joined: Wed Jan 09, 2013 11:20 am
Location: SE Michigan

Post by GTIspirit »

Good to hear this could be a future improvement.

In the meantime, which clock divider would be appropriate for a rpm signal pulsewidth of 50ms to 3.75ms? This corresponds to 600-8000rpm on my car, which is of course outside the working range of the engine.....

Just wondering if perhaps I am using the wrong clock divider because I should definitely be able to acquire the blue signal below but as I reported in my previous post it doesn't work, constant 997. :(
Image

decathect
Posts: 13
Joined: Fri May 10, 2013 2:58 pm

Post by decathect »

I'm thinking that (divider/48000000) will tell you the minimum amount of time between pulses that can be measured.

As for maximum, it should be able to measure anything slower? I would think you'd want to set the clock divider as high as you reasonably can, based on what you're measuring, so as to not hog system resources.

So perhaps he's using a timer or other finite sized variable that overflows and can't measure your pulse speed. What prescaler are you using? Did you try a larger one? If he's using a 16-bit timer, then the slowst pulse speed that could be measured with a prescaler of 1 is:

(1/48000000)*65535 = 0.00273 = 2.73 ms.

GTIspirit
Posts: 249
Joined: Wed Jan 09, 2013 11:20 am
Location: SE Michigan

Post by GTIspirit »

I think you might be onto something. Under my thread for erratic rpm in the hardware section I had posted this comparison of measuring rpm with different clock divider settings, where the number after RPM is the clock divider setting.
Image

When the blue signal above is used, Clock/128 is clearly the best choice for the maximum pulsewidth of 30ms at idle of 1000. (pulse per rev divider was incorrectly set to 2/rev, so calculated rpm is double what it actually was.)
Last edited by GTIspirit on Mon May 13, 2013 4:43 pm, edited 1 time in total.

decathect
Posts: 13
Joined: Fri May 10, 2013 2:58 pm

Post by decathect »

That makes sense. According to my 'guesses' that would allow you to measure as slow as 343.3 RPM. Sounds like what you need.

Post Reply