I don’t have any experience with the RP2040 and its SPI port but when I look at the SH36 schematics and the RP2040 datasheet, there is one thing that jumps out at me.
SPI_MAX31865_CS
is assigned to GPI017 which has the primary function of being an SPI0 CS pins. BUT, SPI_ACC_CS
(GPIO12) is assigned as the SPI1 RX (MISO) pin:
Again, I’m not familiar at all with the RP2040’s SPI function and I don’t know how it is coded in Klipper but I’m wondering if to use the SPI function, the board must use predefined CS pins.
The obvious way to test this is to follow the suggestion from @Sineos and change from the hardware SPI to the software one (you won’t see any difference in performance) for the MAX31865 and LIS2DW.
If going with software SPI pins doesn’t work then you can check for bus contention between the two devices (ie the MAX31865 is driving the bus because it’s CS line is low when LIS2DW communications are taking place).
To check for bus contention, could you:
- Replace the PTC with a standard NTC thermistor
- Add the sensor statements for the NTC thermistor
- Comment out the MAX31865 statements
- Force the
SPI_MAX31865_CS
pin (GPIO17 on the RP2040) high
- Repeat test with both the hardware and software SPI configuration to see if there is any difference in operation
Depending on the results of this test, I would recommend looking at the SPI_MAX31865_CS
pin on the SHT36’s RP2040 (GPIO17 - Pin 28) with a DMM and see if it ever goes to a high voltage level.
I think you should you have an axis_map: x,z,y
statement as I have in my custom board with an LIS2DW:
[lis2dw]
cs_pin: PB1
spi_bus: spi1
axes_map: x,z,y
This is probably not your issue, but I use it when accessing the device.
Can you explain exactly how you made the serial connection between the Raspberry Pi and the SHT36? I’m trying to figure out how you get a serial connection of:
[mcu SHT36]
serial = /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3.1:1.0-port0
baud = 250000
restart_method = command
Could you explain this statement? Is it a complaint endemic to the SHT36 (I’ve used the SHT42 but not with the MAX31865 enabled) using one or both of the LIS2DW and MAX31865?
If it is, then it could be a design problem with the SHT36 PCB and Mellow tech support should be involved.