BASIC Stamp Logic Analyzer (#30010)

General: info@parallax.com
Technical: support@parallax.com
Web Site: www.parallax.com
Educational: www.stampsinclass.com
599 Menlo Drive, Suite 100
Rocklin, California 95765, USA
Office: (916) 624-8333
Fax: (916) 624-8003
BASIC Stamp Logic Analyzer (#30010)
Introduction
The BASIC Stamp Logic Analyzer (BSLA) is a collaborative design between Parallax and CWAV, the
developer of the popular USBee Pod logic analyzer series (www.usbee.com). The BSLA fits between all
24-pin BASIC Stamp and Javelin Stamp modules and their programming socket. The BSLA hardware
connects directly to your PC’s USB 2.0 port. The BSLA software runs on your PC and displays the digital
value of all 16 BASIC Stamp I/O lines, Vdd, Res, Sout and Sin.
Technical Features







USB 2.0 High-Speed connects the BSLA to your PC/1/
BSLA power is from the USB port
2 Ms/s sample rates, fast enough for all Parallax 24-pin modules /2/
20 channels (16 for I/Os and 4 for Vdd, Res, Sout, Sin)
Thresholds set at 1.4V and 0.8V, supporting TTL and CMOS
Small size (3.25 L x 1.95 W x 1.67 T cm / 1.28" L x 0.77" W x 0.66” T)
Free BSLA software compatible with Win2K, WinXP operating systems
o Multiple triggering options on all channels
o I2C, asynchronous serial, SPI bus decoder
o Minimum sample depth of 1 million samples up to available PC RAM
o Sample clock generated internally
o Save, Open and Print captured data and settings
o Movable cursors for easy measurements
/1/
To determine if your PC has USB 2.0 support, go to the Windows / Device Manager and look under Universal Serial Bus
Controller. If your device is shown as USB 2.0 Enhanced Controller then you have USB 2.0 support.
/2/
USB 2.0 PC systems are commonly available in two types (a) USB 2.0 native on the motherboard which runs at speeds
over 24MBytes/sec and (b) USB 2.0 PCI add-in cards and PCMCIA cards, along with some laptops which typically run at
only up to 8MBytes/sec. The BSLA’s 2 Ms/s BSLA sample rate with 16 channels is 4 Mbytes/sec, within the range of the
slower USB 2.0 computers and fast enough for all Parallax 24-pin microcontrollers.
BASIC Stamp Logic Analyzer
Parallax, Inc. • BASIC Stamp Logic Analyzer (#30010) • 02/2005
1
24
12
13
Top and bottom drawings
Page 1
Packing List
Verify that your BSLA kit is complete in accordance with the list below:
•
•
BASIC Stamp Logic Analyzer module
USB A to Mini B cable
The BSLA PC software is available for download from our web site at
http://www.parallax.com/detail.asp?product_id=30010 and is not included in the BSLA kit.
BSLA Software Installation
First, install the BSLA software before any hardware is connected. Download, unzip the files and run the
“Setup.exe” program. The BSLA software is compatible with Windows 2000/XP. The software will also
install the drivers for the Cypress USB chip used on the BSLA hardware and make the necessary addition
to your Windows registry file.
BSLA Hardware Setup
Next, install the BSLA module. The BSLA module fits between any Parallax 24-pin microcontroller and the
programming socket. To install the BSLA hardware on a Parallax board:
1. Disconnect power.
2. Remove your 24-pin Parallax module from the pcb socket.
3. Firmly insert the BSLA module noting the location of pin 1, denoted by the notch in the top of the
BSLA’s black socket. On the Board of Education, the BSLA’s USB connector will be oriented
opposite to the power jack as shown below.
4. Replace the 24-pin Parallax module in the BSLA’s socket.
5. Connect the USB mini-B cable to the BSLA and to the USB 2.0 port on the PC.
6. Plug in power.
BASIC Stamp Logic Analyzer installed on a Parallax
Board of Education.
Parallax, Inc. • BASIC Stamp Logic Analyzer (#30010) • 02/2005
Page 2
Using the BASIC Stamp Logic Analyzer Software
Run the BLSA software, which is located in the Programs/Parallax Inc/BASIC Stamp Logic Analyzer
directory.
Replace image with some changes requested to Tim.
If BSLA device was recognized, then you will see a green button with “BSLA OK” in the lower, right-hand
corner. Once you are successfully connected, try running the example BASIC Stamp / Javelin Stamp
programs at the end of this document to test all of the BSLA’s signals. These programs will display the
I/O ripple pattern shown above.
Parallax, Inc. • BASIC Stamp Logic Analyzer (#30010) • 02/2005
Page 3
Acquisition Controls
To acquire a signal, press the “Acquire” button. Use the pull-down menu to select the number of samples
you would like to acquire, between one million and the maximum shown. The maximum sample buffer
size will depend on the amount of available RAM in your PC. These samples will be stored in your PC’s
RAM as they are captured.
In the BSLA default state, it will start capturing data as soon as the “Acquire” button is
pressed. However, sometimes it is desirable to wait until a certain event on a signal line
occurs before the sampling begins. This can be done using the Trigger settings, which are
just to the right of the signal names as shown below.
You can trigger on any level combination on any of the 20 signals. For example, if you
want to trigger on the first time where P0 is sampled low, set the first position low
following the P0 label by clicking the high label until it looks low (see graphic examples
below). When you press “Acquire”, the BSLA will wait until the P0 signal is low. Once it is
low, it will trigger and store an entire buffer of samples. The buffer will display the Trigger
cursor (red marked with a “T”) showing the position that the trigger occurred. If you would
like to trigger on a falling edge, not just the next low sample, then use the combination of
high and low. If you would like to trigger on the next rising edge, select a low followed by
a high level.
No trigger
Low symbol
High and low combination triggers on a falling edge
The “Trigger Position” scrollbar lets you choose the relative location of the trigger within
the sample buffer. To see what happens before the trigger, put the trigger position over to
the right. Most of the captured samples will then be samples before the trigger occurs. To
view samples that occur after the trigger position, place the Trigger Position at the left side
(at the beginning of the buffer) and most of the samples will be samples taken after the
trigger occurs.
Parallax, Inc. • BASIC Stamp Logic Analyzer (#30010) • 02/2005
Page 4
Display Controls
The buttons labeled Zoom In and Zoom Out will zoom in or out on the signal in the middle of the BSLA’s
screen. The same function can be done by clicking the left and right mouse buttons in the colored display
area. The Zoom All button displays all samples contained in the buffer on a single screen.
Signals are measured using two cursors. Place your mouse on the “Cursors” line and mark the begin and
end points with your left and right mouse buttons, respectively. Zoom in as appropriate.
Measurements will be shown in your Display Controls box.
Parallax, Inc. • BASIC Stamp Logic Analyzer (#30010) • 02/2005
Page 5
SPI Decoder
The View menu includes an SPI Decoder. This tool translates the synchronous serial data bits sent to and
from peripherals like ADCs, DACs, clocks, memory devices, etc. The SPI Decoder requires that Slave
Select (SS), Serial Clock (SCK) and Serial Data Out and Serial Data In (SO and SI) lines be identified.
Next, select the Sampling Edge, Display Mode and Bit Order. ASCII or Hex values of the data lines will be
displayed.
For example, the following BASIC Stamp 2 code sends a decimal 65 (ASCII letter “A”). In order to
capture a short file, set the trigger.
'{$STAMP BS2}
SHIFTOUT 14, 15, LSBFIRST, [65]
Parallax, Inc. • BASIC Stamp Logic Analyzer (#30010) • 02/2005
Page 6
I2C Decoder
The I2C Decoder displays the data being sent or received by I2C-compatible devices (I2C command is
supported only by the BS2p and BS2pe). To use this feature, you must first identify the BS2p24’s I/O
connections that are connected to the I2C-compatible chip’s SCL and SDA pins.
For example, the following is an example of transmitting a “write” command to an I2C device connected
to pins 0 and 1, followed by an address of “5” and a number of “100”. It is important to have an I2C
device connected to the BASIC Stamp in order to receive acknowledgement.
'{$STAMP BS2p}
'{$PBASIC 2.5}
I2COUT 8,$E0,[$32,$32]
Parallax, Inc. • BASIC Stamp Logic Analyzer (#30010) • 02/2005
Page 7
Asynchronous Serial Decoder
Serial data may also be decoded using the Asynchronous Serial Decoder, accessed from the View Menu.
Choose any of the pins to monitor, configure the baud rate, parity and display mode.
With the following BASIC Stamp 2 code, the BSLA decodes ”Hello World!”.
'{$STAMP BS2}
SEROUT 0, 84,["Hello World!"]
Parallax, Inc. • BASIC Stamp Logic Analyzer (#30010) • 02/2005
Page 8
Frequently Asked Questions
(Q) I’m having trouble with the driver installation. The BSLA software isn’t recognizing the BSLA
hardware.
(A) Try
a)
b)
c)
d)
e)
f)
g)
h)
i)
j)
the following, systematically:
Plug in the BSLA hardware to the USB cable, and connect the cable to the PC
Go to Windows Control Panel, System, Hardware, Hardware Device Manager
In the Universal Serial Bus section, find the device that you have plugged in. It most likely will
have a yellow symbol next to it.
Right click and press Uninstall.
Unplug the device.
Reinstall the BSLA software.
Plug in the BSLA hardware again.
You will be prompted with the New Hardware Found wizard.
Choose all the defaults.
The device should be live and running now.
(Q) How do I know if my computer supports USB 2.0?
(A) Within the Windows Device Manager, expand the “Universal Serial Bus Controllers” list. If one of the
ports listed is a “USB 2.0 Enhanced Host Controller” or similar then you have USB 2.0 support.
Parallax, Inc. • BASIC Stamp Logic Analyzer (#30010) • 02/2005
Page 9
Example Code
The following BASIC Stamp 2 code will test all BSLA signals in a ripple fashion.
' =========================================================================
'
'
File....... Logic_Analyzer_Check.BS2
'
Purpose.... Tests IO Pins on Parallax USBee Logic Analyzer
'
Author..... Parallax, Inc.
'
E-mail..... support@parallax.com
'
Started....
'
Updated.... 02 FEB 2005
'
'
{$STAMP BS2}
'
{$PBASIC 2.5}
'
' =========================================================================
' -----[ Program Description ]---------------------------------------------
' -----[ Revision History ]------------------------------------------------
' -----[ I/O Definitions ]-------------------------------------------------
' -----[ Constants ]-------------------------------------------------------
' -----[ Variables ]------------------------------------------------------pinNum
VAR
Nib
' -----[ EEPROM Data ]-----------------------------------------------------
' -----[ Initialization ]-------------------------------------------------Reset:
' -----[ Program Code ]---------------------------------------------------Main:
DO
FOR pinNum = 0 TO 15
HIGH pinNum
PAUSE 5
LOW pinNum
NEXT
LOOP
'
'
'
'
cycle through all pins
make this pin high
short delay for scope
make this pin low
' repeat forever
END
' -----[ Subroutines ]-----------------------------------------------------
Parallax, Inc. • BASIC Stamp Logic Analyzer (#30010) • 02/2005
Page 10
Example Javelin Stamp Code
The following Javelin Stamp code will test all BSLA signals in a ripple fashion.
//
//
//
//
//
========================================================================
Logic_Analyzer_Check.java
Updated: 07 FEB 2005
========================================================================
import stamp.core.*;
public class Logic_Analyzer_Check {
static int pinNum;
public static void main() {
System.out.println("Cycling Pins");
while (true) {
for (pinNum = 0; pinNum <= 15; pinNum++) {
CPU.writePin(CPU.pins[pinNum], true);
CPU.delay(50);
CPU.writePin(CPU.pins[pinNum], false);
}
}
}
//
//
//
//
test
make
wait
make
all pins
pin high
5 ms
pin low
}
Parallax, Inc. • BASIC Stamp Logic Analyzer (#30010) • 02/2005
Page 11