Live demo — data resets daily at 03:00 UTC. Nothing you enter is saved. Server UI →

ESH10000535 - Sparrow N-TOP Module

Overview

The ESH10000535 is the top-level control module for Sparrow-series test systems, providing precision analog measurement with programmable gain amplifiers, dual PWM/Tachometer control, calibration management, and LED status indication for compact test applications.

Description

The Sparrow N-TOP module serves as a sophisticated measurement and control hub featuring dual AD5592R multi-function I/O devices with programmable gain amplifiers (PGAs) for precision voltage measurement. The module supports 8 high-resolution ADC channels with automatic gain ranging, dual PWM output with tachometer feedback, UART communication, and visual LED status indication through an integrated RGB LED driver.

Key Features:

  • 8-Channel Precision ADC with PGA: High-accuracy voltage measurement

    • 8 measurement channels (ADC_CH1 through ADC_CH8)
    • Programmable Gain Amplifier with 8 gain settings (1/8× to 16×)
    • Auto-ranging capability with hysteresis
    • Per-channel, per-gain calibration
    • 12-bit resolution (AD5592R)
    • 0-5V double range mode
  • 12 Multi-Purpose I/O Channels: Bidirectional analog I/O

    • MPIO00-MPIO11: Configurable analog input/output
    • 12-bit ADC/DAC resolution
    • Supports analog and pseudo-digital modes
    • Individual gain and offset calibration
  • Dual PWM/Tachometer Control: Precision frequency generation and measurement

    • 2× PWM outputs with frequency and duty cycle control
    • 2× Tachometer inputs for frequency measurement
    • Dedicated voltage references (PWM_VSET, TACH_VSET)
    • Microcontroller-based generation (MCU firmware)
  • Advanced Calibration System: Per-channel, per-gain calibration storage

    • Persistent calibration by product ID, revision, serial number
    • 8 gain factors per ADC channel (64 calibration points total)
    • Automatic offset compensation per gain setting
    • Calibration channel for user access and modification
  • LED Status Indication: Visual feedback system

    • 4× RGB LEDs (ANALOG_CONN, STATUS_1, STATUS_2, STATUS_3)
    • Configurable luminance and color
    • LP5012 LED driver with PWM control
  • Communication Interfaces: UART and SPI protocol support

    • UART: RS232, configurable baudrate (default 9600)
    • SPI: High-speed communication (6 MHz)
    • Protocol enable/disable control

Hardware Details

Analog-to-Digital Converters:

  • Chip: Analog Devices AD5592R (2 devices)
  • Channels:
    • ADC1: 8 analog I/O channels (MPIO00-MPIO07)
    • ADC2: 6 analog I/O channels (2 internal ADC, MPIO08-MPIO11, PWM_VSET, TACH_VSET)
  • Resolution: 12-bit ADC/DAC
  • Communication: SPI bus @ 6 MHz
  • SPI Chip Select:
    • ADC1: CS0
    • ADC2: CS1
  • Voltage Range: 0-5V (double ADC/DAC range mode enabled)
  • Features:
    • DoubleAdcRange: true
    • DoubleDacRange: true
    • ReadTemperature: false

Programmable Gain Amplifiers:

  • Type: External PGA with GPIO-controlled gain selection
  • Channels: 2 PGA paths (PGA1 for CH1-4, PGA2 for CH5-8)
  • Gain Settings: 8 selectable gains
    • G_1_8: 1/8× (8.0 actual gain multiplier)
    • G_1_4: 1/4× (4.0 actual gain multiplier)
    • G_1_2: 1/2× (2.0 actual gain multiplier)
    • G_1: 1× (1.0 actual gain multiplier)
    • G_2: 2× (0.5 actual gain multiplier)
    • G_4: 4× (0.25 actual gain multiplier)
    • G_8: 8× (0.125 actual gain multiplier)
    • G_16: 16× (0.0625 actual gain multiplier)
  • Control: 3-bit GPIO per PGA (G0, G1, G2)
  • Calibration Multiplexer: 4 calibration modes per PGA
    • GND_GND: Both inputs grounded
    • GND_VREF: Ground to reference voltage
    • VREF_GND: Reference voltage to ground
    • INn_INp: Normal measurement mode

