micropython / micropython/micropython

Lacking support for multiple spi devices on the same bus

Open
#6,340 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

port-esp32
Dominant language
C
Stars
22.1k
Forks
9k
Avg merge
6d 4h
Merged PRs (30d)
16

Description

Important: The platform Im working on is the Doit esp32 devkit v1.

Iv'e come from a c++/Arduino background where if I want to use multiple spi devices on the same bus i just need to manage their slave select pin and use SPI.beginTransaction to set various speeds. However, in micropython there is no such thing as SPI.beginTransaction and I didn't find any custom drivers that ported the Arduino core SPI to micropython. Therefore, Im stuck with using init and deinit to imitate SPI.beginTransaction and SPI.endTransaction and the problem is it doesn't work. the sensors stop working completely.

As for the reason I need such functionality:

I want to power an ili9341 TFT LCD and use both its touch and graphics capabilities and a MAX7219 seven segment display. In arduino I could just assign them the same spi bus(MISO, MOSI, SCK) for example vspi (23,19,18) and manually enable them through their slave select pin. However I dont see it possible with micropython.

Am I missing something obvious ? or does such a feature not exist in micropython ?

I can't attach .rar files for some reason so i will happily send anyone who asks the code.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the MicroPython SPI API and the ESP32 port behavior described in the issue, focusing on how multiple devices share a bus and configure different speeds. Done means establishing whether shared-bus support is missing or documenting a working approach for the ILI9341, touch controller, and MAX7219 use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.