update SPI commands and interaction protocols authored by Mona Angelina Raphaela Schappert's avatar Mona Angelina Raphaela Schappert
......@@ -4,15 +4,33 @@ During SPI interaction we disable interrupts as to reduce the risk of the SD car
## Commands
Our implementation realizes a subset of all possible SPI commands, namely the commands required for setting up SPI communication (namely `CMD0`, `CMD1` `CMD8`) and commands needed to read from and write onto an SD card (`CMD17` and `CMD24` respectively).
| Command | Name |
| ------ | ------ |
| CMD0 | GO_IDLE_STATE |
| CMD1 | SEND_OP_COND |
| CMD8 | SEND_IF_COND |
| CMD17 | READ_SINGLE_BLOCK |
| CMD24 | WRITE_BLOCK |
Our implementation realizes a subset of all possible SPI commands, namely the commands required for setting up SPI communication (namely `CMD0` and `CMD8`) and commands needed to read from and write onto an SDHC SD card (`CMD17` and `CMD24` respectively).
| Command | Name | Description |
| ------ | ------ | ----- |
| CMD0 | GO_IDLE_STATE | Reset or initialize SD card |
| CMD8 | SEND_IF_COND | (TODO concise description) |
| CMD17 | READ_SINGLE_BLOCK | Reads block of 512 bit size. If SDSC card is used, a custom block length can be set by a BLOCK_LEN command. |
| CMD24 | WRITE_BLOCK | Writes block of 512 bit size. If SDSC card is used, a custom block length can be set by a BLOCK_LEN command. |
## Interaction
### Initialization:
Before we can interact with our device we need to run `CMD0` and then `CMD8`. In case of a non-expected response, a step is repeated.
1. `CMD0` with argument `0x0` and CRC `0x95`. Expected response: `0x01`
2. `CMD8` with argument `0x000001AA` and CRC `0x87`. Expected response: `0x01`, and a subsequent echo of the argument.
TODO: 0x1AA seems to be a common value, others also possible, investigate best practices.
### Reads:
TODO
### Writes:
TODO
## Schematics
......
......