GPIO Expander:

  • Chip: NXP PI4IOE5V6416
  • I²C Address: 0x20
  • Channels: 16 digital I/O (2 ports × 8 pins)
  • Purpose: PGA gain control, calibration mux, protocol enable, programming control
  • Communication: I²C bus
  • Signals:
    • UART_ENn, SPI_ENn: Protocol enable (active-low)
    • UPDI_PGM: Microcontroller programming enable
    • SW0_PGA1, SW1_PGA1, SWEN_PGA1: PGA1 calibration mux
    • SW0_PGA2, SW1_PGA2, SWEN_PGA2: PGA2 calibration mux
    • G0_CH1, G1_CH1, G2_CH1: Channel 1-4 gain select
    • G0_CH2, G1_CH2, G2_CH2: Channel 5-8 gain select
    • RESETn: Global reset (active-low)

LED Driver:

  • Chip: TI LP5012 RGB LED driver
  • I²C Address: 0x14
  • Channels: 12 (4 LEDs × 3 RGB)
  • LEDs: ANALOG_CONN, STATUS_1, STATUS_2, STATUS_3
  • Control: PWM-based intensity (0-255 per color)
  • Default Luminance: 0.7 (70% brightness)
  • Communication: I²C bus

PWM/Tachometer Controller:

  • Chip: Microcontroller with PWM/Tach firmware
  • I²C Address: 0x30
  • Channels: 2 PWM outputs, 2 Tachometer inputs
  • Features:
    • Frequency control (Hz)
    • Duty cycle control (0.0-1.0)
    • Enable/disable per channel
    • Frequency measurement (tachometer)
    • Firmware revision reporting
  • Communication: I²C bus

Channel Naming Convention

All channels follow the naming pattern: {ModuleIndex}.ESH10000535.{ChannelName}

Where:

  • {ModuleIndex} is the position of the module in the system (e.g., 0, 1, 2...)
  • ESH10000535 is the module type identifier
  • {ChannelName} is the specific channel name from the table below

Example: Module at position 0, ADC channel 1 would be: 0.ESH10000535.ADC_CH1

User-Accessible Channels

Channel Name Type Direction Usage Description
Precision ADC Channels (with PGA)
ADC_CH1 Analog IN UserAllocatable Precision ADC channel 1 (PGA1, gain-selectable)
ADC_CH2 Analog IN UserAllocatable Precision ADC channel 2 (PGA1, gain-selectable)
ADC_CH3 Analog IN UserAllocatable Precision ADC channel 3 (PGA1, gain-selectable)
ADC_CH4 Analog IN UserAllocatable Precision ADC channel 4 (PGA1, gain-selectable)
ADC_CH5 Analog IN UserAllocatable Precision ADC channel 5 (PGA2, gain-selectable)
ADC_CH6 Analog IN UserAllocatable Precision ADC channel 6 (PGA2, gain-selectable)
ADC_CH7 Analog IN UserAllocatable Precision ADC channel 7 (PGA2, gain-selectable)
ADC_CH8 Analog IN UserAllocatable Precision ADC channel 8 (PGA2, gain-selectable)
Multi-Purpose I/O Channels
MPIO00-MPIO07 Analog IN/OUT UserAllocatable Multi-purpose I/O 00-07 (ADC1, 12-bit, 0-5V)
MPIO08-MPIO11 Analog IN/OUT UserAllocatable Multi-purpose I/O 08-11 (ADC2, 12-bit, 0-5V)
PWM_VSET Analog OUT UserAllocatable PWM reference voltage output (0-5V, 2× gain)
TACH_VSET Analog OUT UserAllocatable Tachometer reference voltage output (0-5V, 2× gain)
PWM/Tachometer Channels (if PWM device detected at 0x30)
PWM1_ACTUAL_FREQ Frequency IN UserAllocatable Actual frequency of PWM1 output (Hz)
PWM1_REQ_FREQ Frequency OUT UserAllocatable Requested frequency for PWM1 (Hz)
PWM1_DUTY_CYCLE Ratiometric OUT UserAllocatable PWM1 duty cycle (0.0-1.0)
PWM1_ENABLE Digital OUT UserAllocatable Enable PWM1 output (true=enabled)
PWM2_ACTUAL_FREQ Frequency IN UserAllocatable Actual frequency of PWM2 output (Hz)
PWM2_REQ_FREQ Frequency OUT UserAllocatable Requested frequency for PWM2 (Hz)
PWM2_DUTY_CYCLE Ratiometric OUT UserAllocatable PWM2 duty cycle (0.0-1.0)
PWM2_ENABLE Digital OUT UserAllocatable Enable PWM2 output (true=enabled)
TACH1_ACTUAL_FREQ Frequency IN UserAllocatable Measured frequency of TACHO1 input (Hz)
TACH2_ACTUAL_FREQ Frequency IN UserAllocatable Measured frequency of TACHO2 input (Hz)
PWMTACH_FW_REVISION Register IN UserAllocatable Firmware revision of PWM/TACH controller
Configuration Channels
AutoRange Digital OUT UserAllocatable Enable auto-ranging for ADC channels (true=enabled, reduces performance)
GainMux Multiplexer OUT UserAllocatable Select ADC gain setting (G_1_8, G_1_4, G_1_2, G_1, G_2, G_4, G_8, G_16)
PROG_EN Digital OUT UserAllocatable Enable microcontroller programming mode (true=programming enabled)
Communication Channels
UART UART IN/OUT UserAllocatable UART communication (RS232, 9600 baud, /dev/serial0)
Calibration & Administration
NumericResult NumericResult IN UserAllocatable High-speed multi-sample acquisition on analog channels
PERFORM_CAL Digital OUT UserAllocatable Trigger ADC calibration sequence (write true to calibrate)
STORE_CAL Register OUT UserAllocatable Store calibration to persistent storage (password protected)
CALIBRATION Calibration N/A UserAllocatable Calibration table (per-channel, per-gain factors)

