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
be able to setup SPI (or any other SERCOM func) from pins A1-A4 MatrixPortal M4 #3798
Comments
These four pins supply all the pads on SERCOM0, so it should work, but perhaps another piece of functionality is grabbing SERCOM0, or there's an error in our pin table. We will investigate - thanks. Pins: { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA06) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA07) }, Test program (EDIT: Corrected) import board
import busio
pins = (board.A1, board.A2, board.A3, board.A4)
for sck in pins:
for mosi in pins:
for miso in pins:
if sck == mosi or sck == miso or mosi == miso:
continue
try:
spi = busio.SPI(clock=sck, mosi=mosi, miso=miso)
except:
print("FAILED: clock={}, mosi={}, miso={}".format(sck, mosi, miso))
continue
spi.deinit()
print("Works: clock={}, mosi={}, miso={}".format(sck, mosi, miso)) |
Thanks for the script. I was able to find a few valid combinations. This definitely works for me. Not sure whether all combinations should work though. Adding full output in case this is a bug:
had to patch the script. |
Closing since there is not actually a bug. |
Thanks for the info! |
MatrixPortal M4 has pins A1-A4 exposed to the user, they are SERCOMs pins[1], but failed when trying to setup SPI with them.
What I did was:
And I get:
Is there a workaround?
What should I do to use pins A1-A4 for another SPI (using CircuitPython), in the MatrixPortal M4?
Thanks!
[1]: https://cdn-learn.adafruit.com/assets/assets/000/095/095/original/led_matrices_MatrixPortal_M4_Schematic.png?1601064911 )
The text was updated successfully, but these errors were encountered: