SUMP2 – 96 MSPS Logic Analyzer for $22

icestick-reva-computer-2400.png

sump2_popup_menu1.png

 

2016.22.22 : SUMP2 now also available for RaspPi+icoBoard here.

2016.12.13 : Great video on SUMP2 from Bil Herd at Hackaday.

2016.10.31: Thanx to SteveDC, a 3D printed case is now available for SUMP2 here.

2016.10.30 : SUMP2 5V Input shield is now available from OSH-Park for $5. BML can also design similar shields for RS232,RS422/485,LVDS and CAN Bus if there is any interest.

2016.10.24 : Black Mesa Labs has an ongoing mission to develop easy to use and fully capable open-source hardware and software tools that make engineering electronics easier. One such tool is this new low cost open-source logic analyzer called SUMP2 for people who otherwise work in the blind without an oscilloscope or logic analyzer on their bench top.  BML’s 1st incarnation called SUMP1-RLE in 2014 was a 16bit FPGA based logic analyzer that performed real-time hardware compression and decompression. The decompressed data was streamed out over USB using the open SUMP protocol ( hence the name ), allowing it to be used with the excellent Java software from the original 2007 sump.org project. The SUMP1-RLE project was later enhanced from just 16 triggerable events to also include 2 DWORDs of “data” ( additional 64bits of non-triggering non-compressed signals ) and advanced triggering options. Including the data DWORDs made SUMP1 a useful tool for complex FPGA development debugging of internal FPGA event nodes and data paths. These new features required new custom software, written by BML in .NET for Windows. The software was functional, but graphically slow and was mostly used for trigger setup and then exporting captured data as VCD files into GTKwave for viewing. SUMP1 also did not scale in width, depth or time, it was fixed at 16 events, 2 DWORDs and a 2^20 timestamp ( 1 Million Samples ) both in hardware and software. In 2016 BML decided to do a complete start-over on the SUMP RLE concept and developed SUMP2-RLE ( or just SUMP2 for short ). New Hardware, New Software. More features, better scaling – introducing SUMP2:

bml_sump2_on_ice_stick2.png

The sump2.v verilog file is designed to work inside any FPGA or ASIC containing block RAM and scales in complexity from 1-4 bytes of events ( 8-32 triggerable and RLE compressible signals ) and 0-16 DWORDs of up to 512 non-compressed data bits. Depth and width of RAM scales on instantiation to best fit a wide range of FPGA technology. The full featured SUMP2 configuration is designed to be used on internal nodes within very large $100 – $1000 FPGAs. In this configuration for analyzing internal FPGA nodes it is very similar to proprietary FPGA vendor solutions such as Xilinx ChipScope and Altera SignalTap. SUMP2 has the advantage of being fully open and also offers RLE compression that can offer 10x – 1000x the time storage of similar FPGA logic analyzers not aided by hardware compression. Duty cycle hardware applications such a pulse-echo radar can readily achieve 5,000x compression using the new RLE engine with 2^32 timestamps. The scalability of SUMP2 also permits it to work in ultra low cost ( sub $5 ) FPGAs such as the Lattice iCE family. The Lattice iCEstick eval board at only $22 with included FTDI USB interface and PROM programming provides for a perfect SUMP2 platform for electronic debugging of Arduino and Raspberry Pi like projects involving 3V serial ports and GPIO. Communication between hardware and software over USB is all done using the Mesa Bus Protocol , an open serial protocol for transferring 32bit PCI reads and writes over UART, SPI and SERDES serial links between computers and FPGAs.

Lattice-iCEstick.png

Lattice-ICEstick-Layout-1.png

bml_sump2_on_ice_stick1.png

To fit within the iCE40HX1K FPGA, sump2.v verilog RTL design is instantiated for 16 input events, no DWORDs and 1k depth of RLE capture RAM sampling at 96 MHz. The graphical backend software is sump2.py, a PyGame application used for arming the hardware and dumping and displaying the capture for analysis. Compared to the SUMP1 .NET app, the PyGame SUMP2 version is very fast. Although sump2.py supports exporting and importing VCD files, it is entirely not necessary to use a standalone VCD viewer such as GTKwave or Modelsim.

A simple example of a Unit Under Test.  Below pictured is a 10 MHz ( 100ns period ) oscillator driving a 74ACT161 4bit counter with a 74HC08 AND gate on the d(2) and d(3) upper bits of the counter. A push button switch to ground with a 10K pullup resets the counter. 8 nodes of interest are connected via Dupont ribbon cable to the iCEstick PMOD header.

IMG_1842.JPG

Short demonstration video of the sump2.py PyGame application:

The initial full capture of the reset button being released. The capture represents 4168 samples at 96 MHz using only 1K of RAM by utilizing RLE compression. RAM is hard partitioned 50/50 pre and post trigger.sump2_0003.png

