ESH10000121 - MPIO-I2C Module
Overview
The ESH10000121 is a multi-purpose I/O module providing 96 bidirectional analog/digital channels with I²C-based control, similar to ESH10000568 but using I²C communication instead of SPI for lower pin count requirements.
Description
The MPIO-I2C module provides 96 configurable I/O channels organized into 12 groups of 8 channels each, utilizing Analog Devices AD5593R multi-function I/O chips. Each channel can be independently configured as analog input, analog output, or pseudo-digital I/O with voltage threshold interpretation. The module is ideal for mixed-signal applications requiring both analog and digital interfacing capabilities.
Key Features:
96 Bidirectional Channels: Configurable as analog or pseudo-digital I/O
- 12-bit ADC resolution (2x range mode, 0-5V typical)
- 12-bit DAC resolution (2x range mode, 0-5V typical)
- Pseudo-digital mode with programmable VL/VH thresholds
- Support for open-drain and floating output emulation
I²C Communication: Lower pin count compared to SPI
- 400 kHz I²C bus speed
- Reduced wiring complexity
- Simpler hardware interfacing
Flexible Configuration: Per-channel direction control
- Bidirectional capability (IN | OUT)
- Default direction: IN
- Runtime direction switching for pseudo-digital outputs
High-Speed Acquisition: Numeric result support
- Multi-channel synchronized sampling
- Configurable sample rates
- Optional data reduction (min/max/avg/stddev)
- Base64-encoded data transfer
Per-Channel Calibration: Gain and offset adjustment
- Independent calibration per channel
- Analog mode: Configurable gain and offset
- Pseudo-digital mode: VL/VH threshold configuration
Hardware Details
Multi-Function I/O:
- Chip: Analog Devices AD5593R (12 chips)
- Channels per chip: 8
- Total channels: 96
- Resolution: 12-bit ADC/DAC
- I²C Address: 0x11 (per chip, selected via GPIO)
- Communication: I²C bus @ 400 kHz
- Voltage Range: 0-5V (2x range mode enabled)
- Features:
- Double ADC range mode: Enabled
- Double DAC range mode: Enabled
- Temperature sensor: Disabled (ReadTemperature = false)
GPIO Expander:
- Chip: NXP PI4IOE5V6416
- I²C Address: 0x20
- Purpose: Chip select addressing (A0-A11) and LED control
- Function: Routes active chip by setting address lines
Channel Naming Convention
All channels follow the naming pattern: {ModuleIndex}.ESH10000121.{ChannelName}
Where:
{ModuleIndex}is the position of the module in the system (e.g., 0, 1, 2...)ESH10000121is the module type identifier{ChannelName}is the specific channel name from the table below
Example: Module at position 0, channel 42 would be: 0.ESH10000121.MPIO42
User-Accessible Channels
| Channel Range | Type | Direction | Usage | Description |
|---|---|---|---|---|
| MPIO00-MPIO07 | Analog / Pseudo-Digital | IN/OUT | UserAllocatable | CHIP00 channels 0-7 (AD5593R #0) |
| MPIO08-MPIO15 | Analog / Pseudo-Digital | IN/OUT | UserAllocatable | CHIP01 channels 0-7 (AD5593R #1) |
| MPIO16-MPIO23 | Analog / Pseudo-Digital | IN/OUT | UserAllocatable | CHIP02 channels 0-7 (AD5593R #2) |
| MPIO24-MPIO31 | Analog / Pseudo-Digital | IN/OUT | UserAllocatable | CHIP03 channels 0-7 (AD5593R #3) |
| MPIO32-MPIO39 | Analog / Pseudo-Digital | IN/OUT | UserAllocatable | CHIP04 channels 0-7 (AD5593R #4) |
| MPIO40-MPIO47 | Analog / Pseudo-Digital | IN/OUT | UserAllocatable | CHIP05 channels 0-7 (AD5593R #5) |
| MPIO48-MPIO55 | Analog / Pseudo-Digital | IN/OUT | UserAllocatable | CHIP06 channels 0-7 (AD5593R #6) |
| MPIO56-MPIO63 | Analog / Pseudo-Digital | IN/OUT | UserAllocatable | CHIP07 channels 0-7 (AD5593R #7) |
| MPIO64-MPIO71 | Analog / Pseudo-Digital | IN/OUT | UserAllocatable | CHIP08 channels 0-7 (AD5593R #8) |
| MPIO72-MPIO79 | Analog / Pseudo-Digital | IN/OUT | UserAllocatable | CHIP09 channels 0-7 (AD5593R #9) |
| MPIO80-MPIO87 | Analog / Pseudo-Digital | IN/OUT | UserAllocatable | CHIP10 channels 0-7 (AD5593R #10) |
| MPIO88-MPIO95 | Analog / Pseudo-Digital | IN/OUT | UserAllocatable | CHIP11 channels 0-7 (AD5593R #11) |
| NumericResult | Numeric Data Acquisition | IN | UserAllocatable | Multi-channel high-speed acquisition |
Total User Channels: 98 (96 MPIO + NumericResult + CALIBRATION)
Note: Each MPIO channel supports dual capability (ChannelTypeCapability = Analog | PseudoDigital), allowing runtime conversion between analog and pseudo-digital modes.
Channel Configuration
Analog Mode
Channels operate as analog voltage measurement (input) or generation (output) with configurable parameters:
- Gain: Multiplicative calibration factor (default: 1.0)
- Offset: Additive calibration offset (default: 0.0)
- Resolution: Measurement resolution (12-bit fixed for AD5593R)
- Value: Measured or output voltage (0-5V typical)
- Direction: IN or OUT
Configuration Example:
ConfigureChannels(new[] {
new AnalogChannel {
NetName = "0.ESH10000121.MPIO00",
Enabled = true,
Direction = DirectionTypes.IN,
Gain = 1.0,
Offset = 0.0,
Value = 0.0
}
});
Pseudo-Digital Mode
Analog channels can be configured as digital I/O with voltage threshold interpretation:
- VL (Voltage Low): Maximum voltage considered logic LOW (default: 0.5V)
- VH (Voltage High): Minimum voltage considered logic HIGH (default: 1.5V)
- MinIoVoltage: Minimum allowable voltage (0V)
- MaxIoVoltage: Maximum allowable voltage (5V)
- Value: Boolean state (true/false)
- RawValue: Underlying analog voltage (read-only for inputs)
Constraints:
VL >= MinIoVoltage(typically 0V)VL <= MaxIoVoltage(typically 5V)VH > VL(high threshold must exceed low threshold)- Hysteresis: Values between VL and VH retain previous state
Configuration Example:
ConfigureChannels(new[] {
new PseudoDigitalChannel {
NetName = "0.ESH10000121.MPIO01",
Enabled = true,
Direction = DirectionTypes.IN,
VL = 0.8, // Logic LOW threshold
VH = 2.0, // Logic HIGH threshold
MinIoVoltage = 0.0,
MaxIoVoltage = 5.0
}
});
Special Output Modes
Open-Drain Emulation:
Set VH < 0 to enable open-drain mode:
- Logic HIGH: Channel set to INPUT (high-impedance state)
- Logic LOW: Channel drives VL voltage
new PseudoDigitalChannel {
NetName = "0.ESH10000121.MPIO02",
Direction = DirectionTypes.OUT,
VL = 0.0,
VH = -1.0, // Negative VH enables open-drain
Value = true // Will set to INPUT (high-Z)
}
Float Emulation:
Set VL < 0 to enable float mode:
- Logic LOW: Channel set to INPUT (high-impedance state)
- Logic HIGH: Channel drives VH voltage
new PseudoDigitalChannel {
NetName = "0.ESH10000121.MPIO03",
Direction = DirectionTypes.OUT,
VL = -1.0, // Negative VL enables float
VH = 3.3,
Value = false // Will set to INPUT (high-Z)
}
Numeric Result Mode
High-speed data acquisition mode for capturing multiple samples:
- NumberOfSamples: Number of samples to acquire
- SampleRate: Acquisition rate (samples per second)
- TargetNetName: Comma-separated list of channels to acquire
- ReducedSet: Enable statistical data reduction (min/max/avg/stddev)
- MultiChannel: Enable multi-channel synchronized acquisition
- Base64String: Acquired data encoded as Base64 (output)
- PossibleTargetNames: Array of valid analog channel names for targeting
Configuration Example:
ConfigureChannels(new[] {
new NumericResultChannel {
NetName = "0.ESH10000121.NumericResult",
Enabled = true,
NumberOfSamples = 1000,
SampleRate = 10000, // 10 kHz
TargetNetName = "0.ESH10000121.MPIO00,0.ESH10000121.MPIO01",
ReducedSet = false,
MultiChannel = true
}
});
// Read acquired data
string[] result = GetValues(new[] { "0.ESH10000121.NumericResult" });
List<NumericResult> data = NumericResult.FromBase64(result[0]);
Internal Channels (Not User-Accessible)
The following channels are used for internal system control and are hidden from users:
- GPIO Expander Signals (all
HiddenSystemControl):- RESET: Global reset control for all AD5593R chips
- A0-A11: Chip select address lines (12 chips)
- LED_STATUS_R/G/B: Status LED control
Data Bus Integration
The module provides a data bus with 96 signals (12 groups × 8 signals):
- Signal Type: Analog
- NetName Pattern:
{ModuleIndex}.ESH10000121.MPIO{00-95} - Purpose: Internal signal routing and cross-module connectivity
- Note: MPIO signals can be used for module-to-module connections via data bus
Programming Interface
Configure Analog Input:
ConfigureChannels(new[] {
new AnalogChannel {
NetName = "0.ESH10000121.MPIO00",
Enabled = true,
Direction = DirectionTypes.IN,
Gain = 2.0, // Apply 2x gain
Offset = -0.5, // Subtract 0.5V offset
Resolution = 12
}
});
Configure Analog Output:
ConfigureChannels(new[] {
new AnalogChannel {
NetName = "0.ESH10000121.MPIO10",
Enabled = true,
Direction = DirectionTypes.OUT,
Value = 2.5 // Output 2.5V
}
});
Configure Pseudo-Digital Input:
ConfigureChannels(new[] {
new PseudoDigitalChannel {
NetName = "0.ESH10000121.MPIO20",
Enabled = true,
Direction = DirectionTypes.IN,
VL = 0.8, // 0V-0.8V = LOW
VH = 2.0 // 2.0V-5V = HIGH
}
});
Read Multiple Channels:
string[] values = GetValues(new[] {
"0.ESH10000121.MPIO00",
"0.ESH10000121.MPIO01",
"0.ESH10000121.MPIO20"
});
// values[0] = "2.345" (analog voltage)
// values[1] = "1.234" (analog voltage)
// values[2] = "true" (pseudo-digital state)
Set Output Values:
SetValues(
new[] {
"0.ESH10000121.MPIO10", // Analog output
"0.ESH10000121.MPIO11" // Pseudo-digital output
},
new[] {
"3.3", // 3.3V
"true" // Logic HIGH (will output VH voltage)
}
);
Multi-Channel Acquisition:
// Step 1: Configure numeric result channel
ConfigureChannels(new[] {
new NumericResultChannel {
NetName = "0.ESH10000121.NumericResult",
Enabled = true,
NumberOfSamples = 500,
SampleRate = 5000, // 5 kHz
TargetNetName = "0.ESH10000121.MPIO00,0.ESH10000121.MPIO01,0.ESH10000121.MPIO02",
ReducedSet = true, // Get min/max/avg/stddev
MultiChannel = true
}
});
// Step 2: Read results
string[] result = GetValues(new[] { "0.ESH10000121.NumericResult" });
List<NumericResult> data = NumericResult.FromBase64(result[0]);
// Step 3: Process results
foreach (var channel in data)
{
Console.WriteLine($"{channel.NetName}:");
Console.WriteLine($" Min: {channel.Min}");
Console.WriteLine($" Max: {channel.Max}");
Console.WriteLine($" Avg: {channel.Average}");
Console.WriteLine($" StdDev: {channel.StdDev}");
}
Error Handling
The module validates channel configuration and provides detailed error messages:
- Invalid NetName: Throws exception if channel does not exist
- Invalid VL: Validates VL is within MinIoVoltage-MaxIoVoltage range
- Invalid VH: Validates VH exceeds VL
- Direction Mismatch: Prevents output operations on input channels and vice versa
- Disabled Channel Operations: Allows GetValue on disabled channels, skips SetValue for disabled outputs
- Target Channel Validation: Validates numeric result target channels exist and are analog type
Best Practices
- Always configure direction before use: Specify IN or OUT explicitly in ConfigureChannels
- Enable channels before operations: Set
Enabled = truefor all active channels - Use appropriate mode for application:
- Analog mode: Precision voltage measurements/generation
- Pseudo-digital mode: Simple digital I/O with voltage flexibility
- Configure VL/VH with margin: Leave hysteresis gap (typically 0.5-1.0V) to avoid oscillation
- Batch operations: Use multi-channel GetValues/SetValues for better performance
- I²C bus speed: Module configured for 400 kHz I²C (faster than standard 100 kHz)
- Chip select handling: Module automatically manages chip addressing via GPIO expander
- Open-drain/float modes: Use negative VH/VL for special output modes (wired-OR, tri-state)
- Numeric results for high-speed: Use NumericResultChannel for acquisition > 100 samples
- Monitor I²C bus errors: Chip select logic includes retry mechanism (up to 10 retries)
Module Initialization Sequence
On Reset(), the module performs the following initialization:
- Clear existing channel list
- Setup GPIO expander (PI4IOE5V6416) with chip select signals (A0-A11)
- Reset GPIO expander to default state
- Generate 96 MPIO channels (MPIO00-MPIO95):
- Create 12 groups of 8 channels (CHIP00-CHIP11)
- Initialize each channel as bidirectional analog/pseudo-digital
- Set default direction to IN
- Enable dual capability (Analog | PseudoDigital)
- Create 12 AD5593R device instances:
- Configure I²C address (0x11)
- Enable double ADC range mode (0-5V)
- Enable double DAC range mode (0-5V)
- Disable temperature sensor reading
- Set I²C clock to 400 kHz
- Reset all 12 AD5593R chips
- Add NumericResult channel with possible target names populated
- Add CALIBRATION channel (implicit, inherited from base Module class)
Chip Select Mechanism
The module uses a GPIO expander to route I²C communication to individual AD5593R chips:
- Address Lines A0-A11: Select active chip (one-hot encoding)
- Automatic Switching: EnableChannel() sets appropriate chip select
- Retry Logic: Up to 10 retries on I²C communication failure
- Source Bus Pattern:
MAIN.CHIP{00-11}identifies target chip
Example Chip Select Operation:
// When accessing MPIO00-MPIO07 (CHIP00):
// - Sets A0=true, A1-A11=false
// - Enables I²C communication to AD5593R #0 at address 0x11
// When accessing MPIO08-MPIO15 (CHIP01):
// - Sets A1=true, A0,A2-A11=false
// - Enables I²C communication to AD5593R #1 at address 0x11
Comparison with ESH10000568
| Feature | ESH10000121 (I²C) | ESH10000568 (SPI) |
|---|---|---|
| Communication Bus | I²C @ 400 kHz | SPI @ 10 MHz |
| Chip | AD5593R | AD5592R |
| Total Channels | 96 | 96 |
| Resolution | 12-bit | 12-bit |
| Wiring Complexity | Lower (2 wires + power) | Higher (4+ wires + power) |
| Speed | Moderate | High |
| Chip Select | GPIO-based addressing | Direct SPI CS |
| Best For | Space-constrained, multi-drop | High-speed, low-latency |
Revision History
- ESH10000121: Current production version
- 96 MPIO channels (AD5593R × 12)
- I²C communication @ 400 kHz
- Dual capability (Analog | PseudoDigital)
- Numeric results support
- Open-drain and float emulation