SPI Application

This application allows for communication by SPI, the Serial Peripheral Interface. Use the following pinout, which is very similar to the JTAG pinout.

GoodFET SPI Flash Pinout

Clients

A Python client, goodfet.spiflash, is quite effective at reading, writing, and erasing SPI flash chips.

In addition to that, another client, goodfet.zensys, is dedicated to Zensys Z-Wave ASICs and provides read/write/erase capabilities.

Development

Prior to any transactions, the SETUP (0x10) verb should be sent to the SPI application to properly set the I/O directions.

SPI is based upon the exchange of information as a duplex transaction. As such, the READ (0x00) and WRITE (0x01) verbs are identical. Each transmits the bytes of the data buffer through MOSI, returning the result through MISO. !SS is dropped low at the beginning of a transaction, then raised after all bytes have been exchanged.

There is also a full tutorial for the SPI application.

Verbs

The following verbs are supported. The Write-Enable command is implied by those that write flash memory, such as POKE and SPI_ERASE.

Hex#defineDescription
0x00READExchange data.
0x01WRITEExchange data.
0x02PEEKRead 64 bytes from supplied 24-bit address.
0x03POKEWrite data to flash at 24-bit address.
0x10SETUPConfigure I/O pins.
0x20STARTStart a transaction.
0x21STOPStop a transaction.
0x7ENOKNo Operation
0x80SPI_JEDECGrab 3-byte JEDEC ID.
0x81SPI_ERASEErase a Flash EEPROM.
0x82SPI_RW_EM260SPI exchange with an EM260.
0x83SPI_ZENSYS_ENABLEZensys "Program enable" command.
0x84SPI_ZENSYS_WRITE3_READ1Zensys specific command that reads 1 byte of flash.
0x85SPI_ZENSYS_WRITE2_READ2Zensys specific command that reads 2 bytes of flash.