Note: This is a work in progress.
The goal of this tutorial is to equip the reader with a collection of hardware and software tools for developing low-speed mixed-signal applications.
Content Guide: This tutorial includes complete written instructions, a video guide, and a slide deck that can be used for delivering as a hands-on workshop.
What exactly does “Low Speed” mean? In the context of this tutorial, it means that timing is not very critical. Signals are either completely static or moving slowly such that it doesn't matter if the instant that an ADC samples the signal wiggles around a bit relative to the previous sampling. While clock jitter is one source of this uncertainty, software delays (such as the time between a timer interrupt and the assertion of a “convert” edge) will likely be dominant. Important parameters in low-speed applications are offset, gain error, linearity, and temperature drift. “Noise” in a low-speed application is typically synonymous with resolution, and is typically measured by applying a noiseless input signal and taking a histogram of the output readings. AC performance metrics such as signal to noise ratio and total harmonic distortion extracted from a Fourier transform of the data will not be considered.
In contrast - sample jitter is important in a “high speed” application. If you are measuring signal to noise ratio, the Signal to Noise ratio (SNR) can be no greater than:
is the analog input frequency in Hz
is the RMS jitter in seconds RMS
So that's it. In this tutorial, we will set voltages and currents, read voltages and currents, do some basic math, but each reading will be treated independently, no correlation to previous or future readings. We will NOT be measuring AC Signal to Noise Ratio (SNR), Total Harmonic Distortion (THD), nor measuring steps, wiggles, or any other situation where precise timing is required. (Rest assured, there are lots of very interesting applications in this category.)
Throughout the exercises we'll be writing simple Python code to capture and analyze data, using the industry standard Industrial I/O (IIO) framework to interact with the ADC, and the popular NumPy and Matplotlib Python libraries. Thus this exercise also serves as a mini-tutorial on Python.
git clone https://github.com/analogdevicesinc/pyadi-iio.git
This tutorial builds on the concepts covered in:
Converter Connectivity Tutorial
It also serves as a preview to this tutorial that starts to deal with analyzing time series data:
Precision ADC Tutorial
Since this tutorial is also designed to be presented as a live, hands-on workshop, a slide deck is provided here:
A complete video run-through is also provided, either as a companion to following the tutorial yourself, or to practice before presenting as a hands-on workshop:
This video is accurate, but will be re-done at some point:
(Translate slide deck and video into complete written instructions with photos, diagrams, etc.)
The Raspberry Pi-based hardware and Linux setup mirrors that of the ADXL345 used in the Converter Connectivity Toolbox and Tutorial, including bringing up the pyadi-iio example. Follow the instructions for downloading and installing ADI Kuiper Linux, and editing config.txt. The only difference is the interrupt connection and device tree overlay to be added to config.txt. For this exercise, add the following line to config.txt:
…but I'm Confused… No-OS means no Operating System, but we're using Kuiper Linux, and that's an Operating System. What gives?
Unlike the IIO drivers used in the previous tutorial , which require the Linux kernel and operating system to function, No-OS provides a portable software stack which can run on any platform that supports a C compiler. This could be bare metal microcontrollers, truly running without an operating system, up through full systems like our Kuiper Linux running on a Raspberry Pi. The No-OS repository includes existing support for the Linux OS, Real-Time Operating Systems Chibios, and mbed, Raspberry Pico, as well as hardware support for Maxim/ADI, STM32, Xilinx and Altera.
But why? Well, bringing up a toolchain for a particular embedded processor has its own set of challenges - particularly if development will begin on a standard development platform, then be ported to a custom board. Runnin no-OS code on Linux provides a way to get started on the embedded code development, before actually embedding.
A full treatment of this flow is beyond the scope of this tutorial, but will be documented in a future tutorial.
Port the Fred in the Shed curve tracer to no-OS on Linux.