|
USAGE TUTORIAL - TESTING BASIC STAMPS
The first thing to realize is that the BASIC Stamp Tester cannot detect all issues or BASIC Stamp failures. The most obvious case is that the BASIC Stamp cannot be detected by the BASIC Stamp Editor or some other communication error. The tester is designed to detect issues with the I/O pins, RAM and in a sense, the on-board regulator. The code is designed to be as thorough as possible.
INTERNAL/EXTERNAL TESTING
The first thing that needs to happen is you need to tell the BASIC Stamp Editor which BASIC Stamp it is testing. This is done by selecting the appropriate Stamp Directive from the toolbar or menu. The reason this is important is that the test code uses conditional compilation to setup different parameters and code blocks that are different for the various BASIC Stamp models. If you don't change the stamp directive you will be directed to do so when you download the program and the editor detects a different model.
Bear in mind there is a verbose mode and a non-verbose mode. Parallax manufacturing uses the non-verbose mode for speed. Tech Support uses the verbose mode to see exactly what is happening. These modes are set by a variable toward the beginning of the code. The default is to use verbose mode, which takes slightly longer to run.
Once the code has been downloaded to the target BASIC Stamp Module it does the following...
-
The OUTS register is checked for integrity so it can be used as a counter for the next test.
-
Variable RAM is tested.
-
If the module has scratchpad RAM it is tested.
-
I/O pin drivers are tested.
-
I/O pins are tested via external RC circuit.
WHAT IS GOING ON IN THERE?
The OUTS register is checked first because in order to test RAM we need some way to keep track of the address, but we're essentially destroying RAM so we can't create a variable. Besides that we need to do a complete test. Status of each test is shown on the DEBUG screen in verbose mode.
Once variable RAM is tested SPRAM is tested (if available). The EEPROM is not tested save verification of the code download.
The I/O pin drivers are read back by the input register to verify that each pin reads what it is set to in the OUTS register. This is our loopback test. This is visually seen by a pattern of ones and zeros on the DEBUG screen.
Finally, each pin is tested using an RCTIME test with an external RC circuit. There are actually about a dozen ways a pin can fail and the last two tests are designed to catch them all. This test ensures that each pin is within spec and is fully connected externally to the module (no broken traces or bad solder joints). The values for the RCTIME test are shown on the DEBUG screen along with a pass/fail indication.
During development of the code I was trying to find a clever way to determine if a BS2p40 was connected. I had a few choices since there is no separate directive for 24 and 40-pin BS2p modules. I finally used the fact that on 24-pin modules the AUX pins are internally pulled-up. This is a reasonable method for determining whether we have 16 or 32 I/O pins to test.
LET THE TESTING BEGIN
Okay, let's grab our BASIC Stamp Tester and drop in a BASIC Stamp Module to test.
 In the example, a BS2 was loaded onto the tester. Notice the top LED lights? This is an indication that the on-board regulator on the module is working. The LED should light when the ZIF socket is closed. If we now connect our Serial Cable or USB to 232 we can download the test code and see what the status of this BASIC Stamp is.
 In this example a BS1 is installed in the socket on the left and a BS1 Serial Adapter is connected to download the BS1 Test Code (atached below).
Note: Due to architectural differences between the BASIC Stamp 1 and BASIC Stamp 2 line there is a different program (and as you can see, a different socket) for testing the BS1 Module.
TESTING THE EXCEPTIONS...
In the following examples we'll be testing a Homework Board which includes a surface-mounted BASIC Stamp 2 installed on it. For this we'll use the Card Tester since it can connect to the 16-pin SIP socket on the board, connecting to all 16 I/O pins and providing the RC circuit required by the test code.
 The Card Tester plugs in as follows.
 If you installed the optional grounding wire you can connect it to the VSS connection on the board.
 Here the Homework Board is ready for testing. For those wondering about the built-in series resistors on the Homework Board, they do not affect the overall resistance in the RC circuit enough to affect the test results adversely.
 Here are the first 4 Card Testers created after cutting up the first mini-board.
JAVELINS?!?
Yes, that is correct. The Javelin Stamp can be tested using the attached program. There are two pieces to the program, "Javelin_Test.java" and "J_test.class". Both files must be in the same folder when using this code. You would load the Javelin_Test.java code into the IDE and run it to get the results. Be sure your DEBUG window is opened sufficiently to view the data shown.
Chris Savage
Parallax Engineering
Post Edited (Chris Savage (Parallax)) : 9/6/2009 11:57:03 PM GMT Image Attachment :
 stamptester_07.jpg 22KB (image/pjpeg)This image has been viewed 305 time(s). | Image Attachment :
 stamptester_08.jpg 24KB (image/pjpeg)This image has been viewed 306 time(s). | | | File Attachment : BS2+ Test_Release.bs2 18KB (application/octet-stream) This file has been downloaded 248 time(s). File Attachment : bs1test.bs1 1KB (application/octet-stream) This file has been downloaded 118 time(s). File Attachment : Javelin_Test.zip 3KB (application/x-zip-compressed) This file has been downloaded 44 time(s). |