Shop OBEX P1 Docs P2 Docs Learn Events
RC Time — Parallax Forums

RC Time

Eric REric R Posts: 225
edited 2004-11-02 22:31 in BASIC Stamp
Does anyone have a magical formula for cap/resist. combinations and their resulting time? I need to reliably and with a some accuracy measure 1/10th of a second. How accurate is the BS2 for repatition using RC time? Would I be better off with a 555 generating my clock pulse?

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-01 08:41
    You won't be any more accurate with a 555 as you will be with RCTIME -- both rely on capacitors for timing. You may want to read the pot position with an ADC, something simple like the ADC0831.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Eric REric R Posts: 225
    edited 2004-11-01 11:40
    How does reading the pot position with the 0831 in voltage (like stampworks #27) relate to RCTIME?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-01 13:33
    Both return a value that relates to the position of the pot. The difference is that the ADC0831 returns a direct, 8-bit reading and is not affected by a capacitor. That said, if you use a good quality mono cap, RCTIME works well and is very repeatable. I use it all the time for "knob" inputs.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-11-01 15:03
    If you want 1/10 second timing accuracy, I think you'll have to add an RTC (Real-time clock) chip of some description. The popular DS1302 only gives resolution to the second, unfortunately. The PC used the 8254 (I believe, anyway, *one* of the 82xx series) -- but that has an 8-bit bus, so it uses a lot of BS2 pins to read it.

    Another possibility is the sMT series of co-processors. I think you can program it to give you a clock edge every 10 mSec, and use that to synchronize your BS2 program.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-01 15:33
    The PCF8583 -- which can be used with I2C subroutines -- has a 1/100ths register.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Eric REric R Posts: 225
    edited 2004-11-01 22:10
    Thanks guys!

    I think I will break out the BOE and try a couple of your suggestions!
  • Eric REric R Posts: 225
    edited 2004-11-02 03:56
    OK,



    RCTime on the BOE (BS2 IC) with a 10k pot and a .1uf cap in debug gave me a result of 1 up to 800+

    What am I seeing here? mS? uS? How does this compare to time?

    I also noted that·a temperature change·affected this reading greatly. Is there a way to get a fairly stable reading from around 50 - 110 degrees F?

    Sorry guys, I guess I am missing the boat here...yeah.gif
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-02 04:31
    Not missing the boat, just not reading the manual....

    Each unit from RCTIME when using a BS2 is 2 microseconds. Caps are temp senstive; it would be best not to use RCTIME ove such a great range is temp stability is a requirement.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Eric REric R Posts: 225
    edited 2004-11-02 05:16
    Up to RCTime in the·WAM manual now. Been reading like a big dawg. Saw the 2 microsecond statement but failed to understand the conversion.

    In the "Understanding Signals" manual I found this

    DEBUG HOME, "(time/1000)*2 = ", DEC3 (time/1000)*2

    and plan to try it in the morning. ·will also look into the ADC0831 in hopes of a more temp stable setup.
  • BeanBean Posts: 8,129
    edited 2004-11-02 12:15
    Are you trying to measure pulse times, clock time or resistance ?

    Bean.
  • Eric REric R Posts: 225
    edited 2004-11-02 22:31
    Sometimes I do things the hard way...

    I got it after thinking about what I was doing. I wanted to create a steady 1/10th of·a second pulse and compare it to a frequency then compare to a threshold value. I found my problem. It would be much wiser to use the count function for the frequency and specify the time within that command then compare the value to the threshold. Once I accepted the accuracy of RCTime and moved on to the second step of the project, I caught my own error. Forgive me for taking it one step at a time and thank you ALL for your input!
Sign In or Register to comment.