-
Notifications
You must be signed in to change notification settings - Fork 819
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
SPI PIO SPI Slave example #104
Comments
See PR #101 for an example. |
Yeah, I need to create a SPI Slave interface that's slightly modified so the SPI peripheral won't do. I'm trying to get my head around the PIO but I'm struggling a bit and could really use an example that I can learn from. |
This is a reasonable request, but AFAIK all the RPi Engineers are too busy working on other stuff to be able to look at this any time soon. |
Thanks for the heads-up! I won't hold my breath then. |
I just transferred over #115 from pico-sdk, which is related. There is a sketch of a PIO program in there, which might give you a rough idea:
Very similar to the clocked_input example, but it ignores the clock when the chip select pin is not asserted low, and discards partially-shifted bytes if the chip select is deasserted midway. |
https://github.com/ThadHouse/picocolorsensorspi/blob/main/pio_spi/ If anybody still needs this, I built a setup that can do both input and output in peripheral mode over PIO. Basically built for a single mode of SPI, but would be easy enough to manually switch to other modes. Also uses DMA for the transactions, so they can be bigger then a single PIO FIFO. |
https://github.com/rspber/tsdesktop/tree/main/protocols/pio_spi I have a question about pio_spi working as master. Writing works fine. But reading seems to alternate colors and introduces spontaneous errors. The read speed is also important and works like it works at 2 MHz while the read speed in SPI goes up to 40 MHz. |
PIO reading problem resolved. Thanks. |
Would it be possible to get an example of implementing a SPI Slave device in PIO?
The text was updated successfully, but these errors were encountered: