Skip to content

Tronix286/ScopetrexVGA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScopetrexVGA

Proof of concept Pi Pico2 based X-Y oscilloscope with Z (blank) inputs. Allows display the image from the Scopetrex board on a regular VGA (DVI/HDMI) monitor without an analog XY dual-beam oscilloscope or vector monitor.

Current status: it's working but not ideal but it's better than nothing.

Hardware

Pico 2 was chosen due to its improved ADC performance compared to the first Pico, as well as the larger amount of memory required for storing samples and a second framebuffer.

Analog input stage

The Scoptrex board outputs X/Y signal levels from -5 volts to +5 volts, so a small hardware analog frontend is needed to convert the levels to acceptable Pi Pico voltages from 0 to 3.3 volts. I used the design almost unchanged from the project scoppy , specifically this hardware design: fhdm-dev/scoppy#63 XY_input The Z output from the Scopetrex board has a maximum signal swing of about 3 volts, so I risked connecting it directly to the Pico. This may be incorrect, and a quad op amp like the MCP6004 should be used to prevent possible damage to the Pico input.

Summary:

  • X output from Scopetrex connect over analog front-end to GPIO 26 PiPico2 (ADC0);
  • Y output from Scopetrex connect over analog front-end to GPIO 27 PiPico2 (ADC1);
  • Z output from Scopetrex connect over 100 ohm resistor to GPIO 28 PiPico2 (ADC2);
  • The X and Y outputs should be connected to the front-end board with a shielded (coax) cable. The outputs after the op-amp before the Pico board should also be shielded and as short as possible. The shield is connected to the Pico board's analog ground (AGND).
  • To power the op amp, I used my own 1117 3.3V LDO regulator with a 0.1uf filter capacitor before and after it to reduce power supply noise. Although the difference might not be as significant if you're using power directly from the Pi Pico board's 3V3(OUT) pin.

Example of my front-end prototyping board:

VGA output stage

For display image i am using DispHSTX VGA/DVI RP2350 library from Miroslav Nemecek, so schematic wiring diagram is exactly the same as shown on DispHSTX web site:

Currently i am using VGA connection and VGA monitor but nothing prevents using a connection via DVI/HDMI (except for a small config.h firmware edit).

Software basics

Pico 2 a little overclocked by DispHSTX library (using vmodetime_640x350_fast, _fast meaning SYS_CLK = 252MHz). ADC_CLK running at ~125MHz, configured as continuous ADC channel sampling (4 channel) with two chained DMA channel that transfer from the ADC FIFO to the respective buffer and the ring wraping causes each one to start on each cycle at the beginning of its write buffer as described here. Channel 4 of the ADC is empty and is needed to align the DMA buffers. So, ADC sampling at: 125000000/96/4=325520 Hz. Perhaps you only need to sample three channels, then the speed will be around 125000000/96/3 = 434 kHz, but you will need to programmatically handle the transition from one capture buffer to another to update X-Y-Z data. If either of the two buffers is filled with data, the interrupt sets the new_data flag, indicating to the main loop that it can draw points from the buffer onto the screen. ADC capture buffers format is X,Y,Z,Empty;X,Y,Z,Empty and so on. In main loop we waiting new_data flag then plot dots from capture_buffer to the backbuffer named Box. Then apply some blur to Box backbuffer and copy its contents to framebuffer. Thats all.

About

Pi Pico2 based X-Y oscilloscope with Z (blank) inputs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published