46 March 2018
By Ed Andrews WA9UQN
n Part 1, we described the background and hardware build of the Arduino
Graphics Interface (AGI). With this platform, you can turn an analog oscilloscope
into a very high resolution graphics display device. This time, we’ll complete the
project by describing the details of the XYscope: the software libraries and sample
code that make the AGI hardware easy to use and integrate into any graphics
Turning an Arduino Due into a Vector Graphics Display
Part 2: Software Concepts and Support Library I
X-Y Point Plotting
Early computer driven graphics display
terminals featured large screen Cathode Ray
Tubes (CRTs). These displays were essentially “
up-sized oscilloscopes” whose X-Y beam deflection
was driven by a computer. An application
program would generate a list of XY coordinates
for plotting, and a special interface would then
convert the list into voltages for plotting onto a
As shown in Figure 1, the AGI system uses
this same approach to plot graphics onto the face
of an analog oscilloscope.
To briefly recap, AGI uses the two Digital-to-Analog Converters (DAC) found on an Arduino
Due CPU board to generate an X voltage and Y
voltage to drive an analog oscilloscope. These
voltages drive the electron beam inside the scope
CRT to specific locations on the screen. After the
beam has settled into position, the AGI sends
a short “unblank pulse” to the scope Z axis input which
The AGI Coordinate System
Data for plotting to the screen is held in the XYscope
XY_List array. The XY_List array consists of pairs of 12-bit
unsigned integers that correspond to specific physical
locations on the face of the CRT screen.
The AGI coordinate system is depicted in Figure 2.
Here, it is seen that the lower left-hand corner of the
display is plotted when X,Y = (0,0). Similarly, the upper
right-hand corner is plotted when X,Y = (4095,4095).
More complex graphics such as lines, arcs, circles,
and text are created by plotting a series of closely spaced
points. The job of the application code (a.k.a., your
program) is to fill an integer data array with the complete
list of XY point pairs needed to fully define the graphics
image to be displayed.
Getting XY Data Out to the Scope
As an example, let’s say we’re using a single array to
hold all the X-Y points we want to plot. In the EVEN array
locations (0, 2, 4, …), we’ll put the X values; then, we’ll
store the Y values into the ODD array locations (1, 3, 5, …).
Once we’ve loaded the points into our XY_List array,
we could use programmed I/O commands to send the
FIGURE 1. Connecting the AGI to an analog oscilloscope.