-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
rp2 import PIO, StateMachine, asm_pio -> Info -> Black Cat in a Coal Bunker #7117
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
Comments
It's set_base=Pin(x), sideset_base=Pin(x), in_base=Pin(x), out_base=Pin(x). But jmp_pin=Pin(x) |
@robert-hh ps. it's years since I did Z80 - but I did have Zaks :) |
Another Ureka - moment
from rp2 import PIO, StateMachine, asm_pio
from machine import Pin
@asm_pio(set_init=PIO.OUT_LOW, out_init=PIO.OUT_HIGH, sideset_init=PIO.OUT_LOW)
def foo():
pass
sm0 = StateMachine(
0, foo, freq=2000, set_base=Pin(15), out_base=Pin(17), sideset_base=Pin(16)
)
sm0.active(1) No Errors @robert-hh |
@robert-hh |
@kevindawson I think the "logic" is that the |
@lurch But it is No Good, stuck in here (#7177)
|
@kevindawson Glad I could help 😃 (my knowledge comes from my recollection of the private discussions that occurred during the development of the MicroPython rp2 port)
That's @dpgeorge 's responsibility. But I have just noticed that part of the problem is in the documentation created by Raspberry Pi, so I've just created a separate issue for that raspberrypi/pico-feedback#142 |
I've added a note to the v1.15 release issue (#6832) linking to the issue (#6855) talking about the rp2-port documentation. I agree it would be good for there to be more rp2-port documentation. However as @lurch says we view this as a responsibility of the MicroPython developer team rather than something Raspberry Pi is going to be doing going forward. |
So we have a few names and tasks:
And obviously the whole community for testing, helping, misunderstanding and asking. Who else? |
While we're happy to accept PRs for the http://github.com/raspberrypi/pico-micropython-examples repo — and larger examples with the appropriate README.adoc files might well then get pulled into the PDF documentation in the App Notes appendix. We're not anticipating writing further general documentation of the MicroPython rp2-port beyond that. We will of course fix errors or problems in the existing documentation. There may be further books from Pi Press, however that's a separate proposition. |
Sorry, what do you mean by "USP" here?
There is already PIO documentation in the current book, "Get Started with MicroPython on Raspberry Pi Pico", which was published when Pico launched by Pi Press. There may well be further books coming out, but I have no insider knowledge of their publication schedule. I can't speak for them. What I can say is that you should not anticipate further technical documentation beyond the existing "Raspberry Pi Pico Python SDK" book from Raspberry Pi (Trading) which was published at launch to accompany Pico. There is PIO documentation in that book also, which should be read alongside the "RP2040 Datasheet" and "Raspberry Pi Pico C/C++ SDK" books which are the definitive sources of documentation (looking mainly at the RP2040 datasheet there) for PIO on RP2040. |
The C SDK Docs are 301 pages long. The MicroPython docs are 47 pages long and contains errors and inconsistencies, with nobody willing to do any work to improve the situation. There are PIO features which I 8AD6 can understand from the RP2040 docs, but knowing how MicroPython implements them has involved going in the source files and reading C code, which defeats the point of using MicroPython. As an example, try to find how to "pull" with "Blk" (block) set. Nothing in the MicroPython SDK docs. Reading https://github.com/micropython/micropython/blob/master/ports/rp2/rp2_pio.c along with a little trial and error and I figured it out. But there is other stuff I can't. All in all I've found MicroPython ... particularly PIO on the rp2 a frustrating experience. |
FYI there are in-progress docs for rp2 PIO at #7496 (This is part of MicroPython's participation in the Google Season of Docs project). As you can imagine this is a complicated feature and not easy to document. Contributions welcome! Even if you don't feel like making a docs PR, just raising an issue with "I figured out this thing with PIO, might be useful to someone else" is worthwhile. |
from - Raspberry Pi Pico Python SDK (2021-04-07)
The idea is that for the 4 sets of pins ( in , out , set , sideset , excluding jmp ) that can be connected to a state machine,
there’s the following that need configuring for each set:
Sample code:
it just produces errors
I can find info -> machine -> https://docs.micropython.org/en/latest/library/machine.html
but info for rp2 -> null
looking in the rp2 stubs - StateMachine
Ureka - moment - there NO set_pins in StateMachine instantiation
looking in the rp2 stubs - asm_pio
Just hit the brick wall:(
Any chance someone that knows can put a working example up:
The idea is that for the 4 sets of pins ( in , out , set , sideset , excluding jmp ) that can be connected to a state machine,
there’s the following that need configuring for each set:
or do I need to add a documentation request -> Roadmap to next release v1.15
Thanks in Adv.
The text was updated successfully, but these errors were encountered: