@@ -43,6 +43,12 @@ pulses cease and CS is deasserted."
...
@@ -43,6 +43,12 @@ pulses cease and CS is deasserted."
##23K256 memory chip as an example of SPI
##23K256 memory chip as an example of SPI
The 23K256 is a 32KByte memory device with a limited set of commands and registers. Good exercise for doing SPI at a low-ish level, using the MicroPython machine functions and referring to eh chip's datasheet.
[Datasheet for 23K256:](https://ww1.microchip.com/downloads/en/DeviceDoc/22100F.pdf)
[Datasheet for 23K256:](https://ww1.microchip.com/downloads/en/DeviceDoc/22100F.pdf)
Set Polarity equal to zero for this chip. This is the level of the idle clock. See [SPI spec for MicroPython](https://docs.micropython.org/en/latest/library/machine.SPI.html)
Set Polarity equal to zero for this chip. This is the level of the idle clock. See [SPI spec for MicroPython](https://docs.micropython.org/en/latest/library/machine.SPI.html)
[Here is a code that works](./code/SPI_23K256/SPI_23K256.py) to store and retrieve numbers from the 23K256. All operations are written out. Next step would be to put them in functions and create a library file for this chip.
This is a nice example of a simple but non-trivial protocol for SPI.