Community

SPI bus per device or?

What is the expected way of managing multiple SPI devices with different clock and speed settings? I have MAX31856 breakout connected and working with Meadow with my own driver. Now I’m going to add a second MAX31856. Do I create one SPI bus and share it with those two or do i create two bus instances? They use the same clock settings.

Third device will be a OLED screen also a SPI device but it will use different clock settings and speed.

On arduino or system.io.gpio the clock settings and speed are set on the device side but the Meadow API would imply that you have one SPI bus instance for multiple devices but that wouldn’t allow setting speed and clock settings per device.

I haven’t explored it deeply but I suspect you’ll need to use the same speed and mode across SPI devices.

At a minimum you’ll need to enable / disable devices as you communicate using each device’s chip select pin (which I’m guessing you already know).

I’ll try and do some testing over the next week or two and if you try anything I’d love to hear the results.