SUMP2 has the ability of masking input events prior to arming which allows for greater RLE time compression. By double-clicking and “Hiding” the clk_10m signal prior to a new acquisition, the highly active clock signal is masked. This next capture without the 10 MHz clock is twice the length, or 83uS.  Also notice the very short reset switch bounce captured. Masking the LSB counter bits would further increase total capture time.

sump2_0004.png

Mouse scroll wheel can be used for zooming in and out in time, allowing for rapid detailed analysis and cursor measurements.

sump2_0000.png

Right-Clicking the mouse launches popup menus for tool selection.

sump2_popup_menu1.png

The left side popup allows for selecting a signal and then assigning it as a rising or falling edge trigger.

sump2_popup_menu2.png

Steps for building your own open-source SUMP2 Logic Analyzer for the Lattice iCEstick.

What is needed:

  1. $22 iCEstick from Mouser, Digikey or direct from Lattice. ( ICE40HX1K-STICK-EVN )
  2. Free FPGA Diamond Programmer software from Lattice.
  3. Windows Device Driver for the FT2232H USB chip from FTDI ( this may also be included with Lattice Programmer ).

and this free stuff from Black Mesa Labs:

  1. Bitfile for SUMP2 for the Lattice iCE40HX1K FPGA.
  2. bd_server.py – a Python TCP server for communicating to hardware over USB.
  3. sump2.py – a Python PyGame application. Handles triggers and waveform viewing.
  4. FPGA Design Files ( Optional, only needed if not using prebuilt Bitfile ).
  5. 5V Input shield PCB design in CopperConnection ( Optional ).

And finally, a bunch of text file documentation from Black Mesa Labs:

  1. Installation Instructions
  2. FAQ
  3. Program Launching instructions
  4. Troubleshooting guide
  5. Pinout for connecting flying leads to iCEstick
  6. Change Log for Software and Hardware
  7. Bug Report

EE Times Article by Clive “Max” Maxfield on SUMP2

Hackaday Article by Jenny List

Please enjoy SUMP2, a 96 MSPS 16bit 3V logic analyzer for only $22. Follow BML on Twitter for updates on SUMP2 and other open-source software and hardware projects from Black Mesa Labs.

EOF

Advertisements
SUMP2 – 96 MSPS Logic Analyzer for $22

Easy path to running embedded Python on a RaspberryPi


pi-zero

10.14.2016 : Fixed the ZIP file for the Jessie-Lite disk image. 1st one was an invalid zip.

10.09.2016 Black Mesa Labs is a huge fan of both the Arduino community and the Raspberry Pi community.  Arduino’s make it really simple to do embedded tasks that don’t require a ton of horsepower ( flashing LEDs, etc ) where-is the RaspberryPi platform provides the full power ( and complexity ) of a complete Linux workstation for as little as $5 ( Pi Zero ).  Unfortunately, embedding a $5 Linux workstation isn’t always what you really want to do. You want to embed software into something like an Arduino that you apply power to and it then does something pre-programmed, no mouse, no login, no screen or keyboard required.  Wouldn’t it be great for non-SysAdmins to have a easy to use RaspberryPi solution for booting Linux and running a single predetermined piece of software like an Arduino does? Keep reading, Black Mesa Labs has a solution…

BML has created a custom Raspbian Jessie-Lite image for booting and executing a single application easily. This Pi image was used for the HAB1 balloon ascent to 31km (103,000 feet ) in April of 2016.  At the start of the project BML realized the amount of software required in the limited time for the flight just wasn’t possible writing embedded C/C++ code.  At BML the most precious resource is engineering time, therefore software projects tend to be written in Python whenever possible as the time overhead for writing, compiling, downloading and testing C and C++ is a tremendous hindrance. BML efficiency and quality of software using Python is easily 10x that of C/C++ ( and don’t get me started on writing and debugging Assembly language ).

pi_tft35_screen

This post is the detailed description of creating this 2GB Pi image for embedded Python that anyone is free to either create or just download ( from above dropbox link )  and image on their own Pi SD card.  Running custom software ( Python text based, or PyGame full graphical ) is as easy as copying a single Python file to a USB stick and then turning the Pi on.  This image is designed to work headless ( no screen – as was used in HAB1 ), or optionally with a HDMI display, or a 3.5″ 480×320 TFT display from either AdaFruit or Kuman.

The brains of the operation is this single file boot_script-sh containing 70 lines of BASH scripting that executes on powerup and behaves like a PC’s BIOS boot sequence of boot from A:\ ( Floppy ), D:\ ( CD-ROM ) and then finally C:\ ( hard drive ).  The BML boot_script.sh attempts to execute from a NAS ( Network drive ) 1st, then from the USB stick and finally from the SD card looking for special pragma files on what to do.  It also automates software updates by auto de-tarring ( unzipping ) *.tgz or *.zip files from a USB stick to the SD card.  In short, you can write some Python on your PC ( or Linux workstation ) , copy it to your your USB flash drive, stick it in your Pi and your Pi will run it automatically on boot. Streamlined and efficient, right?

 