Total User Channels:

  • Without PWM device: 28 channels (8 ADC_CH + 12 MPIO + 2 voltage outputs + 1 numeric result + 3 config + 1 UART + 1 calibration)
  • With PWM device: 39 channels (28 + 11 PWM/Tach channels)

Note: PWM/Tachometer channels are only created if a PWM device is detected at I²C address 0x30 during module initialization.

Internal Channels (Not User-Accessible)

The following channels are used for internal system control and are hidden from users:

  • ADC Channels (all HiddenSystemControl):
    • ADC1, ADC2: Internal ADC measurement channels for PGA readings
  • LED RGB Channels (all HiddenSystemControl):
    • ANALOG_CONN_R, ANALOG_CONN_G, ANALOG_CONN_B
    • STATUS_1_R, STATUS_1_G, STATUS_1_B
    • STATUS_2_R, STATUS_2_G, STATUS_2_B
    • STATUS_3_R, STATUS_3_G, STATUS_3_B

Channel Configuration

MPIO Analog Configuration

Configure MPIO channels as analog inputs or outputs:

ConfigureChannels(new[] {
    new AnalogChannel {
        NetName = "0.ESH10000535.MPIO00",
        Enabled = true,
        Direction = DirectionTypes.IN,
        Gain = 1.0,
        Offset = 0.0,
        Resolution = 12
    }
});

// Read analog input
string[] voltage = GetValues(new[] { "0.ESH10000535.MPIO00" });
Console.WriteLine($"MPIO00: {voltage[0]}V");

Precision ADC with Gain Selection

Measure voltages with programmable gain:

// Set gain to 8× for measuring small signals
SetValues(
    new[] { "0.ESH10000535.GainMux" },
    new[] { "G_8" }  // 8× amplification
);

// Read ADC channel (1000 samples averaged)
string[] measurement = GetValues(new[] { "0.ESH10000535.ADC_CH1" });
double voltageV = double.Parse(measurement[0]);
Console.WriteLine($"Measured: {voltageV}V (with 8× gain)");

Auto-Ranging Mode

Enable automatic gain selection for optimal resolution:

// Enable auto-ranging
SetValues(
    new[] { "0.ESH10000535.AutoRange" },
    new[] { "true" }  // Automatic gain adjustment
);

// Read with auto-ranging (slower but optimal resolution)
string[] autoMeasurement = GetValues(new[] { "0.ESH10000535.ADC_CH2" });
Console.WriteLine($"Auto-ranged measurement: {autoMeasurement[0]}V");

Auto-Ranging Behavior:

  • Automatically adjusts gain to keep signal within optimal ADC range
  • Uses hysteresis to prevent oscillation between gain settings
  • Changes gain by at most one step per measurement
  • Upper thresholds: [30, 25, 10, 5, 2, 1, 0.2, 0.1] V (prevents clipping)
  • Lower thresholds: [25, 10, 5, 2, 1, 0.2, 0.1, 0.01] V (improves resolution)
  • Performance impact: Reduces measurement speed due to gain switching and re-sampling

PWM Configuration (if device available)

Generate PWM signals with configurable frequency and duty cycle:

// Configure PWM1 for 1kHz at 50% duty cycle
SetValues(
    new[] {
        "0.ESH10000535.PWM1_REQ_FREQ",
        "0.ESH10000535.PWM1_DUTY_CYCLE",
        "0.ESH10000535.PWM1_ENABLE"
    },
    new[] {
        "1000",   // 1000 Hz
        "0.5",    // 50% duty cycle
        "true"    // Enable output
    }
);

// Read actual frequency
string[] actualFreq = GetValues(new[] { "0.ESH10000535.PWM1_ACTUAL_FREQ" });
Console.WriteLine($"PWM1 actual frequency: {actualFreq[0]} Hz");

Tachometer Measurement

Measure frequency of external signals:

// Set tachometer reference voltage
SetValues(
    new[] { "0.ESH10000535.TACH_VSET" },
    new[] { "3.3" }  // 3.3V reference for logic level
);

// Read tachometer frequency
string[] tachFreq = GetValues(new[] { 
    "0.ESH10000535.TACH1_ACTUAL_FREQ",
    "0.ESH10000535.TACH2_ACTUAL_FREQ"
});
Console.WriteLine($"TACH1: {tachFreq[0]} Hz");
Console.WriteLine($"TACH2: {tachFreq[1]} Hz");

Programming Interface

Measure with Fixed Gain:

// Set specific gain
SetValues(
    new[] { 
        "0.ESH10000535.GainMux",
        "0.ESH10000535.AutoRange"
    },
    new[] { 
        "G_1",     // Unity gain
        "false"    // Disable auto-range
    }
);

// Read ADC channels
string[] values = GetValues(new[] {
    "0.ESH10000535.ADC_CH1",
    "0.ESH10000535.ADC_CH2",
    "0.ESH10000535.ADC_CH3"
});

foreach (var val in values)
{
    Console.WriteLine($"Measurement: {val}V");
}

Multi-Channel Acquisition with Numeric Results:

// Configure numeric result channel for high-speed acquisition
ConfigureChannels(new[] {
    new NumericResultChannel {
        NetName = "0.ESH10000535.NumericResult",
        Enabled = true,
        NumberOfSamples = 10000,
        SampleRate = 10000,  // 10 kHz sampling
        TargetNetName = "0.ESH10000535.ADC_CH1",
        ReducedSet = true,   // Get statistics
        MultiChannel = false
    }
});

// Acquire data
string[] result = GetValues(new[] { "0.ESH10000535.NumericResult" });
List<NumericResult> data = NumericResult.FromBase64(result[0]);

// Process statistics
foreach (var channel in data)
{
    Console.WriteLine($"{channel.NetName}:");
    Console.WriteLine($"  Mean: {channel.Mean:F6}V");
    Console.WriteLine($"  Min: {channel.Min:F6}V");
    Console.WriteLine($"  Max: {channel.Max:F6}V");
    Console.WriteLine($"  StdDev: {channel.StdDev:F6}V");
}

UART Communication:

// Configure UART
ConfigureChannels(new[] {
    new UartChannel {
        NetName = "0.ESH10000535.UART",
        Enabled = true,
        Baudrate = 115200,  // Change from default 9600
        BusType = UartBusTypes.RS232
    }
});

// Send command
SetValues(
    new[] { "0.ESH10000535.UART" },
    new[] { "ID?\r\n" }
);

// Read response
Thread.Sleep(100);
string[] response = GetValues(new[] { "0.ESH10000535.UART" });
Console.WriteLine($"Device response: {response[0]}");

Calibration Management:

// Read current calibration table
string[] calData = GetValues(new[] { "0.ESH10000535.CALIBRATION" });
CalibrationTable cal = SerializableHelpers.CreateFromBase64<CalibrationTable>(calData[0]);

// Display calibration for ADC_CH1 at gain G_1
var ch1Cal = cal.CalData.Where(r => r.Key.Contains("ADC_CH1") && r.Tag.ToString() == "G_1");
foreach (var row in ch1Cal)
{
    Console.WriteLine($"{row.Key} @ {row.Tag}: Gain={row.Gain}, Offset={row.Offset}");
}

// Perform calibration (requires known reference voltages)
SetValues(
    new[] { "0.ESH10000535.PERFORM_CAL" },
    new[] { "true" }  // Triggers calibration sequence
);

// Save calibration (password protected)
SetValues(
    new[] { "0.ESH10000535.STORE_CAL" },
    new[] { "ESH10000535" }  // Password = module type name
);

LED Control: Internal LED control is managed automatically:

  • ANALOG_CONN: Indicates analog connection status (Teal when initialized, Red during error)
  • STATUS_1: Green during GetValues operations
  • STATUS_2: Black (off) by default
  • STATUS_3: Black (off) by default, can indicate UART/SPI activity

Programmable Gain Amplifier (PGA) System

The module features a sophisticated gain control system with 8 selectable gain settings:

Gain Settings and Applications:

Gain Setting Amplification Best For Voltage Range Resolution
G_1_8 1/8× (÷8) High voltages Up to 40V ~10 mV
G_1_4 1/4× (÷4) High-moderate voltages Up to 20V ~5 mV
G_1_2 1/2× (÷2) Moderate voltages Up to 10V ~2.5 mV
G_1 1× (unity) Standard voltages 0-5V ~1.2 mV
G_2 Low voltages 0-2.5V ~0.6 mV
G_4 Very low voltages 0-1.25V ~0.3 mV
G_8 Ultra-low voltages 0-625mV ~0.15 mV
G_16 16× Precision low signals 0-312.5mV ~0.075 mV

Gain Control Implementation:

  • Each PGA has 3 GPIO control lines (G0, G1, G2) for 8 combinations
  • PGA1 controls channels ADC_CH1-4
  • PGA2 controls channels ADC_CH5-8
  • Gain applied before ADC conversion (analog domain amplification)
  • Calibration factors stored per-channel, per-gain for maximum accuracy

Calibration System

The module implements a comprehensive per-channel, per-gain calibration system:

Calibration Table Structure:

  • 64 ADC channel calibration entries: 8 channels × 8 gain settings
  • 2 ADC absolute offset entries: ADC1_ABS_OFFSET, ADC2_ABS_OFFSET (per gain)
  • 12 MPIO calibration entries: MPIO00-11 (single gain)
  • 2 voltage output calibration entries: PWM_VSET, TACH_VSET

Calibration Storage:

  • Persistent storage by module identity (ProductID, Revision, SerialNumber)
  • Automatic loading on module Reset()
  • User-accessible via CALIBRATION channel
  • Password-protected save operation (password: "ESH10000535")

Calibration Process:

  1. Automatic Calibration (PERFORM_CAL = true):

    • For each gain setting (G_1_8 through G_16):
      • Route calibration mux to GND_GND mode
      • Acquire 10,000 samples per channel
      • Calculate mean offset error
      • Store offset correction in calibration table
    • Saves calibration to persistent storage automatically
  2. Manual Calibration Adjustment:

    • Read calibration table via CALIBRATION channel
    • Modify gain and offset for specific channels/gains
    • Write updated table back to CALIBRATION channel
    • Call SaveCalibrationValues() via STORE_CAL

Calibration Application:

  • Offset applied before gain multiplication: Result = (ADC_Reading + Offset) × Gain
  • Calibration automatically applied on all measurements
  • Per-gain calibration ensures accuracy across full measurement range

Auto-Ranging Algorithm

The module features intelligent auto-ranging with hysteresis to prevent oscillation:

Algorithm Behavior:

  1. Measure signal with current gain setting
  2. Check if signal exceeds upper threshold for current gain
    • If yes, decrease gain by one step (less amplification)
  3. Check if signal below lower threshold for current gain
    • If yes, increase gain by one step (more amplification)
  4. If within hysteresis window, keep current gain
  5. Maximum recursion depth: 8 iterations to find optimal gain

Hysteresis Thresholds:

Gain     Upper    Lower    Hysteresis Window
G_1_8:   30.0V    25.0V    25.0-30.0V
G_1_4:   25.0V    10.0V    10.0-25.0V
G_1_2:   10.0V     5.0V     5.0-10.0V
G_1:      5.0V     2.0V     2.0-5.0V
G_2:      2.0V     1.0V     1.0-2.0V
G_4:      1.0V     0.2V     0.2-1.0V
G_8:      0.2V     0.1V     0.1-0.2V
G_16:     0.1V    0.01V    0.01-0.1V

Example: Measuring 1.5V signal:

  • Initial gain: G_1 (1×)
  • 1.5V is within hysteresis window (2.0V-5.0V) → Keep G_1
  • Final measurement: 1.5V at G_1

Example: Measuring 8mV signal:

  • Initial gain: G_1 (1×)
  • 0.008V < 2.0V (lower threshold) → Increase to G_2
  • 0.008V < 1.0V (lower threshold) → Increase to G_4
  • 0.008V < 0.2V (lower threshold) → Increase to G_8
  • 0.008V < 0.1V (lower threshold) → Increase to G_16
  • 0.008V is within hysteresis window (0.01V-0.1V) → Keep G_16
  • Final measurement: 8mV at G_16 (optimal resolution)

Error Handling

The module validates operations and provides error messages:

  • Invalid NetName: Throws exception if channel does not exist
  • Unsupported Channel Type: Throws exception for unrecognized channel types
  • I²C Communication Errors: Logged and propagated to caller
  • SPI Communication Errors: AD5592R read/write errors logged
  • Calibration Errors: Validates calibration table structure and gain factor keys
  • Auto-Range Recursion Limit: Maximum 8 iterations to prevent infinite loops
  • PWM Device Not Found: Logged as error if expected device at 0x30 is missing

Best Practices

  1. Gain selection: Choose appropriate gain for expected signal range
    • Use auto-ranging for unknown signals (slower but automatic)
    • Use fixed gain for known signals (faster, consistent performance)
  2. Calibration: Perform calibration after hardware changes or environmental shifts
  3. Sample averaging: Use NumericResultChannel for high sample counts (>1000 samples)
  4. MPIO direction: Always configure direction (IN/OUT) before use
  5. PWM device detection: Check for PWM channels before using (may not be present on all units)
  6. Voltage references: Set PWM_VSET and TACH_VSET before using PWM/Tach features
  7. UART configuration: Verify baudrate and bus type before communication
  8. LED monitoring: Observe LED colors for system status (Green = active read, Red = error)
  9. Calibration backup: Export calibration table before making changes
  10. Programming mode: Only enable PROG_EN when intentionally programming microcontroller

Module Initialization Sequence

On Reset(), the module performs:

  1. Clear existing channel list
  2. Setup LED driver:
    • Create LP5012 at I²C address 0x14
    • Initialize 4 RGB LEDs (ANALOG_CONN, STATUS_1, STATUS_2, STATUS_3)
    • Set initial colors: All Red (initializing state)
  3. I²C device scan: Scan for PWM/Tach device at 0x30
  4. Setup PWM/Tachometer (if device found at 0x30):
    • Create PwmTacho device
    • Reset PWM/Tach controller
    • Add 11 PWM/Tach channels:
      • PWM1: ACTUAL_FREQ, REQ_FREQ, DUTY_CYCLE, ENABLE
      • PWM2: ACTUAL_FREQ, REQ_FREQ, DUTY_CYCLE, ENABLE
      • TACH: TACH1_ACTUAL_FREQ, TACH2_ACTUAL_FREQ
      • PWMTACH_FW_REVISION
  5. Setup GPIO expander:
    • Create PI4IOE5V6416 at I²C address 0x20
    • Configure 16 control signals (UART/SPI enable, PGA control, mux control, reset)
    • Perform reset sequence (toggle RESETn 10 times)
  6. Setup ADC devices:
    • ADC1 (SPI CS0): 8 MPIO channels (MPIO00-07), bidirectional
    • ADC2 (SPI CS1): 2 internal ADC channels + 4 MPIO (MPIO08-11) + PWM_VSET + TACH_VSET
    • Enable double ADC/DAC range mode (0-5V)
    • Disable internal temperature sensing
    • Reset and update both ADC devices
  7. Load calibration table from persistent storage
  8. Add public measurement channels:
    • ADC_CH1 through ADC_CH8 (precision ADC with PGA)
  9. Perform automatic calibration: PerformCalibration() for all gains
  10. Apply calibration values to all channels
  11. Add NumericResult channel with analog targets populated
  12. Add configuration channels:
    • AutoRange (digital, default: true)
    • GainMux (multiplexer, default: G_1)
    • PROG_EN (digital, default: false)
  13. Add UART channel (RS232, 9600 baud, /dev/serial0)
  14. Add calibration management channels:
    • PERFORM_CAL (digital trigger)
    • STORE_CAL (password-protected register)
    • CALIBRATION (calibration table access)
  15. Update LED colors:
    • ANALOG_CONN: Teal (ready)
    • STATUS_1, STATUS_2, STATUS_3: Black (off)

Typical Use Cases

1. Precision Voltage Measurement:

// Measure millivolt-level signal with optimal resolution
SetValues(
    new[] { 
        "0.ESH10000535.GainMux",
        "0.ESH10000535.AutoRange"
    },
    new[] { 
        "G_16",    // 16× gain for mV signals
        "false"    // Fixed gain
    }
);

string[] voltage = GetValues(new[] { "0.ESH10000535.ADC_CH1" });
double millivolts = double.Parse(voltage[0]) * 1000;
Console.WriteLine($"Measured: {millivolts:F3} mV");

2. Multi-Range Voltage Characterization:

// Measure across multiple gain settings for linearity check
void CharacterizeLinearity(string channelNetName)
{
    var gains = new[] { "G_1_8", "G_1_4", "G_1_2", "G_1", "G_2", "G_4", "G_8", "G_16" };

    Console.WriteLine("Gain Setting | Measured Voltage");
    Console.WriteLine("-------------|------------------");

    foreach (var gain in gains)
    {
        SetValues(
            new[] { "0.ESH10000535.GainMux", "0.ESH10000535.AutoRange" },
            new[] { gain, "false" }
        );

        Thread.Sleep(100);  // Allow settling

        string[] measurement = GetValues(new[] { channelNetName });
        Console.WriteLine($"{gain,-12} | {measurement[0]} V");
    }
}

CharacterizeLinearity("0.ESH10000535.ADC_CH1");

3. PWM Generation for Motor Control:

// Generate variable speed PWM for motor control
void SetMotorSpeed(double speedPercent)
{
    double frequency = 20000;  // 20 kHz PWM
    double dutyCycle = speedPercent / 100.0;

    SetValues(
        new[] {
            "0.ESH10000535.PWM_VSET",        // Motor driver voltage
            "0.ESH10000535.PWM1_REQ_FREQ",
            "0.ESH10000535.PWM1_DUTY_CYCLE",
            "0.ESH10000535.PWM1_ENABLE"
        },
        new[] {
            "5.0",                            // 5V logic level
            frequency.ToString(),
            dutyCycle.ToString("F3"),
            "true"
        }
    );

    // Verify frequency
    string[] actualFreq = GetValues(new[] { "0.ESH10000535.PWM1_ACTUAL_FREQ" });
    Console.WriteLine($"Motor speed: {speedPercent}% @ {actualFreq[0]} Hz");
}

SetMotorSpeed(75);  // 75% speed

4. Tachometer-Based Speed Control:

// Closed-loop speed control using tachometer feedback
void ClosedLoopSpeedControl(double targetRPM)
{
    const double PulsesPerRevolution = 4;  // Encoder resolution
    double targetFreq = (targetRPM / 60.0) * PulsesPerRevolution;

    // Initial PWM settings
    double dutyCycle = 0.5;

    for (int i = 0; i < 10; i++)
    {
        // Read current speed
        string[] tachFreq = GetValues(new[] { "0.ESH10000535.TACH1_ACTUAL_FREQ" });
        double measuredFreq = double.Parse(tachFreq[0]);
        double measuredRPM = (measuredFreq / PulsesPerRevolution) * 60.0;

        // Simple proportional control
        double error = targetRPM - measuredRPM;
        dutyCycle += error * 0.001;  // P-gain
        dutyCycle = Math.Max(0.0, Math.Min(1.0, dutyCycle));  // Clamp

        // Update PWM
        SetValues(
            new[] { "0.ESH10000535.PWM1_DUTY_CYCLE" },
            new[] { dutyCycle.ToString("F3") }
        );

        Console.WriteLine($"Target: {targetRPM} RPM, Measured: {measuredRPM:F1} RPM, Duty: {dutyCycle:F3}");

        Thread.Sleep(100);
    }
}

ClosedLoopSpeedControl(3000);  // Target 3000 RPM

5. Multi-Channel Data Acquisition:

// Acquire synchronized multi-channel data
void AcquireMultiChannelData()
{
    // Configure for mid-range signals
    SetValues(
        new[] { "0.ESH10000535.GainMux", "0.ESH10000535.AutoRange" },
        new[] { "G_1", "false" }
    );

    // Read all 8 ADC channels
    string[] values = GetValues(new[] {
        "0.ESH10000535.ADC_CH1",
        "0.ESH10000535.ADC_CH2",
        "0.ESH10000535.ADC_CH3",
        "0.ESH10000535.ADC_CH4",
        "0.ESH10000535.ADC_CH5",
        "0.ESH10000535.ADC_CH6",
        "0.ESH10000535.ADC_CH7",
        "0.ESH10000535.ADC_CH8"
    });

    Console.WriteLine("Multi-Channel Acquisition:");
    for (int i = 0; i < values.Length; i++)
    {
        Console.WriteLine($"  CH{i+1}: {values[i]} V");
    }
}

AcquireMultiChannelData();

Debugging and Troubleshooting

Problem: ADC readings unstable or noisy

  • Check: Appropriate gain setting for signal amplitude
  • Check: Auto-ranging may be causing gain switching (disable for stable signals)
  • Try: Use NumericResultChannel with averaging for cleaner measurements
  • Verify: Calibration is current and appropriate for gain setting

Problem: Auto-ranging not converging

  • Check: Signal may be outside measurement range (too high or too low)
  • Check: Signal may be oscillating around threshold boundaries
  • Action: Disable auto-ranging and manually select appropriate gain
  • Verify: Signal is within 0-5V ADC input range after gain application

Problem: Calibration values seem incorrect

  • Check: PERFORM_CAL was run with proper reference connections
  • Check: Calibration mux was in correct mode during calibration
  • Action: Re-run calibration sequence
  • Verify: Save calibration with STORE_CAL after performing calibration

Problem: PWM/Tachometer channels not available

  • Check: PWM device detected at I²C address 0x30 during initialization
  • Action: Verify hardware includes PWM/Tach controller
  • Note: Not all units may have this option installed

Problem: UART communication fails

  • Check: UART_ENn GPIO is set to false (enabled)
  • Check: Baudrate matches connected device
  • Check: /dev/serial0 device exists and has proper permissions
  • Verify: Hardware UART connections are correct

Problem: SPI communication errors with ADCs

  • Check: SPI clock speed is 6 MHz (may need reduction for long cables)
  • Check: SPI chip select signals routing correctly
  • Action: Reset module to reinitialize SPI communication
  • Verify: GPIO expander is responding (I²C 0x20)

Comparison with Standard ADC Modules

Feature ESH10000535 (Sparrow N-TOP) Standard ADC Module
Resolution 12-bit Varies
Programmable Gain 8 settings (1/8× to 16×) Typically none or limited
Auto-Ranging Yes, with hysteresis Typically no
Calibration Granularity Per-channel, per-gain (64 points) Per-channel only
ADC Channels 8 precision + 12 MPIO Varies
PWM Generation Optional (dual channel) Typically separate module
Tachometer Input Optional (dual channel) Typically separate module
Form Factor Sparrow N-TOP Varies
Voltage Range 0-5V base (expandable with gain) Fixed range

Revision History

  • ESH10000535: Current production version
    • Dual AD5592R ADCs (8 MPIO + 6 MPIO + voltage outputs)
    • 8 precision ADC channels with programmable gain amplifiers
    • 8 gain settings (1/8× to 16×)
    • Auto-ranging with hysteresis algorithm
    • Per-channel, per-gain calibration (64 calibration points)
    • Optional PWM/Tachometer controller (dual channel)
    • LP5012 LED driver (4 RGB LEDs)
    • PI4IOE5V6416 GPIO expander for control
    • UART communication (RS232)
    • SPI @ 6 MHz for ADC communication
    • Persistent calibration storage
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.