Search This Blog

Sunday, 27 February 2011

Getting to grips with the OpenBench Logic Sniffer

I haven't used a Logic Analyzer since the mid-90s. With new products on the horizon, it's starting to become something needed with this hobby work. Budget constraints have always made it difficult to justify picking up a second hand analyzer. So I was intrigued to come across the OpenBench Login Sniffer (OLS). I ordered one from Proto-Pic, here in the UK. They delivered version 1.01 of the OLS board.

The first step was to make sure that the OLS was up-to-date with FPGA and PIC firmware. At the time of writing v2.12b of the OLS software is available here. Included is a simple application that can flash the OLS EEPROM with new FPGA bit-stream, and update the PIC firmware.

The Gadget Factory has a YouTube channel with a few videos showing FPGA logic analysis and UART debugging. Setting up some UART transmission looked like the easiest way to try out the OLS, and quick to setup on the Arduino Deumilanove.

The OLS is limited with the number of samples it can record, so we need to tell the OLS when we are about to transmit over a UART line. The Arduino runs with a 16 MHz crystal, so the OLS should be able to pick up a pulse on one of the digital I/O pins.

Below is the Wiring code to setup the UART on pins 2, and 3. Plus the trigger pulse output on pin 4. The NewSoftSerial library is used to allow for higher baud rates to be tested.
#include <newsoftserial.h>
NewSoftSerial UART1(2,3); // rx,tx
void setup()
    pinMode(4, OUTPUT);
    digitalWrite(4, LOW);
    UART1.begin(115200);
}
void loop()
    digitalWrite(4, HIGH);
    digitalWrite(4, LOW);
    UART1.print("hello");
}
This simple PDE file can be found here. Also at that SVN location is the project file used with the OLS alternative SUMP client (Jawi's version supplied with the v2.12b OLS software).

I connected the OLS breakout probes to Gnd on the Arduino, and the digital I/O pins 2, 3, and 4. With the above Wiring sketch uploaded to the Arduino I was then able to start getting to grips with Jawi's Java SUMP Client. I ended up sampling at 50 MHz, and that was able to capture just over 450 micro seconds worth of data. The SUMP Client has plugins for analyzing common bus protocols. Below is the UART analysis. As you can see, the OLS managed to capture the UART Tx from the Arduino, result!!

UART Analysis results


Generated: 27 February 2011
Statistics
Decoded bytes5
Detected bus errors0
Baudrate230400 (exact: 122249)
RxDTxD
IndexTimeHexBinDecASCIIHexBinDecASCII
023.280 μs0x680b01101000104h
1112.040 μs0x650b01100101101e
2200.780 μs0x6c0b01101100108l
3289.520 μs0x6c0b01101100108l
4378.280 μs0x6f0b01101111111o

Next up SPI testing...

No comments: