Multi-channel data acquisition firmware for the DAQiFi Nyquist device family, built on PIC32MZ2048EFM144 with FreeRTOS.
- 16 analog input channels (12-bit MC12bADC, optional 18-bit AD7609)
- 8 analog output channels (12-bit DAC7718, NQ3 variant)
- 16 digital I/O channels with interrupt-driven capture
- USB CDC streaming up to 1 MB/s
- WiFi streaming via WINC1500 (TCP, 2.4 GHz)
- SD card logging with FAT32, automatic file splitting
- Protocol Buffers, CSV, and JSON encoding formats
- SCPI command interface (IEEE 488.2 compliant)
- Auto-balanced DMA buffers across active interfaces
- Runtime-configurable streaming, logging, and memory
| Variant | ADC | DAC | Description |
|---|---|---|---|
| NQ1 | MC12bADC (12-bit) | — | Basic |
| NQ2 | AD7173 (24-bit) | — | Enhanced |
| NQ3 | AD7609 (18-bit) | DAC7718 (12-bit) | Full-featured |
- MPLAB X IDE v6.25+
- XC32 Compiler v4.60
- Harmony Configurator (MHC) for code generation
- PICkit 4 programmer (or compatible)
- Open
firmware/daqifi.Xproject - Select configuration: default (NQ1), Nq1, or Nq3
- Build (F11)
cd firmware/daqifi.X
# Build default (NQ1) configuration
"/mnt/c/Program Files/Microchip/MPLABX/v6.30/gnuBins/GnuWin32/bin/make.exe" \
-f nbproject/Makefile-default.mk CONF=default build -j4
# Output: dist/default/production/daqifi.X.production.hexInclude old_hv2_bootld.ld linker script in Project Properties, then flash bootloader first (bootloader/firmware/usb_bootloader.X), followed by firmware via the Windows DAQiFi application.
"/mnt/c/Program Files/Microchip/MPLABX/v6.30/mplab_platform/mplab_ipe/ipecmd.exe" \
-TPPK4 -P32MZ2048EFM144 -M \
-F"dist/default/production/daqifi.X.production.hex" -OL- Hold the user button for ~20 seconds until board resets
- Release button when LEDs light solid
- Hold button again until white LED blinks to enter bootloader mode
Zero-leak ceilings measured with FastReader (1ms host polling), fullscale test pattern:
| Config | USB | SD | WiFi |
|---|---|---|---|
| PB 1ch | 13 kHz | 12 kHz | 5 kHz |
| PB 8ch | 9 kHz | 7 kHz | 3 kHz |
| PB 16ch | 5.5 kHz | 4.5 kHz | 3 kHz |
| CSV 1ch | 15 kHz | 11 kHz | 5 kHz |
| CSV 8ch | 7 kHz | 3.5 kHz | 1 kHz |
| CSV 16ch | 4 kHz / 1 MB/s | 2 kHz / 519 KB/s | 1 kHz / 262 KB/s |
Pipeline mode (skip ADC) achieves 2-3x higher throughput — see benchmark results.
| Region | Size | Purpose |
|---|---|---|
| Streaming Pool | 194 KB | USB/WiFi/SD circular buffers, encoder, sample pool |
| Coherent Pool | 124 KB | SD/USB/WiFi DMA write buffers (auto-balanced) |
| FreeRTOS Heap | 75 KB | Task stacks, queues, mutexes |
All DMA buffers are auto-balanced at each stream start based on active interfaces. No manual tuning required.
Full command reference: SCPI Interface Wiki
Common commands:
*IDN? # Device identification
SYST:POW:STAT 1 # Power up
SYST:StartStreamData 1000 # Start streaming at 1kHz
SYST:StopStreamData # Stop streaming
SYST:STR:STATS? # Streaming statistics
SYST:MEM:FREE? # Memory diagnostics
SYST:LOG? # Retrieve log messages
See daqifi-python-test-suite for comprehensive test scripts and benchmarks.
Critical: USB CDC streaming requires the host to read at >= 1ms intervals. Use FastReader from test_harness.py. See test suite README.
firmware/
daqifi.X/ # MPLAB X project
src/
HAL/ # Hardware abstraction (ADC, DAC, DIO, Power, UI)
services/ # Communication (USB CDC, WiFi, SD, SCPI, streaming)
state/ # Board configuration, runtime config, data structures
Util/ # Pools, buffers, logging, formatters
config/default/ # Harmony-generated drivers and configuration
bootloader/ # USB bootloader project
| Repository | Description |
|---|---|
| daqifi-python-core | Python API library |
| daqifi-python-test-suite | Test scripts and benchmarks |
| daqifi-core | .NET library |
| daqifi-desktop | Windows desktop application |