Hi,
I would like to connect multiple SPI slave device to the 30f6014 PIC. By using the dspC how can I address these multiple SPI devices? What pin should I use for the SS addressing? Is it any definition for the “Chip Select” (“SS”) by the SPI function?
Thanks,
Victor
Connecting multiple SPI slaves to the same PIC 30f6014
Re: Connecting multiple SPI slaves to the same PIC 30f6014
As in SPI, each slave has a pin (Slave Select / Chip Select) which is directly connected to Master (without being shared with any other slave). and usually SDI , SDO & SCK pins are all shared & connected to all slaves. So in order to address any of the slave, Master simply uses corresponding slave select pin (Active Low logic) to activate/alert the slave for data transfer. if you are using PIC microcontroller with a builtin SPI module, then there is a SS pin available to be used for SPI as slave. And for using as a master in SPI, you can ignore the SS pin and can use any of the IO pin to dedicate for slave select.
Re: Connecting multiple SPI slaves to the same PIC 30f6014
Hi vkatona
The SPI libraries do not take any chip-select arguments - you should specify and control the chip-selects manually in your code. This way you can address any number of SPI devices by setting the relevant chip-select(s). You can use any normal digital I/O pins for controlling the chip-selects.
You might find the example at the bottom of the page in the compiler SPI Library help-file topic helpful.
Cheers
Dane
The SPI libraries do not take any chip-select arguments - you should specify and control the chip-selects manually in your code. This way you can address any number of SPI devices by setting the relevant chip-select(s). You can use any normal digital I/O pins for controlling the chip-selects.
You might find the example at the bottom of the page in the compiler SPI Library help-file topic helpful.
Cheers
Dane
www.dizzy.co.za (Southern African MikroElektronika Distributor)
Re: Connecting multiple SPI slaves to the same PIC 30f6014
Hi Dane,
Thanks for the guidance on this. After I made more research I got same conclusion too.
Best regards,
Victor
Thanks for the guidance on this. After I made more research I got same conclusion too.
Best regards,
Victor