Connecting U4 to U5 via SPI


how do i connect u4 to u5 using spi
To wire U4 and U5 for SPI communication, you need to match the corresponding SPI signals between the two devices. For example, the typical SPI signals you must connect are:

Table


SPI SignalU4 Pin (Function)U5 Suggested Pin
SCLKSCLK (typically pin 4 on U4)GPIO8/D8 (Pin 9 is recommended for the SPI clock)
MOSIMOSI/SDA (typically pin 6 on U4)GPIO10/D10 (Pin 11 is a good choice for MOSI)
MISOMISO (typically pin 7 on U4)GPIO9/D9 (Pin 10 works well for MISO)
CSCS/SCL (typically pin 8 on U4, used as chip select)Any available GPIO, for example GPIO? (assign a free pin for CS)
In addition, make sure to connect the grounds (GND) of both U4 and U5 together to ensure a common reference.
Important:
  • Verify the exact pin numbers on each device’s datasheet.
  • Ensure your chosen CS line on U5 is configured as the SPI chip select in your firmware.
  • Check that the voltage levels on both devices are compatible or use level shifters if required.
These connections will let U5 (the microcontroller) use its SPI interface to communicate with U4 (the sensor).
Assign chip select
Verify voltage compatibility
Enhance signal integrity

Schematic of Positive Plum Universal Remote 045c
0.1uF 0402 capacitor
Capacitance
0.1uF
1uF 0402 capacitor
Capacitance
1uF
VIN+
U4 MISO - U5 GPIO9/D9/MISO
U4 CS/SCL - U5 GPIO2/A0/D0
U4 MISO - U5 GPIO9/D9/MISO
U4 CS/SCL - U5 GPIO2/A0/D0
U4 SCLK - U5 GPIO8/D8/SCK
U4 MOSI/SDA - U5 GPIO10/D10/MOSI
U4 SCLK - U5 GPIO8/D8/SCK
U4 MOSI/SDA - U5 GPIO10/D10/MOSI
200Ω 0603 Resistor
Resistance
200 Ω
200Ω 0603 Resistor
Resistance
200 Ω
PESD3V3L1BA-N
C3216X7R1C106K160AC
Capacitance
10uF
U3
U10
U7
PC817X2NSZ9F
U2
U11
U5
U4
U6
Seeed Studio XIAO ESP32C3

Positive Plum Universal Remote 045c