SPI Clock Signal Stuck High on Custom PCB with 48 MLX90393 Sensors (Hall Effect Device for Palm Rehabilitation)

I am currently working on my master's thesis, where I am developing a hall effect-based device for palm rehabilitation. The device is designed to assess and assist with rehabilitation exercises by measuring force applied through the palm. Here’s a brief overview of the project:

Project Overview:

Hardware Setup: I’ve designed a custom PCB that incorporates 48 MLX90393 sensors, which are hall effect-based magnetometers. These sensors measure the magnetic field and, using calibration, I convert those readings into force data.

Communication: The sensors communicate with a Raspberry Pi 5 using the SPI protocol. I use a single SPI channel for all 48 sensors.

Software: I’ve written the code for sensor communication, data calibration, and visualization of the readings. The code works perfectly, and everything was functioning smoothly until 2 days ago.



Problem:

Recently, I encountered a hardware-related issue that is preventing communication between the Raspberry Pi and the sensors. The SPI clock signal (SCLK) is always high, meaning there is no clock toggling, and as a result, the communication between the Raspberry Pi and the sensors is not happening.

This problem appeared unexpectedly, and up until 2 days ago, everything was working fine. I have double-checked my software and confirmed that the issue seems to be hardware-related.



What I’ve Tried:

Rechecked all connections and wiring on the PCB.

Verified the software, which hasn’t changed and was functioning properly before.

Attempted various SPI clock speed configurations and SPI modes, but the clock line remains high.

Inspected the Raspberry Pi configuration, ensuring that SPI is enabled and properly set up in /boot/firmware/config.txt.



What I’m Seeking:

I’d appreciate any insights or suggestions from experienced engineers or anyone who has faced a similar issue. Specifically:

Could this be a hardware failure, such as a damaged SPI pin on the Raspberry Pi or on the custom PCB?

Are there any tests I could run to further isolate the issue (e.g., specific pins to test with an oscilloscope or voltmeter)?

Any advice on troubleshooting SPI-related hardware issues would be greatly appreciated.
 
Is your custom PCB a HAT board for the Pi or are you using wires for the SPI signals between the Pi and your PCB?

The first thing I would try to do is narrow down the problem to either your custom PCB or the Pi. If possible, disconnect the two from each other, apply power to the custom PCB and measure the clock signal on the PCB with a voltmeter. Determine if this reading makes sense. For example, if you have a pull-up resistor connecting the clock signal to 3.3V on your PCB, you should read 3.3V. Similarly, if you have a pull-down resistor connecting the clock signal to ground, you should read 0V. If the signal is floating, you may want to try connecting pull-up/down resistors (for example, 10K ohm) to ensure the signal goes fully to 3.3V (pull-up) or 0V (pull-down). If the signal is somewhere between these two voltages, there is a voltage divider present, which means something on your PCB is connecting the clock signal to 3.3V or ground.

Another test of the PCB is to power off your custom PCB and set you multimeter to read ohms. Measure the resistance between the SPI clock and 3.3V (or whatever the main power supply is) and also measure the resistance between the SPI clock and ground. If you read near 0 ohms for either of those, you may have a short on the board.

To test the Pi, disconnect it from your PCB and measure the SPI signals with an oscilloscope. Measure at least two signals to confirm that the SPI port is doing something before determining whether the clock signal is working.

Another thing to check, have you done any OS updates (or other software updates) to the Pi? If so, this may have impacted the behavior of the SPI.
 
Top