Shop OBEX P1 Docs P2 Docs Learn Events
force identify without runing editor? — Parallax Forums

force identify without runing editor?

stbrnrdstbrnrd Posts: 35
edited 2007-08-18 03:45 in BASIC Stamp
Hello all -

i have a small dilemma, i'm running a bsx2 stamp parallel with a pc, (when the pc is on, the stamp is on) but have noticed that 1 out of 53 times the pc turns on, the stamp doesn't; but if i run the editor and 'identify' ( ctrl + I ) it (the stamp) comes up like if nothing had happened... is there a way to have that command ( ctrl+I) be in somekind of a batchfile that runs once the pc is on? so not to have a need to run the editor and then identify?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-08-17 22:54
    The Stamp is forced to restart (reset) every time the serial port is opened. Depending on how you're connecting the PC and the Stamp, this may happen when the serial port is powered on as well. Obviously, it misses occasionally. You could use any programming tool available to just open the COM port you're using, then close it, and arrange that program to run on start up (There's a folder somewhere that has autorun programs in it ... I'm not a big Windows user, so I can't help with the details).

    It would help if you explained something about why you need to have the Stamp and PC connected through power cycling and why you need to have the Stamp initialize itself. Other solutions might include not using the programming port to communication with the PC (and using some other pins instead) unless you're actually using the Stamp Editor or using an external timer (like a 555) to hold the Stamp in reset for several seconds (maybe 15-30) until the PC has finished initializing itself.
  • stbrnrdstbrnrd Posts: 35
    edited 2007-08-18 03:26
    wow, that was pretty good [noparse]:)[/noparse]
    the reason i had the stamp synced with the pc at start-up is because the pwr sply of the pc is powering up the stamp so as not to have a need for a secondary power supply.
    the reason to have the stamp initialize itself, is to avoid having the pc on and the stamp off ( due to you very well made explanation)
    the reason i have the stamp connected to serial port of the pc, was to assist in troubleshooting in case of peripheral failure.

    can i program a pin of the stamp to do the same as the identify command of the editor? maybe it then can be connected in parallel with the pc-turn-on switch?

    just a thought [noparse]:)[/noparse]
    but thanks for your answer [noparse]:)[/noparse]
  • Mike GreenMike Green Posts: 23,101
    edited 2007-08-18 03:45
    If you look at the circuitry given in the Basic Stamp Manual for the programming / debug connection, you'll see that the DTR line of the serial com port is connected through a capacitor or two to the ATN pin of the Stamp. If you also look at the schematic of the Stamp module itself, you'll see that the ATN pin is connected to the Reset pin of the Stamp processor. When DTR is toggled (from on to off or off to on), there's a pulse produced on ATN and this resets the Stamp. DTR is normally turned on by the I/O driver when the com port is opened and it's turned off by the I/O driver when the com port is closed.

    Whenever you do an identify or download operation from the Stamp Editor, it starts off by either opening the com port or toggling the DTR line. This resets the Stamp. After the Stamp has finished its initialization, it listens to the com port. The Stamp Editor sends a request for information to the Stamp after a suitable time (to allow for initialization). If the Stamp is there and receives the request, it sends identification information which the Stamp Editor displays (for an identify) or uses to verify that it's the right Stamp model (for a download).

    Anyway, your program can open and close the com port or, if the com port is already open, can toggle DTR in order to reset the Stamp.

    You probably don't want to use the PC on-switch as a source for the reset because it takes the PC a while to wake up completely and you don't want the Stamp to wake up before the PC is ready. You really need an "OK to go" signal from a program running under Windows.
Sign In or Register to comment.