When developing and testing master devices, the ability to emulate a slave can be critical, especially when the actual peripheral hardware is unavailable or still in development. Total Phase’s Promira Serial Platform and Aardvark I2C/SPI Host Adapter both offer the ability to operate in slave mode, enabling engineers to emulate peripherals and verify master behavior.
Emulating a slave provides several benefits:
This flexibility is valuable in Research & Development labs, production test environments, and troubleshooting scenarios.
| Feature | Promira Serial Platform | Aardvark I2C/SPI Host Adapter |
| I2C/SPI Slave Support | Yes | Yes |
| Max I2C Slave Speed | 3.4 MHz* | 800 KHz |
| Max SPI Slave Speed | 20 MHz* | 4 MHz |
| Max Single Slave Response | 256 Bytes | 64 Bytes |
| API Support for Slave Mode | Promira Software API I2C/SPI Active | Aardvark Software API |
| I/O Voltage | 0.9 V - 3.3 V, 5V | 3.3 V |
* Promira Serial Platform speeds depend on the licensed application.
Hardware
You’ll need:
Pinout Reference:
Refer to this section of the Promira Serial Platform User Manual for complete pinout information.
Software
I2C Slave Mode (GUI method)
1. Launch the Control Center Serial Software.
2. Connect the Promira Serial Platform to your computer and select it from the available devices list.
3. Navigate to Adapter > I2C + SPI.
4. Optionally, enable I2C Pulls-Ups and/or Target Power.
5. Select the Slave tab under I2C Control to display slave mode controls.
6. Enter the slave address (standard 7-bit addressing)
7. Configure Optional Parameters: Set the maximum transmit (Tx) and receive (Rx) bytes, and define a slave response message (up to 256 bytes) if needed, according to your application’s requirements.
8. Click “Set Resp.” to store the defined slave response.
9. Click Enable to activate I2C slave mode. The Promira platform will now respond to master transactions as configured.
SPI Slave Mode (GUI method)
1. Launch the Control Center Serial Software.
2. Connect the Promira Serial Platform to your computer and select it from the available devices list.
3. Navigate to Adapter > I2C + SPI.
4. Optionally, enable Target Power.
5. Select the Slave tab under SPI Control to display slave mode controls.
6. Configure the bus settings to match the master device:
7. Configure Optional Parameters: In the MISO Message field, enter the data you want the Promira platform to send when addressed by the master (up to 256 bytes), according to your application’s requirements.
8. Click Set MISO to store the defined response.
9. Click Enable to activate SPI slave mode. The Promira platform will now respond to master transactions as configured.
API Method
Promira I2C Slave Setup
1. Open the Promira platform and channel
pm_open() to open the platform.pm_load(pm, APP NAME) to load the I2C Active Application.ps_app_connect(ip) to connect to the application.ps_channel_open(conn) to open a channel.2. Configure the I2C environment
ps_app_configure(PromiraChannelHandle channel, PS_APP_CONFIG_I2C) to enable I2C.ps_i2c_pullup(PromiraChannelHandle channel, u08 pullup_mask) to enable bus pull ups.ps_phy_target_power(PromiraChannelHandle channel, u08 power_mask) to power the target (optional).3. Set the initial slave response
ps_i2c_slave_set_resp(PromiraChannelHandle channel, u08 num_bytes, const u08 * data_out)4. Enable I2C slave mode
ps_i2c_slave_enable(PromiraChannelHandle channel, u08 addr, u16 maxTxBytes, u16 maxRxBytes)addr: lower 7 bits = slave addressmaxTxBytes: 0 = unlimited transmit.maxRxBytes: 0 = unlimited receive.5. Poll for asynchronous transactions
ps_i2c_slave_poll(PromiraChannelHandle channel, int timeout) to check for pending master transactions.ps_i2c_slave_read(PromiraChannelHandle channel, u08 * addr, u16 num_bytes, u08 * data_in u16 * num_read) to read the received bytes.ps_i2c_slave_set_resp (PromiraChannelHandle channel, u08 num_bytes, const u08 * data_out).6. Disable slave mode and close the device
ps_i2c_slave_disable(PromiraChannelHandle channel). Then close:ps_channel_close(PromiraChannelHandle channel).ps_app_disconnect(PromiraConnectionHandle conn).pm_close().Promira SPI Slave Setup
1. Open the Promira platform and channel
pm_open() to open the platform.pm_load(pm, APP NAME) to load the SPI Active Application.ps_app_connect(ip) to connect to the application.ps_channel_open(conn) to open a channel.2. Configure SPI environment
ps_app_configure (PromiraChannelHandle channel, PS_APP_CONFIG_SPI) to open the platform.ps_phy_target_power (PromiraChannelHandle channel, u08 power_mask) to set the Promira platform’s power mode.ps_spi_configure (PromiraChannelHandle channel, PromiraSpiMode mode, PromiraSpiBitorder bitorder, u08 ss_polarity) to configure SPI mode/bit order.ps_spi_enable_ss (PromiraChannelHandle channel, u08 ss_enable) to enable Slave Select (SS) line(s).3. Set the initial slave response
ps_spi_std_slave_set_resp(PromiraChannelHandle channel, u16 num_bytes, const u08 * data_out).4. Enable SPI slave mode
ps_spi_slave_enable(PromiraChannelHandle channel, PS_SPI_SLAVE_MODE_STD).ps_spi_std_slave_configure(PromiraChannelHandle channel, PromiraSpiMode io, u08 flags).ps_spi_slave_host_read_size(PromiraChannelHandle channel, u32 read_size).5. Poll for asynchronous transactions
ps_spi_slave_poll(PromiraChannelHandle channel, int timeout) to check for incoming data.ps_spi_slave_read(PromiraChannelHandle channel, PromiraSpiSlaveReadInfo * read_info, u32 in_num_bytes, u08 * data_in) to read the received bytes.ps_spi_std_slave_set_resp (PromiraChannelHandle channel, u16 num_bytes, const u08 * data_out).6. Disable slave mode and close the device
ps_spi_slave_disable(PromiraChannelHandle channel). Then close:ps_channel_close(PromiraChannelHandle channel).ps_app_disconnect(PromiraConnectionHandle conn).pm_close().Important Notes for Promira Slave Mode:
Static Responses: The Promira platform does not interpret master requests or generate responses dynamically or on the fly. Responses must be predefined in the software/API whenever a new response is required.
Set Slave Response: It is always advisable to set the slave response before first enabling the slave. This ensures that valid data is sent to any requesting master.
Send Continuous Stream of Data: Use the Promira Software API to wrap data across transactions in SPI slave mode.
User Manual: See the Promira Serial Platform User Manual for full API function references. Example Python scripts for configuring I2C/SPI Slave Mode can also be found in the API example files.
Hardware
You’ll need:
Pinout Reference:
Refer to this section of the Aardvark I2C/SPI Host Adapter for complete pinout information.
Software
I2C Slave Mode (GUI method)
1. Launch the Control Center Serial Software.
2. Connect the Aardvark I2C/SPI Host Adapter to your computer and select it from the available devices list.
3. Navigate to Adapter > I2C + SPI.
4. Optionally, enable I2C Pulls-Ups and/or Target Power.
5. Select the Slave tab under I2C Control to display slave mode controls.
6. Enter the slave address (standard 7-bit addressing)
7. Configure Optional Parameters: Set the maximum transmit (Tx) and receive (Rx) bytes, and define a slave response message (up to 64 bytes) if needed, according to your application’s requirements.
8. Click “Set Resp.” to store the defined slave response.
9. Click Enable to activate I2C slave mode. The Aardvark adapter will now respond to master transactions as configured.
SPI Slave Mode (GUI method)
1. Launch the Control Center Serial Software.
2. Connect the Aardvark I2C/SPI Host Adapter to your computer and select it from the available devices list.
3. Navigate to Adapter > I2C + SPI.
4. Optionally, enable Target Power.
5. Select the Slave tab under SPI Control to display slave mode controls.
6. Configure the bus settings to match the master device:
7. Configure Optional Parameters: In the MISO Message field, enter the data you want the Aardvark adapter to send when addressed by the master (up to 64 bytes), according to your application’s requirements.
8. Click Set MISO to store the defined slave response.
9. Click Enable to activate SPI slave mode. The Aardvark adapter will now respond to master transactions as configured.
API Method
Aardvark I2C Slave Setup
1. Open the Aardvark port
aa_open() to obtain an Aardvark handle.2. Configure the Aardvark for I2C mode
aa_i2c_pullup (Aardvark aardvark, aa_u08 pullup_mask).aa_target_power (Aardvark aardvark, aa_u08 power_mask).3. Set the initial slave response
aa_i2c_slave_set_response (Aardvark aardvark, aa_u08 num_bytes, const aa_u08 * data_out).4. Enable I2C slave mode
aa_i2c_slave_enable (Aardvark aardvark, aa_u08 addr, aa_u16 maxTxBytes, aa_u16 maxRxBytes).addr: lower 7 bits = slave addressmaxTxBytes: 0 = unlimited transmit.maxRxBytes: 0 = unlimited receive.5. Poll for asynchronous transactions
aa_async_poll(Aardvark aardvark, int timeout) to check for pending master transactions.aa_i2c_slave_read (Aardvark aardvark, aa_u08 * addr, aa_u16 num_bytes, aa_u08 * data_out) to read the received bytes.aa_i2c_slave_set_response (Aardvark aardvark, aa_u08 num_bytes, const aa_u08 * data_out).6. Disable slave mode and close the device
aa_i2c_slave_disable(Aardvark aardvark) and aa_close(Aardvark aardvark).Aardvark SPI Slave Setup
1. Open the Aardvark port
aa_open() to obtain an Aardvark handle.2. Configure the Aardvark for SPI mode and clock phase
aa_configure (Aardvark aardvark, AA_CONFIG_SPI_I2C).aa_spi_configure (Aardvark aardvark, AardvarkSpiPolarity polarity, AardvarkSpiPhase phase, AardvarkSpiBitorder bitorder).aa_target_power (Aardvark aardvark, aa_u08 power_mask).3. Set the initial slave response
aa_spi_slave_set_response (Aardvark aardvark, aa_u08 num_bytes, const aa_u08 * data_out).4. Enable SPI slave mode
aa_spi_slave_enable (Aardvark aardvark).5. Poll for asynchronous transactions
aa_async_poll(Aardvark aardvark, int timeout) to check for pending SPI transactions.aa_spi_slave_read (Aardvark aardvark, aa_u16 num_bytes, aa_u08 * data_in) to read the received bytes.aa_spi_slave_set_response (Aardvark aardvark, aa_u08 num_bytes, const aa_u08 * data_out).6. Disable slave mode and close the device
aa_spi_slave_disable(Aardvark aardvark) and aa_close(Aardvark aardvark).
Important Notes for Aardvark I2C Slave Mode:
Static Responses: The Aardvark adapter does not interpret master requests or generate responses dynamically or on the fly. Responses must be predefined in the software/API whenever a new response is required.
Set Slave Response: It is always advisable to set the slave response before first enabling the slave. This ensures that valid data is sent to any requesting master.
User Manual: See the Aardvark I2C/SPI Host Adapter User Manual for full API function references. Example Python scripts for configuring I2C/SPI Slave Mode can also be found in the API example files.
You’re developing firmware for an MCU that communicates with a temperature sensor at I2C address 0x50.
The physical sensor isn’t yet available, but you still need to verify the MCU’s I2C communication and firmware logic. By using the Aardvark adapter or Promira platform in slave mode, you can emulate the sensor so the MCU behaves as if the real device is connected.
Control Center Serial Software Setup (Promira Serial Platform Example):
1. Launch Control Center Serial Software.
2. Connect your Promira Serial Platform and select it under Available Devices

