Sigrok

From Qi-Hardware
Jump to: navigation, search

Contents

[edit] Install

[edit] Logic analyzer

ARMFLY AX Pro is a Chinese clone of the CWAV USBee AX. supported by sigrok project, this page is using ARMFLY AX Pro or ARMFLY Mini-Logic, both are MAX 24MSPS(in short of Million Samples per Second).

[edit] Samplerate

Samplerate should always be higher then the rate of your signal, at least twice as high usually, the more the better, usage: -d 0:samplerate=4mhz

$ sigrok-cli  -d 0 #list supported samplerates
CWAV USBee AX with 8 probes
Supported triggers: 0 1 
Supported options:
   samplerate - supported samplerates:
     20 kHz
     25 kHz
     50 kHz
     100 kHz
     200 kHz
     250 kHz
     500 kHz
     1 MHz
     2 MHz
     3 MHz
     4 MHz
     6 MHz
     8 MHz
     12 MHz
     16 MHz
     24 MHz

[edit] Decode UART

  • Dump the UART output to sigrok format:
 # sigrok-cli -A uart=hex -d 0:samplerate=4mhz --time 4s -o serial-output.sr --probes 1,2 -a uart:tx=0:rx=1:baudrate=115200
  • Decode the UART output
 # while true; do sleep 1s && echo "hello world" > /dev/ttyATH0 ; done
 # sigrok-cli -i serial-output.sr -a uart:rx=0:tx=1:baudrate=115200,uart_dump -s uart,uart_dump
 Hello World
 Hello World
 ...

[edit] Decode USB

  • Logic analyzer setup
 Probe   Device
 ----------------------
 0           DM (D-)
 1           DP (D+)
  • USB color codes
 PIN       Color
 ----------------------
 VCC       Red     +5 V
 Dāˆ’         White Data āˆ’
 D+         Green Data +
 GND      Black Signal Ground 

Sigrok usb probe.JPG Sigrok usb setup.JPG

  • Sniffing
 # sigrok-cli -d 0:samplerate=24mhz --time 1s -o out.sr --probes 1,2 -a usb:dp=1:dm=0
  • Decoding
# sigrok-cli -i out.sr -a usb:dp=1:dm=0
usb: "BIT STUFF ERROR" 
usb: "RESET" 
usb: "RESET" 
usb: "IN DEV 6 EP 3" "00000001100101100110000110010000" 
usb: "IN DEV 6 EP 3" "00000001100101100110000110010000" 
usb: "IN DEV 6 EP 3" "00000001100101100110000110010000" 
usb: "IN DEV 6 EP 3" "00000001100101100110000110010000" 
usb: "IN DEV 6 EP 3" "00000001100101100110000110010000" 
usb: "SYNC INVALID!" "000000110010110011000011001000" 
usb: "IN DEV 6 EP 3" "00000001100101100110000110010000" 
usb: "IN DEV 6 EP 3" "00000001100101100110000110010000" 
usb: "IN DEV 6 EP 3" "00000001100101100110000110010000"
... ...
  • Using sigrok-gtk open the out.sr file

Sigrok-gtk-atusb.png

  • Low speed device option

For Low speed device we need one more option signalling=low-speed for example

 # sigrok-cli -d 0:samplerate=24mhz --time 1s -o out.sr --probes 1,2 -a usb:dp=1:dm=0:signalling=low-speed

[edit] Forcing a USB host port to full-speed

[edit] Oscilloscope

The Hantek DSO-2090 is an inexpensive USB-based oscilloscope. It has 2 channels, an analog bandwidth of 40MHz and 100MS/s sampling rate. check out more information at sigrok wiki page

[edit] Dump firmware

Dump firmware from Windows driver

# git clone git://sigrok.git.sourceforge.net/gitroot/sigrok/sigrok-util
# cd sigrok-util
# ./hantek-dso-extract.py /media/cdrom/64bitDriver/Dso2090X861.sys 
# sudo cp hantek-dso-2090.fw /usr/local/share/sigrok-firmware/

[edit] Run

Those devices don't sample for a time or # of samples, like an LA, they capture a buffer's full, send it out, then do it all again in other words: frames, so don't use --time or --samples, use --frames. e.g. 1 to capture one frame, send it out, then stop. second, the default is to trigger on CH1, so hook some signal into it or it'll wait forever. for all the other options, do: sigrok-cli -d hantek-dso

# sigrok-cli  --frames 1 -O float
FRAME-BEGIN
CH1: 0.258824
CH2: -0.007843
CH1: 0.258824
CH2: -0.007843
CH1: 0.258824
CH2: -0.007843
......
FRAME-END
Personal tools
Namespaces
Variants
Actions
Navigation
interactive
Toolbox
Print/export