Shop OBEX P1 Docs P2 Docs Learn Events
timing operations — Parallax Forums

timing operations

bryce s.bryce s. Posts: 11
edited 2009-07-03 04:35 in BASIC Stamp
i am currently trying to construct a universal remote control from scratch, and i have been having trouble because the stamp's freqout command only operates in intervals of 1 ms. i was wondering if there is anyway to regulate this with a pulsout command but i have been unable to come up with a method of linking the two.
does anyone have any ideas on how to do this?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-03 03:05
    Unfortunately you can't control FREQOUT any finer. The only thing you could do is to use some kind of external logic. For example, you could move the generation of the 38KHz carrier out of the Stamp to a 555 timer and turn the timer on and off with the Stamp. You could also go to a faster Stamp like the BS2p or BS2px to get a little finer control of the FREQOUT, but that still may not be adequate for what you want.

    Post Edited (Mike Green) : 7/3/2009 3:12:20 AM GMT
  • bryce s.bryce s. Posts: 11
    edited 2009-07-03 03:15
    sorry, i'm not understanding
    can you explain what you mean exactly?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-03 04:31
    You can't "regulate" the FREQOUT statement any further. By using a faster Stamp model like the BS2p or BS2px, you can increase the granularity of the FREQOUT timing. The BS2px, for example, uses 0.166ms as the unit for the FREQOUT statement duration instead of the 1ms used on the BS2.

    If that's not fine enough control for your application, you'll have to add external circuitry to give you finer control or switch to a completely different microcontroller like the Propeller or the SX, both of which are faster and have better control of timing.

    Read the Wikipedia article on the 555 timer. There's also an example in the "IR Remote for the BoeBot robot" tutorial that you can find among the Parallax tutorials here: www.parallax.com/tabid/535/Default.aspx. You may find other useful information in the tutorial for your project.
  • bryce s.bryce s. Posts: 11
    edited 2009-07-03 04:35
    oh i see, thank you very much
Sign In or Register to comment.