Shop OBEX P1 Docs P2 Docs Learn Events
Need help with wiring for a 5v digital meter using RCTIME on the propeller — Parallax Forums

Need help with wiring for a 5v digital meter using RCTIME on the propeller

eagletalontimeagletalontim Posts: 1,399
edited 2009-12-06 22:39 in Propeller 1
I am designing a program that will display the voltage value on an LCD but the problem I have run into is I have no idea how to get this to properly read from 0 to 5 volts. Since the RCTIME function in the BS2 functions file returns a byte value, it can only go to 255. For some reason, as soon as the voltage gets around 1.5 volts, it maxes out the byte variable and "hangs" till the voltage drops below the "limit point". Can someone help me get this wired up correctly?

The way I have it wired up is attached to this document.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-12-06 22:36
    RCTIME in the BS2 Functions object does not return a byte value. It returns a 32-bit long and does all its calculations using 32 bits.

    Try a higher input resistor, something like 680K with a 0.01uF capacitor. You'd get a charge time to a 1.6V threshold somewhere around 1200us with a 5V input which would give you an RCTIME result of 1200. Lower input voltages would take longer and give you a higher value.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2009-12-06 22:39
    oh ok. I will try that as soon as I can pick up some more resistors.
Sign In or Register to comment.