Shop OBEX P1 Docs P2 Docs Learn Events
timeout for RCTIME? — Parallax Forums

timeout for RCTIME?

bulkheadbulkhead Posts: 405
edited 2007-07-15 02:06 in BASIC Stamp
I need a way to set a timeout for the RCTIME command since it takes 131ms for it to timeout itself and I need to refresh several servos every 20ms. Is there a way around this?

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-07-15 01:54
    · It can take up to 130msec, but it doesn't have to -- that all depends on the values of R and C.· For very short periods (time = R x C) it's less than that.·

    · Try selecting values so that time will be shorter (R x C·< 10msec.)

    · Update -- From PBASIC Help: When RCTIME executes, it starts a counter... It stops this counter as soon as the specified pin is no longer in State (0 or 1).

    Post Edited (PJ Allen) : 7/15/2007 2:03:31 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-15 02:06
    The short answer is that there is no way to set a timeout for the RCTIME command. PJ Allen's suggestion is a practical solution to the need to refresh servos every 20ms. If you're willing to use some external circuitry, you could use a 555 timer to short out the capacitor when 20ms have gone by and terminate the RCTIME if you use the capacitor's discharge voltage to trigger the RCTIME.
Sign In or Register to comment.