fx2adc: Using USB oscilloscopes as general purpose ADC ====================================================== :author: Steve Markgraf :copyright: 2024 by Steve Markgraf (License: CC-BY-SA) :backend: slidy :max-width: 45em == Motivation [role=""] * Wanted to use vhsdecode (software defined VHS decoder) image::hantek_black_snr.png[width="55%"] https://github.com/oyvindln/vhs-decode == Typical vhshdecode hardware * Common hardware used are two clock-synchronized 'cxadc' cards * Video capture cards based on CX2388x that can be used as general purpose ADC ** need PCI/PCIe-port * 2x 40 MSPS @ 8 bit (FM audio, Video signal) image::raspi_cx_crop.jpg[width="70%"] * Mine hadn't arrived yet... == Hantek PSO2020 image::pso2020.jpg[width="100%"] == FX2 oscilloscope block diagram [role=""] image::usb_scope_block_diagram.svg[width="90%"] == FX2 oscilloscope PCB [role=""] image::Hantek_6022bl_pcb_top.jpg[width="90%"] [small]#Source: https://sigrok.org/wiki/File:Hantek_6022bl_pcb_top.jpg# == USB oscilloscopes [role=""] Supported oscilloscopes: * Hantek 6022BE * Hantek 6022BL * Hantek PSO2020 * Instrustar ISDS205A * SainSmart DDS120 * YiXingDianZi MDSO * LHT00SU1 == FX2 GPIF [role=""] ADC is connected via GPIF (General Purpose Interface): * two 8 bit ports can be either used as 8 or 16 bit port * limitation for 2 channel scopes * either stream CH1 or CH1 + CH2 * CH2 alone with full sample rate not posible! == FX2 GPIF clock modes [role=""] As a main clock for the interface you can select: * 30 MHz * 48 MHz (too fast for HS USB 2.0!) * or add delay cycles * IFCLK input == Clock modification [role=""] image::pso2020_clockmod.jpg[width="100%"] == Sigrok [role=""] * FX2-based oscilloscopes are supported by Sigrok * Use that to capture data stream? ** This specific model was not supported yet by fx2lafw => added that ** libsigrok only uses a single USB transfer for FX2 scopes... image::sigrok.png[width="100%"] == libfx2adc * Small library that loads (patched) fx2lafw and streams from the device * Voltage divider (input gain) can be specified via commandline argument * Checks if Si5351 is present, can use that to generate clock * Uses AC coupling if present * Usual rtl-sdr like tools: ** fx2adc_file ** fx2adc_tcp ** fx2adc_test == VHS RF tap with USB oscilloscope image::hantek_vhs.jpg[width="100%"] == VHS RF spectrum image::hantek_spectrum.png[width="65%"] == fx2adc + R820T [role=""] image::hantek_r820t.png[width="68%"] == FX2-based logic analyzer with analog input image::T100-b-v1.2.jpg[width="75%"] * All chinese components, ~24 USD * Unfortunately ADC is connected to second 8 bit port, so 16 MSPS max == Listening to DAB with LHT00SU1 + R820T image::dab_lht00su1_crop.png[width="55%"] == Summary FX2-based oscilloscopes can be used for: * extending bandwidth of rtl-sdr sticks * direct sampling HF receiver (add some external LPF, amp) * vhsdecode * maybe scopehal + ngscopeclient? However: * need HW modification to get maximum sample rate * more than one device connected to a single host don't work with 40 MSPS ** seems to be a limitation of USB 2.0 host controllers.. == Can you spot the difference? image::hantek_6022_fx2_adc.jpg[width="70%"] == Can you spot the difference? image::pso2020_fx2_adc.jpg[width="90%"] == EOF * More information: * https://github.com/steve-m/fx2adc Other resources: * https://sigrok.org/wiki/Supported_hardware#Oscilloscopes * https://sigrok.org/wiki/Fx2lafw * https://github.com/oyvindln/vhs-decode * https://github.com/happycube/cxadc-linux3 * https://gitlab.com/jorgem-dev/cx88_sdr {empty} + {empty} + {empty} + {empty} + * Questions?