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

Add board.I2C(), board.SPI(), board.UART() for Raspberry Pi Pico board #4121

Closed
dhalbert opened this issue Feb 3, 2021 · 9 comments
Closed
Assignees
Labels
rp2040 Raspberry Pi RP2040
Milestone

Comments

@dhalbert
Copy link
Collaborator

dhalbert commented Feb 3, 2021

It would be nice to have default board busio devices on the Raspberry Pi Pico, so that many of our examples don't break. The question is which pins to pick.

In the Get Started with MicroPython on Raspberry Pi Pico book, the I2C examples use GPIO0 and GPIO1:


image

SPI uses GPIO2, 3, and 4:


image

There is no UART example.

In the Raspberry Pi MicroPython SDK book/datasheet, the default pins are different than above:
I2C:
image
SPI:
image
UART:
image

If we chose the first set, then the beginner book examples are easily translated.
If we chose the second set, then sample MicroPython code is easier to translate.

Tagging @tannewt, @kattni, and @ladyada for comment.

@dhalbert dhalbert added the rp2040 Raspberry Pi RP2040 label Feb 3, 2021
@dhalbert dhalbert added this to the 6.2.0 milestone Feb 3, 2021
@jerryneedell
Copy link
Collaborator

jerryneedell commented Feb 3, 2021

Not a big deal either way. Users have to learn to read the chart eventually ;-)
I like the first option. I expect there will be many folks following the book at first then trying CP.
Would you put the default UART on GP12 and GP13?

@ladyada
Copy link
Member

ladyada commented Feb 3, 2021

i think we try to matchy with the examples in the book, and add to the FAQ

@kattni
Copy link

kattni commented Feb 3, 2021

How ubiquitous is the SDK within CircuitPython - which is to say, how likely is the typical user to be aware of the SDK info? Our goal is to make CircuitPython as simple as possible to use. As long as everything is documented, I think it's almost irrelevant what pins we use. That said, if we think the book is going to be/already is popular, we should follow those examples for simplicity. Otherwise, we should consider what the decision means in the long run - is the SDK going to be a longer-used reference than the book?

@dhalbert
Copy link
Collaborator Author

dhalbert commented Feb 3, 2021

I think the average CircuitPython user is not going to be looking at the MicroPython SDK document. The book is much easier to read and I can imagine it being a taking-off point. So using the first set makes sense. The main thing is to document it clearly.

@kattni
Copy link

kattni commented Feb 3, 2021

As we do not have a UART example yet, please put UART on GP8/GP9. It's a UART pair, and avoids I2C and SPI suggested above.

@dhalbert dhalbert self-assigned this Feb 3, 2021
@tannewt
Copy link
Member

tannewt commented Feb 4, 2021

My vote would be to follow the book.

However, I'm not a huge fan of adding default busses when the board doesn't document them itself. At some point its on the board maker to do the designation.

@dhalbert
Copy link
Collaborator Author

dhalbert commented Feb 5, 2021

It might be a question to ask the RPi folks if they are thinking about adding default labels on the silk in the future.

@tannewt
Copy link
Member

tannewt commented Feb 5, 2021

We've brought it up with them previously but haven't heard of any concrete plans. I wouldn't expect them to designated default busses. Our main goal was to have labels similar to those on the bottom.

@dhalbert
Copy link
Collaborator Author

dhalbert commented Feb 8, 2021

Closing this after discussion in the weekly CircuitPython meeting of 2021-02-08, timestamp 1:26:18. We decided that trying to ameliorate board designs that fail to label default pins is beyond our purview. We can document the problem in the FAQ section in the RPI Pico guide. If and when the board silkscreen is updated to designate default bus pins, we can reopen this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rp2040 Raspberry Pi RP2040
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants