the whole list has been fully transferred. When we get this
interrupt, a short interrupt service routine turns the CRT
BEAM “off” (blank the Z axis) so we don’t just sit there and
brightly show the last point plotted.
your code at the element index, for example, you reference
the “X” value as XYscope.XY_List.X[index], and the “Y” value
as XYscope.XY_List. Y[index].
Plotting Points the Easy Way
Defining and Loading the XY_List
Array with Coordinates for Plotting
To make it easy, the XYscope library includes a
plotPoint routine that works like this:
The AGI software package uses C++ constructs to
define a data structure to hold all the XY coordinate point
pairs. The following lines of code (as found in library file
XYscope.h) shows how the data structure is defined and
the XY_List declared:
plotPoint(X,Y) automatically manages the XY_List
array, DAC_ID codes, and the array index pointer for you.
Other routines that draw lines, arcs, text, and other graphic
primitives are also provided to make ‘plotting’ quick and
In the Arduino Due world, the short variable type
specifies a 16-bit signed integer. The lower 12 bits of the
integer hold the coordinate value we want to plot while the
upper four bits hold a DAC_ID code. The DAC_ID is read
out of the XY_List data during the DMA transfer, and used
by the DMA controller to direct the data to DAC0 (DAC_
In the above example, you also see calls to plotStart
() and plotEnd (). These two routines — along with a
few others — make up the group of setup and data
management routines that the AGI uses.
ID=0, X axis) or DAC1 (DAC_ID=1, Y axis).
The AGI libraries and CRT_SCOPE sample code set was
developed and tested using the Arduino IDE (integrated
development environment) version 1.8.2 (download from
If you ever need to access the XY_List array directly in
The basic structure of an Arduino AGI program is in
Figure 4. This figure shows an overview of
the libraries and unique interrupt links you
must provide to get the AGI system up and
Library Links (#includes) - First off,
you must include the needed timer and
XYscope libraries (Note: You must install
these libraries into the IDE on your PC/
Mac!) Of course, your code will likely have
additional “include” statements for the
other libraries you are using.
Interrupt Routines - To properly link
the XYscope functions to the interrupt
system, the DACC... and paintCRT...
routines must be defined as part of your
code as shown.
setup() - Most of the DAC and DMA
controller setup is performed with the
call to XYscope.begin(). Since the CRT
refresh timer-counter cannot be ‘attached’
inside the XYscope library code, this step
must be performed as shown within the
Arduino setup() program segment. You FIGURE 4. The basic AGI software framework.
48 March 2018