PIC18F to control SD card...

Thread Starter

dtvonly

Joined Dec 14, 2012
43
I am focusing on the SPI protocol for use with standard SD card where the host is the PIC18F microcontroller. The pin chip select (pin 1) on the SD card requires a Slave Select (SS) pin to be controller by the PIC18F SPI hardware. Here is my question: The PIC18F is the host to write/read to/from the SD card. However in the Master (host) mode the PIC18F does not use the SS pin. Only in Slave mode that SS pin can be used. But does that mean that in slave mode the SD card initiates communications? Or in the slave mode the PIC18F can "control" the SPI protocol as if it is still a Master; i.e. start communication by writing to SSP1BUF?
 

joeyd999

Joined Jun 6, 2011
5,283
I am focusing on the SPI protocol for use with standard SD card where the host is the PIC18F microcontroller. The pin chip select (pin 1) on the SD card requires a Slave Select (SS) pin to be controller by the PIC18F SPI hardware. Here is my question: The PIC18F is the host to write/read to/from the SD card. However in the Master (host) mode the PIC18F does not use the SS pin. Only in Slave mode that SS pin can be used. But does that mean that in slave mode the SD card initiates communications? Or in the slave mode the PIC18F can "control" the SPI protocol as if it is still a Master; i.e. start communication by writing to SSP1BUF?
In master mode, the PICs in general use hardware to control SDI, SDO, and SCK. You then define any other pin(s) to be Chip Select(s), and control them through software prior to and after SPI transmit/receive.
 
Top