Shop OBEX P1 Docs P2 Docs Learn Events
reset pulse recovery time — Parallax Forums

reset pulse recovery time

manzanamanzana Posts: 24
edited 2008-10-23 22:43 in BASIC Stamp
Does anyone know how long the BS2 takes to start processing after the reset goes away? I.e., after it goes high? I am trying to use the reset pulse as a pseudo-interrupt. Not sure if the BS2 goes into la-la land for a while before it takes off. Thanks!

manzana

Comments

  • SRLMSRLM Posts: 5,045
    edited 2008-10-23 03:25
    It's fast enough that a human probably wouldn't notice. But I don't think it would work very well for an interupt: how do you know where to go back to? You'd need to write something to the EEPROM, but by using the reset, you don't have the time to do that.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-10-23 04:39
    You can use multiple sequential resets to determine what to do next. Examine the Scribbler robot BS2 code to see how this is done. The problem is that all your variables get cleared to zero upon each reset. So it's not an ideal way to simulate interrupts.

    -Phil
  • Beau SchwabeBeau Schwabe Posts: 6,563
    edited 2008-10-23 05:56
    About 16.8 ms for a BS2p Rev E running a simple program....



    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    OUTS = %1000000000000000
    DIRS = %1100000000000000
    
    TestLoop:
    GOTO TestLoop
    
    



    ...With P15 connected to the scope, and P14 connected to the RESET, the time interval between resets was about 16.8 ms.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    900 x 600 - 178K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-10-23 14:41
    Please note that this will vary between different models of the BASIC Stamp 2, especially the BS2pe.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • manzanamanzana Posts: 24
    edited 2008-10-23 22:43
    Wow, thanks guys for the great input. My BS2 just naps most of the time. I cannot afford to burn power while it is doing nothing. But when a sensor input does come in it needs to get rolling fast , do a fair amount of processing, update some EEPROM locations and go back to sleep. I have a millisecond from the sensor input to wake up. It is clear from the attached image that this will be sufficient. I can go for hours with no (infrared) sensor input. In this case the BS2 will wake up on its own every 30 minutes or so and update me on its status via radio and then go back to sleep. I love my BS2 8-).

    manzana
Sign In or Register to comment.