Figure 1: Connect Device in Control Center Serial Software
3. Navigate to Adapter > I2C + SPI and select the I2C Slave tab.
4. Enter the Slave Address 0x50 (slave address should match device being emulated).
5. Enter the response bytes [19] to return temperature reading (0x19 for 25°C).
6. Click Set Resp., then Enable.

Figure 2: Slave Response Enabled
Testing a Master Read (Temperature Example)
1. From your I2C master device, send a read transaction to the slave address 0x50.
2. The Promira platform automatically responds with the bytes you configured.
3. On the master side, validate the following:
4. Error handling (optional): Update the slave response to send alternate data (e.g., 0x32) and confirm that the firmware reacts appropriately.
5. The Beagle I2C/SPI Protocol Analyzer can then be used to monitor and display the I2C communication in real-time.
Caveats & Workarounds:
Simulating Missing Peripherals
During early development, the actual I2C or SPI peripheral might not yet be available. Using the Promira platform or Aardvark adapter in slave mode, you can emulate that device by configuring the expected address and setting a predefined data pattern. This allows firmware teams to continue development and test master behavior without waiting for final hardware, reducing project delays.
Rapid Prototyping
When testing multiple potential designs or firmware variations, the ability to quickly swap between simulated slave devices is a major advantage. Instead of rewiring or flashing different firmware onto prototype boards, you can simply reconfigure the slave address and data in software. This accelerates iterative testing and allows comparison of master behavior under different device conditions, either sequentially on a single adapter or simultaneously using multiple adapters.
Address Simulation
Some systems require the master to communicate with multiple slave addresses, or to perform a general call to detect connected devices. With the Aardvark adapter or Promira platform, you can configure the adapter to emulate specific slave addresses or respond to a general call, to verify the master’s address resolution logic. This is particularly useful for SMBus systems, battery management systems, and multi-sensor environments where address conflicts or misreads could cause operational failures. Note that a single adapter can only emulate one slave address at a time, so testing multiple addresses requires sequential configuration or multiple adapters.
Edge Case Testing
Real peripherals may not easily generate unusual, extreme, or faulty values. Emulated slaves can provide out-of-range values or rapid changes. This helps ensure that the master device or firmware handles errors and unusual conditions as expected.
Firmware Validation
By emulating peripherals, you can verify that master firmware correctly handles communication protocols, ACK/NACK responses, and timing without risking damage to a real device. This is valuable during development, validation, and troubleshooting phases.