LoPy4 reuse SPI pins?
-
I am designing a complex circuit with the LOPY4 which requires both I2C and SPI and I am running out of spare GPIO pins.
Is it possible to use the MISO,MOSI and CLK lines connected to the Sigfox/Lora radio module if I run individual chip select line to each of my own SPI devices using the available GPIOs?
Essentially I didn't want to use up all of my GPIO allocations on an additional SPI interface if I can reuse the one provided and ensure that each SPI device has a separate GPIO chip select.
It looks like the radio module has an SPI chip select on GPIO17, so if this is set as disabled, I assume the SPI bus is then free and I could use my own SPI devices via these pins?
Thanks.
-
@electrozest If you can avoid a collision, then it may should be possible, especially if you do NOT change the SPI mode. I do not know, how the radio driver is implemented. But as a first guess, I would not expect to reconfigure SPI on every use.
-
@Electrozest what you want can be done in theory, but we haven't tried it ourselves. In principle you would have to limit the use of the shared SPI bus and be careful that the LoRa stack is not busy with anything while you communicate with your other slave. We could offer support for this and modify our code base if needed to make it work. Let us know.
-
Thanks @daniel and @robert-hh and thank you for the offer of support and potential of modifying code base.
I decided to use a PCA8575 16 bit I2C I/O expander as it solved the I/O problem without adding too much to the bill of materials, so I left the SPI pins for the Lora/Sigfox radio not connected.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login