Shop OBEX P1 Docs P2 Docs Learn Events
Stamp BS2 Testing — Parallax Forums

Stamp BS2 Testing

paradigmparadigm Posts: 3
edited 2012-02-14 04:35 in BASIC Stamp
Hello, I am new here. I teach the use of microcontrollers and use the Stamp BS2 for an introduction. There is a requirement to quickly and easily test that Stamps are functional and have not been damaged. The most important thing is to check that all the I/O lines are functional as they are the most prone to be damaged by students! Can anyone direct me to any work that may have already been done on an automated test system? I have no aversion to starting from scratch and rigging up a PIC based test system but wonder if there is already a clever solution around?
Thanks,
paradigm

Comments

  • HumanoidoHumanoido Posts: 5,770
    edited 2010-08-11 04:58
    Yes, there are many such projects to test BASIC Stamps built over the years. There was a even a product which tested stamps but it was discontinued by Parallax some time ago. Several forum members have made testers too. The search will pull up their posts. Chris has a Stamp tester project here:

    http://forums.parallax.com/showthread.php?t=107510&highlight=stamp+tester

    Humanoido
  • paradigmparadigm Posts: 3
    edited 2010-08-11 08:46
    Thanks for the interesting link Humanoido. However, doing some searches I have been unable to find the schematic of the main board and the software link returns a 'link not found' message. Can anyone point me to the full information?
    Regards,
    paradigm
  • ercoerco Posts: 20,254
    edited 2010-08-11 09:32
    It's quick & easy to test used Stamps' outputs manually. Plug them into a programming board (BoE or equivalent) and program them to toggle all 16 pins, like 1 sec on, 1 sec off (typical program below). A quick check of each pin with a multimeter (analog meters' dancing needles are superior for this) tells me if the pin is putting out or not.

    a:for b0=0 to 15
    toggle b0
    next
    pause 1000
    goto a
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-08-11 12:15
    Paradigm, until Parallax fixes the new forum, this type of problem will persist. I tried to access the same posting on the old forum but could not find it with the old search engine.

    Using Google, I found complete plans for the BASIC Stamp tester on the Parallax web site.

    http://www.parallax.com/tabid/799/Default.aspx

    and there's even a usage tutorial for it here

    http://www.parallax.com/tabid/800/Default.aspx

    You can also access Chris Savage's BASIC Stamp tester project page with all downloads and details at his excellent web site found here:

    http://www.savagecircuits.com/forums/content.php?174-BASIC-Stamp-Tester-Usage-Tutorial

    This should keep you busy for a while. :)

    Humanoido
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2010-08-11 22:43
    To make a quick test, install the Stamp in a socket or carrier with nothing at all connected to the pins. The following program charges up the gate capacitance of each pin, first high and then low and at each stage checks to see that the charge holds, as it should if there is no leakage. It does all the pins at once, in an alternating scheme that also tests for leakage between neighboring pins.
    result VAR Word
    DIRS=$FFFF   ' all pins are output
    OUTS=$AAAA  ' alternate pins are high and low to charge gates
    DIRS=$0000    ' all are inputs
    result = INS     ' read inputs, gates should have held the previous Voltages
    IF result <> $AAAA THEN DEBUG CR,"error @ ",IBIN16 result ^ $AAAA
    DIRS=$FFFF     
    OUTS=$5555    ' switch which pins are high and which low
    DIRS=$0000
    result = INS    ' now inputs should hold those states.
    IF result <> $5555 THEN DEBUG CR,"error @ ",IBIN16 result ^ $5555
    
    One thing that can happen when a Stamp is abused is that either the source or the sink transistor can burn out, so that it can no longer go one state or the other, or the bond wire has burnt out, so that the pin can't do anything, or there has been internal metal migration that increases the input leakage current dramatically. As you know, i/o burnout is the most likely damage in the classroom! Some the Stamp boards (the homework board comes to mind) have series resistors permanently installed on the pins to forestall at least some inadvertent damage. There are some things the test can't detect, such as a weakened pin. Another thing that the program can flag as an error is excessive leakage between the pins that might be caused, say, by a student spilling a Coke on board. Now that could never happen, right?

    Sid Weaver (NEWZED) RIP, was an active member here who sold a stamp tester for a long time, and there was quite a long discussion about it back when the list was hosted on Yahoo Groups. That uses a ring of resistor/capacitors. A measurement is made of RCTIME for charge up from zero and also time for discharge down from Vcc. In that way it at one swoop tests the ability of each pin to be an output LOW, or HIGH, or an input. Humanoido just pointed out that technique.
    306 x 96 - 6K
  • ercoerco Posts: 20,254
    edited 2010-08-12 10:26
    A most ingenious test, Tracy. Thanks for sharing!
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-08-12 14:54
    I agree, Tracy, this is pure genius! It's a way to test Stamps without any hardware or "physical" test machine! I wonder why I missed this before? The power of software is self evident.

    It looks like a virtual software box could test the Stamp for many things, pins, cpu, eeprom, timing, math, program, and other functions. Perhaps many of these routines singularly already exist and are just waiting for use.

    Humanoido
  • NWCCTVNWCCTV Posts: 3,629
    edited 2010-08-12 21:06
    Here's a link to one Chris Savage posted in the old forum.

    http://forums.parallaxinc.com/forums/default.aspx?f=21&m=302780
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2010-08-13 09:09
    That "open pin" test works on other CMOS processors besides the Stamp, the Propeller for example.
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-08-15 07:39
    That "open pin" test works on other CMOS processors besides the Stamp, the Propeller for example.
    I was just wondering about that. This will be especially useful for testing multiple prop connected cluster systems.

    Humanoido
  • paradigmparadigm Posts: 3
    edited 2010-08-17 08:22
    Thanks to everyone for some great Stamp testing ideas! I have tried out Tracy Allen's amazingly simple solution and it seems to work very well.

    I have used Microchip PICs (16F and 18F series) for class exercises over many years with a very low rate of failed chips. I am somewhat surprised by the relatively high rate of damage to The Stamp BS2 modules (which are PIC based). However, I did note that the BS2 is based on the older 16C range PIC. Might this be more susceptible to port line damage? The present failures do not seem to be due to static discharge but more related to student mis-treatment!
  • BrianZBrianZ Posts: 28
    edited 2012-02-13 07:20
    Thanks, Tracy, for that great little test program.
    I hope you don't mind, but I corrected the error I got with the "IF...THEN DEBUG" command where a label was expected instead of DEBUG; and to avoid a blank screen when no errors are detected, I also added some debug output with test results...
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    result VAR Word
    DIRS=$FFFF   ' all pins are output
    OUTS=$AAAA  ' alternate pins are high and low to charge gates
    DIRS=$0000    ' all are inputs
    result = INS     ' read inputs, gates should have held the previous Voltages
    DEBUG "test1= ", BIN16 result, CR
    IF result <> $AAAA THEN result1
    DIRS=$FFFF
    OUTS=$5555    ' switch which pins are high and which low
    DIRS=$0000
    result = INS    ' now inputs should hold those states.
    DEBUG "test2= ", BIN16 result, CR
    IF result <> $5555 THEN result2
    DEBUG "No Errors Detected", CR
    END
    
    Result1:
    DEBUG CR,"error @ ",IBIN16 result ^ $AAAA
    RETURN
    
    Result2:
    DEBUG CR,"error @ ",IBIN16 result ^ $5555
    RETURN
    

    This gave me the following debug display:
    test1= 1010101010101010
    test2= 0101010101010101
    No Errors Detected

    Thanks again,
    -Brian
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2012-02-13 08:41
    Very useful Brian, to make the snippet a real program with a message of success or failure! It does indeed require PBASIC 2.5 to avoid the "expected a label" message.
  • BrianZBrianZ Posts: 28
    edited 2012-02-14 04:35
    Oops, I messed up - as written above, I noticed that the "No Errors" message would be displayed after errors were reported.:lol: My stamp is working, so I couldn't test that.
    I have revised it, and added a flag to keep track of errors and only report none if none are detected. Also fixed another small glitch that I believe would have caused the error messages to repeat. Sorry about that, and hopefully the following one will work correctly. Maybe someone with a broken stamp can test it.
    I guess programs are never done, they just keep getting better.
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    result VAR Word
    errflag VAR Bit
    DIRS=$FFFF   ' all pins are output
    OUTS=$AAAA  ' alternate pins are high and low to charge gates
    DIRS=$0000    ' all are inputs
    result = INS     ' read inputs, gates should have held the previous Voltages
    DEBUG "test1= ", BIN16 result, CR
    IF result <> $AAAA THEN GOSUB result1
    DIRS=$FFFF
    OUTS=$5555    ' switch which pins are high and which low
    DIRS=$0000
    result = INS    ' now inputs should hold those states.
    DEBUG "test2= ", BIN16 result, CR
    IF result <> $5555 THEN GOSUB result2
    IF errflag = 0 THEN GOSUB NoErrors
    END
    
    NoErrors:
    DEBUG "No Errors Detected", CR
    RETURN
    
    Result1:
    DEBUG CR,"error @ ",IBIN16 result ^ $AAAA
    errflag = 1
    RETURN
    
    Result2:
    DEBUG CR,"error @ ",IBIN16 result ^ $5555
    errflag = 1
    RETURN
    
Sign In or Register to comment.