Shop OBEX P1 Docs P2 Docs Learn Events
Help Driving Auto Guage — Parallax Forums

Help Driving Auto Guage

Tom86951Tom86951 Posts: 14
edited 2006-04-10 08:24 in BASIC Stamp
I have·a needle gauge in my car that·reads air pressure (boost)·from·0 to 12psi.· It is driven by the car's engine computer -- it reads 0psi at ground and 12psi at about 2v.· From what I've been told, the car's computer uses pulse width modulation to generate the 0-2v to drive the gauge.·

I have a sensor to measure the air pressure (boost) from 0·to 25psi, which generates a linear 0 to 5v.· I figured I could make a little A/D circuit to sample that sensor with the BS2, and then generate the corresponding gauge voltage using the PWM feature of the BS2.·

I'm a total newbie at all this and I am trying to figure out how to use the PWM to drive the gauge.· I've been playing with the capacitor/resistor arrangement described in the stamp manual.· I suspect I need a very small cap -- otherwise the gauge·won't go down·as fast as the sensor voltage -- but it needs to be big enough to hold the charge while the program·loops to sample the sensor and reset the PWM.···Any tips?



·

Comments

  • Tom86951Tom86951 Posts: 14
    edited 2006-04-09 07:21
    For example, can someone tell me if the program stops at a PWM instruction, until the pulse cycle is completed, or does it just trigger other hardware to fire off the pulses so that the program can move on while the pulses are happening?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-09 19:54
    Hello,

    ·· Since the BASIC Stamp is a single-tasking controller it will execute the PWM statement and then move on to process other commands.· So yes, while it is generating PWM it will be unable to do anything else.· We do have the PWMPAL, however, which allows you to program up to 4 PWM channels which will continue while the BASIC Stamp processes other information.· Optionally, you could create a small co-processor from an SX Chip.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • FORDFORD Posts: 221
    edited 2006-04-10 08:24
    Or if you want to do things simultaneously, the new Parallax Propeller chip would be the go,
    there is a discussion group in this forum starting to discuss this new device. Look on the 'forum quick jump' above.

    Cheers,
    Chris
Sign In or Register to comment.