|
38 | 38 | //| the microcontroller) |
39 | 39 | //| |
40 | 40 | //| .. important:: |
41 | | -//| If the same SPI bus is shared with other peripherals, it is important that |
42 | | -//| the SD card be initialized before accessing any other peripheral on the bus. |
43 | | -//| Failure to do so can prevent the SD card from being recognized until it is |
44 | | -//| powered off or re-inserted. |
45 | | -//| |
46 | | -//| Exception: on boards where another SPI peripheral has a floating CS |
47 | | -//| pin with no hardware pull-up (such as the Feather RP2040 RFM), that |
48 | | -//| peripheral's CS must be driven HIGH before SD card initialization. |
49 | | -//| Failure to do so will corrupt the SPI bus during SD card init. In |
50 | | -//| these cases, initialize and drive the other peripheral's CS high |
51 | | -//| first, then initialize the SD card. |
| 41 | +//| When the SPI bus is shared with other peripherals, every CS pin on |
| 42 | +//| the bus must be in a known HIGH (deselected) state before any SPI |
| 43 | +//| transaction occurs. This is normally guaranteed by a hardware |
| 44 | +//| pull-up on each CS line, but on boards where a co-resident |
| 45 | +//| peripheral's CS floats (for example the Feather RP2040 RFM, whose |
| 46 | +//| ``RFM_CS`` has no pull-up), that CS must be driven HIGH in |
| 47 | +//| software before the SD card is initialized. If any CS is allowed |
| 48 | +//| to float low, the SPI bus can be corrupted during SD card init |
| 49 | +//| and the card may not be recognized until it is powered off or |
| 50 | +//| re-inserted. The order in which peripherals are constructed is |
| 51 | +//| secondary; what matters is that all CS lines are HIGH (deselected) |
| 52 | +//| before any SPI transaction. |
52 | 53 | //| |
53 | 54 | //| Example usage: |
54 | 55 | //| |
|
0 commit comments