I just recently got a HiLetgo 24MHz 8 channel USB logic analyzer on Amazon for $11. I am blown away what you can do with it.
I have three examples to show some of it’s capability based on some of my recent posts
- an example of a bit-banged SPI driver I wrote for a MAX7219 7-segment display driver
- the output of the 555 timer circuit I built in a recent post
- the I2C sda and scl lines of the MCP23008 perl-based gpio extender driver I wrote.
Here is the setup I have for the MAX7219 display driver.
I am using my new pine64 to drive the display. The datasheet for the max7219 describes in detail how to operate the chip like how to configure the driver via control registers and the data format. Below is the expected data format per the datasheet:
I connected my logic analyzer to the MOSI, CLK, and slave select lines and here is the output in PulseView.
You can see on the slave select line, I go high and low and then bang in 16 pulses on the clock line. The data is on the MOSI (master out, slave in) line and tells the driver which LED’s to turn on. This is awesome for troubleshooting problems with digital circuits. What is really cool is PulseView’s ability to decode SPI. The bottom line show the content of the frames in hex and binary.
One thing I find interesting with my perl based, bit-bang driver is that the clock pulses are irregular in their duty cycle. This is easy to see if you zoom in on the clock line.
Each dot on the square wave represents a sample pulseview took.
Now for the output of the 555 astable multi-vibrator circuit I recently blogged about. These were the parameters of my circuit.
And here is what PulseView saw.
The calculator says 4.3Hz and a 52.38% duty cycle. That is pretty much what PulseView said. The output of the 555 timer is very precise and regular.
Finally, lets take a look at an I2C example using my MCP23008 driver from the binary counter example I recently blogged about. Well, this is the first scan with the logic analyzer that I am actually using the device’s hardware, in this case I2C. That being the case, it is much faster than my bit-bang SPI example, and certainly the 4.3Hz 555 circuit. At first glance, it doesn’t look like much. I did tell PulseView what protocol I was using, and which lines were sda and scl.
You just see some periodic blips on the lines, but the frames are accurately decoded. You have to zoom in to see what precisely is going on with the pulses.
Above is a blown up view of one of the blips from the complete trace above.
Every maker should have a logic analyzer for development and troubleshooting, and I highly recommend the HiLetgo analyzer I use.