Shop OBEX P1 Docs P2 Docs Learn Events
Reading Engine RPM. — Parallax Forums

Reading Engine RPM.

eagletalontimeagletalontim Posts: 1,399
edited 2009-10-30 03:28 in Propeller 1
I am looking to read a vehicle's engine RPM which has a 5v square wave output. I have successfully done this with Bean's code on the SX28, but since the propeller is completely different, I was hoping someone may have some code already that I can use for my project.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-30 02:37
    There are some examples of frequency (pulse) counting using the cog counters in the application note on the counters (AN001) downloadable from the Propeller Downloads webpage.

    Basically, you'd set up one of the counters to count input pulses, wait for a specific period of time, then read (and stop) the counter. How long you'd wait depends on how often you need the RPM reading updated. If you need instantaneous RPM readings, you could also use the cog counters, but measure the time between leading edges of the RPM sensor (to give a time between pulses), then take the inverse of the time to get the frequency.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2009-10-30 03:09
    Are there any commands like the PULSIN on the SX that I could use? That is what I was using and it was accurate up to 10,000 RPM. I need to ensure accuracy and speed of calculating the RPM since most the my program runs on the RPM variable. I was thinking about using a cog to read RPM so other code can be run simultaneously, and then use another one to display information on a 2 x 16 serial display.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-10-30 03:28
    What Mike Green said:

    Look on the page for AN001:
    www.parallax.com/tabid/442/Default.aspx

    In the Object Exchange, have a look at these. I have no personal experience with them, but they might give you some ideas:

    obex.parallax.com/objects/98/

    obex.parallax.com/objects/479/
Sign In or Register to comment.