This post ends with a detailed list of instructions on configuring an off-the-shelf Raspbian Jessie-Lite image for this automated behavior.  Look for an example PyGame application soon from BML that fully utilizes the Pi camera and TFT touch screen display in an example embedded camera application.

notes_bml_pi_setup-txt

[ Download 2GB PiTFTr Jessie-Lite image from Adafruit ]
https://adafruit-download.s3.amazonaws.com/2016-03-25_Jessie_Lite_PiTFT35r.zip
RASPBIAN JESSIE LITE
Minimal image based on Debian Jessie for Pi 1,2,3
Release date:2016-03-25
Kernel version:4.4.23+

[ If using Kuman display, download and burn 2nd card from Kuman CD-ROM ]
Copy 2 files from Kuman Image to Adafruit Image:
/boot/overlay/tft35a.dtbo
/boot/overlay/tft35a-overlay.dtb

Select display to use by changing line in /boot/config.txt
WARNING: If not using TFT display, line MUST be commented out
(Note: This can be done from Windows as /boot is FAT partition )
From: dtoverlay=pitft35r : For AdaFruit 3.5″ TFT Display
To: dtoverlay=tft35a : For Kuman 3.5″ TFT Display
To: #dtoverlay=pitft35r : For regular HDMI Display

[ 1st Boot : Login pi,raspberry ]

[ Configure Raspbian ]
sudo raspi-config
1) Expand Filesystem to fill 2GB card.
3) Boot to Command Line. B2=Console AutoLogin as pi
4) Wait for Network on Boot. YES
5) International
Locales : Deselect en_GB.UTF-8 UTF-8
Select en_US.UTF-8 UTF-8
TimeZone : US Pacific-New
Keyboard : Generic 104-key PC, English-US
6) Enable Camera Interface = YES
9) Advanced Options
A2 : HOSTNAME : RaspPi
A4 : SSH : YES
A6 : SPI : YES
A7 : I2C : YES
A8 : SERIAL : NO ( Don’t allow serial port login )
A9 : AUDIO = AUTO ( vs Force HDMI or Force 3.5mm )

[ Reboot and run /sbin/ifconfig to get IP Address ]

[ ssh 192.168.1.144 -l pi ( password raspberry ) from normal desktop ]
Note: May be necessary to delete ~.ssh/known_hosts file

[ Running script automatically after login ]
sudo vi /etc/profile
Add the following line to the end of the file
. /home/pi/boot_script.sh

[ Enable Mounting USB Drives ]
sudo apt-get install usbmount
sudo vi /etc/usbmount/usbmount.conf and modify line: ( Makes USB Writable )
FS_MOUNTOPTIONS=”-fstype=vfat,umask=0000″

[ Enabling tmpfs – Writing temp files to RAMdisk instead of SD Card ]
http://www.zdnet.com/article/raspberry-pi-extending-the-life-of-the-sd-card/
sudo vi /etc/fstab
tmpfs /tmp tmpfs defaults,noatime,nosuid,size=100m 0 0
tmpfs /var/tmp tmpfs defaults,noatime,nosuid,size=30m 0 0
tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=100m 0 0
tmpfs /var/spool/mqueue tmpfs defaults,noatime,nosuid,mode=0700,gid=12,size=30m 0 0
# Unable to reboot or shutdown. “Failed to talk to init damoen”
# tmpfs /var/run tmpfs defaults,noatime,nosuid,mode=0755,size=2m 0 0

[ Mounting BlackMesa NAS ]
mkdir /home/pi/nas
sudo vi /etc/fstab
//BlackMesa/khubbard /home/pi/nas cifs auto,uid=1000,gid=1000,username=khubbard,password=password,rw,file_mode=0666,dir_mode=0777 0 0

[ Allow users to modify /boot/config.txt without sudo (for force_hdmi things) ]
/etc/fstab
#/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p1 /boot vfat users,rw,owner,umask=000 0 2
[ Installing PyGame for Jessie-Lite ]
sudo apt-get install rpi-update
sudo rpi-update
sudo apt-get update
sudo apy-get install python-pygame
sudo apt-get install python-picamera

[ Install MP4Box for Converting H264: MP4Box -add filename.h264 filename.mp4 ]
sudo apt-get install gpac

[ Speech Synthesis w/o Internet Connection ]
sudo apt-get install espeak
espeak -ven+f3 -k5 -s150 “I’ve just picked up a AE35 fault ” 2>/dev/null

[ PySerial ]
sudo apt-get install python-pip
sudo pip install pyserial

[ SPI Serial spidev ]
sudo apt-get install python-dev
sudo apt-get install git
git clone git://github.com/doceme/py-spidev
cd py-spidev
sudo python setup.py install

[ RockBlock Sat Modem ]
sudo apt-get install screen
sudo apt-get install usbutils
git clone https://github.com/MakerSnake/pyRockBlock

[ Schedule a fsck at next reboot ]
sudo touch /forcefsck

 

 

Easy path to running embedded Python on a RaspberryPi