# Purpose and Context
This document shows how to read from the auxiliary path AUX1 with ICM-456xx sensors. This procedure has been tested with ICM-45686-S, and should also work for ICM-45605(-S) and ICM-45686, and other ICM-456xx variants.
# Hardware Setup
In this example, the MCU SPI bus is wired to both UI and AUX1 ports on the ICM-456xx, but with independent chip select (/CS) lines. The code below is written in Micropython v1.25.0.
# Initialize the SPI Bus and Sensor
We configure our MCU's 4-wire SPI bus as follows:
``` python
SPI_BUS_NUMBER = 0
spi = SPI(SPI_BUS_NUMBER, baudrate=800000, polarity=1, phase=1, bits=8,
sck=Pin(18, mode=Pin.OUT),
mosi=Pin(19, mode=Pin.OUT),
miso=Pin(20, mode=Pin.
) # CPOL=1, CPHA=1 --> SPI mode 3
cs = Pin(24, mode=Pin.OUT, value=1) # chip select line for main UI port
cs_aux1 = Pin(1, mode=Pin.OUT, value=1) # chip select line AUX1 port
icm456xx_UI = ICM456xx(io_protocol=SPI_SLAVE(spi, cs)) # main SPI port
icm456xx_AUX1 = ICM456xx(io_protocol=SPI_SLAVE(spi, cs_aux1)) # auxiliary "AUX1" SPI port
icm456xx_UI.reset()
icm456xx_UI.ireg_write(IPREG_TOP1+0x67, 0x02) # set big endian format to match datasheet - see register SREG_CTRL
```
SPI transactions:
```
SPI-Write,addr: 0x7F,data: 0x02
SPI-Write,addr: 0x7C,data: 0xA2 0x67 0x02
```
# Enable ADCs and AUX1 Path
Next, we enable the ADCs
``` python
icm456xx_UI.write(0x10, 0b1111) # PWR_MGMT0 - primary path...enable accel+gyro ADCs
icm456xx_AUX1.write(0x54, 0b11) # PWR_MGMT_AUX1 - auxiliary path...enable AUX1 registers
sleep(0.05) # allow time for MEMS stabilization
```
SPI transactions:
```
SPI-Write,addr: 0x10,data: 0x0F
SPI-Write,addr: 0x54,data: 0x03,ICM-456xx_AUX1@SPI0
```
# Read Sensor Output Data
Finally we read from the relevant registers.
``` python
UI_sample = icm456xx_UI.sample() # read output data from reg address 0x00~0x0D
AUX1_sample = icm456xx_AUX1.AUX1_sample() # read output data from AUX_DATA reg address 0x44~0x51
```
SPI transactions:
```
SPI-Read,addr: 0x00,data: 0x00 0x56 0xFF 0x0D 0x03 0xF2 0xFF 0xFF 0xFF 0xFF 0x00 0x01 0xFF 0x48
[Comment],"{'temperature': [-184], 'accel': [86, -243, 1010], 'gyro': [-1, -1, 1]}"
SPI-Read,addr: 0x44,data: 0x00 0x58 0xFF 0x0D 0x03 0xF1 0x00 0x00 0xFF 0xFE 0x00 0x01 0xFF 0x38,ICM-456xx_AUX1@SPI0
[Comment],"{'temperature': [-200], 'accel': [88, -243, 1009], 'gyro': [0, -2, 1]}"
```
Please note that the AUX1 port can only read from certain registers in the register map. You will read zeros if you read the UI data registers (at address 0x00) from the AUX1 port:
``` python
icm456xx_AUX1.sample() # reading address 0x00~0x0D from AUX1 port will return zeros
```
SPI transactions:
```
SPI-Read,addr: 0x00,data: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00,ICM-456xx_AUX1@SPI0
[Comment],"{'temperature': [0], 'accel': [0, 0, 0], 'gyro': [0, 0, 0]}"
```
For more information on the AUX1 path and its usage, please see the ICM-456xx product family appnotes.
# Revision History
- 2026-01-26 - initial release