Hi,
In my design, I have 4 SPI slave devices. 1 Slave will be on the SPI_D port (Ethernet W5100) and the other 3 on the SPI_C port.
On the SPI_C port, they will all use the same MISO,MOSI & CLK but I have a separate SS for each.
They will be a :
- SD Card
- Touch Screen controller
- ??? Future enhancement
The issues I see are :
1. SS for each device. Plenty of pins and I'm guessing I need to use the "OnSPISS" Call back procedure? I have only seen one reference to this in another post and no information in the Help or either manual. Is this correct? How do I use this?
2. Different SPI Modes for each device ie
SPIorderD = MSB;
SPImodeD = 0; // Clock Phase and Polarity
SPIprescD = 1; // presc = 0..3 -> 4/16/64/128
I believe I can change the SPI Mode defines within the APP ????
3. If I use the FAT16 example as per the Help document
FAT16 = SPI_C, PortC, 2, iData; // PortX defines the SS-Port and n (6) the SS-Pin NYF
Does this mean that I don't need to handle the SS pin myself for MMC interfacing?
Just handle the SS for the Touch screen and future device?
4. Given that the system knows the correct SPI Mode details for the FAT16. Do I need to change it back each time I move from a TouchScreen SPI comms to FAT16 SPI comms?
If so, What is the SPI Mode for the FAT16?
Thanks,
Neil.
In my design, I have 4 SPI slave devices. 1 Slave will be on the SPI_D port (Ethernet W5100) and the other 3 on the SPI_C port.
On the SPI_C port, they will all use the same MISO,MOSI & CLK but I have a separate SS for each.
They will be a :
- SD Card
- Touch Screen controller
- ??? Future enhancement
The issues I see are :
1. SS for each device. Plenty of pins and I'm guessing I need to use the "OnSPISS" Call back procedure? I have only seen one reference to this in another post and no information in the Help or either manual. Is this correct? How do I use this?
2. Different SPI Modes for each device ie
SPIorderD = MSB;
SPImodeD = 0; // Clock Phase and Polarity
SPIprescD = 1; // presc = 0..3 -> 4/16/64/128
I believe I can change the SPI Mode defines within the APP ????
3. If I use the FAT16 example as per the Help document
FAT16 = SPI_C, PortC, 2, iData; // PortX defines the SS-Port and n (6) the SS-Pin NYF
Does this mean that I don't need to handle the SS pin myself for MMC interfacing?
Just handle the SS for the Touch screen and future device?
4. Given that the system knows the correct SPI Mode details for the FAT16. Do I need to change it back each time I move from a TouchScreen SPI comms to FAT16 SPI comms?
If so, What is the SPI Mode for the FAT16?
Thanks,
Neil.