An Arduino Due oscilloscope needs to collect samples fast enough to make an audio waveform worth looking at. In his Hackaday.io project, Bruce Land reports increasing acquisition from about 13,000 to 688,000 samples per second by replacing Arduino library calls with direct access to the analog-to-digital converter’s registers. The change targets the sampling loop, not the whole application.
Created on March 11, 2014, this is an older project with a still-useful lesson: a convenient interface can hide performance that becomes available when the critical part of a program talks directly to the hardware.
A short loop does the acquisition work
Land’s published loop collects 320 samples. It starts a conversion, waits for the ADC’s data-ready flag, reads the result, and starts the next conversion. Each result is masked to retain its low 12 bits before being stored in an array.
The register definitions use volatile memory accesses, and the loop polls the status register directly. There’s no DMA transfer in the shown implementation, nor an interrupt handler collecting the samples. The processor waits for each result and moves it into memory itself.
Land says the 688,000-sample-per-second figure includes loop overhead. Compared with his stated library rate of roughly 13,000 samples per second, that’s about a 53-fold increase. At the faster rate, a 320-sample capture spans approximately 0.47 milliseconds.
That last number helps put the headline in context. This is a fast, short acquisition block; it doesn’t establish how quickly the complete instrument can acquire, redraw its screen, and begin again. Sampling rate and screen refresh rate are different measurements.
Keep the display library, bypass the bottleneck
The scope uses a TFT display with the Adafruit TFTLCD library. Land documents the control and data pin connections and notes that the library’s shield-pinout option must be commented out for his wiring. He also describes a small revision that displays the frequency of a periodic input once per second.
The division of labor matters more than the particular pin map. The display code can retain its library support while the acquisition loop takes a lower-level route. In a November 29, 2015 reply, Land explicitly clarified that he had bypassed the library only in the Due’s critical loop—not abandoned the Arduino programming environment.
That separation also makes display changes easier to reason about. When someone asked about using a 128×64 OLED in February 2017, Land replied that only the display side needed modification, provided it could draw points. That was porting advice, not a documented OLED version, but it identifies a useful boundary: collecting samples and drawing them needn’t be the same piece of code.
Faster capture leaves other limits to solve
The visible discussion raises two natural extensions. One commenter suggested servicing the ADC with DMA to push performance further. Others wanted to send captured data to a computer. Land suggested using the UART, but the supplied material doesn’t demonstrate continuous PC transfer at the headline sampling rate. Capturing a block into memory and transporting every sample onward are separate jobs, with separate throughput limits.
There’s also a distinction between a fast ADC demonstration and a versatile bench instrument. In a June 2016 reply, Land described drift as minimal and claimed accuracy comparable to a bench scope over the limited input range, while acknowledging that matching its flexibility would require much more work. That’s his assessment; the overview supplies no calibration measurements or documented protected input stage to establish a general-purpose measurement capability.
The strongest takeaway is therefore specific and reproducible in spirit: optimize the acquisition path without rewriting everything around it. For a next revision, the useful measurements would be capture-to-capture timing and sustained output throughput—not just another increase in the ADC loop’s sample count.