PIC18F to control SD card...

Discussion in 'Embedded Systems and Microcontrollers' started by dtvonly, Aug 23, 2013.

  1. dtvonly

    Thread Starter Member

    Dec 14, 2012
    43
    0
    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?
     
  2. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,692
    2,756
    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.
     
  3. dtvonly

    Thread Starter Member

    Dec 14, 2012
    43
    0
    Ok. That will do. Thanks.
     
Loading...