Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32-S2/S3 unable to do 3-wire SPI #6141

Closed
skerr92 opened this issue Mar 11, 2022 · 1 comment · Fixed by #6191
Closed

ESP32-S2/S3 unable to do 3-wire SPI #6141

skerr92 opened this issue Mar 11, 2022 · 1 comment · Fixed by #6191
Assignees
Labels
bug esp32-s3 espressif applies to multiple Espressif chips
Milestone

Comments

@skerr92
Copy link

skerr92 commented Mar 11, 2022

CircuitPython version

Adafruit CircuitPython 7.2.0 (local dirty build) for ODT Branch ESP32-S2

Code/REPL

import board, busio, digitalio

cs = digitalio.DigitalInOut(board.D4)
cs.direction = digitalio.Direction.OUTPUT
cs.value = True

spi = busio.SPI(board.SCK, MISO=board.MISO) # SCK = GPIO35 MISO = GPIO37

while not spi.try_lock():
     pass

spi.configure(baudrate=5000000, phase=0, polarity=0)
cs.value = False
result = bytearray(4)
spi.readinto(result)
cs.value = True
print(result)

Behavior

Returns a ValueError: No MOSI Pin on the spi.readinto(result) line. Anecdata tested on an ESP32-S3 Dev Kit and it returns the same ValueError. Dan tested on other CircuitPython devices like those that use Atmel and nRF chips without issue. It appears to only affect ESP32-S2/S3 devices.

Description

No response

Additional information

No response

@skerr92 skerr92 added the bug label Mar 11, 2022
@tannewt tannewt added espressif applies to multiple Espressif chips esp32-s3 labels Mar 11, 2022
@tannewt tannewt added this to the 7.x.x milestone Mar 11, 2022
@ladyada
Copy link
Member

ladyada commented Mar 12, 2022

fyi you can also use bitbangio while-u-wait !

@tannewt tannewt self-assigned this Mar 23, 2022
tannewt added a commit that referenced this issue Mar 24, 2022
Simplifying the checks fixed it.

Fixes #6141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug esp32-s3 espressif applies to multiple Espressif chips
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants