PDA

View Full Version : SPI on a pic without hardware SPI?



modifyit
- 25th April 2006, 14:52
Does anyone know if the Shiftout command is a software version of SPI and if it can be used to make SPI eeprom and other devices work on microchips that don't specifically have hardware SPI?

Bruce
- 25th April 2006, 16:04
Yes. Look at a few of the MeLabs examples using shiftout/shiftin for SPI EEPROM.

Ron Marcus
- 25th April 2006, 16:08
Does anyone know if the Shiftout command is a software version of SPI and if it can be used to make SPI eeprom and other devices work on microchips that don't specifically have hardware SPI?

Yep. I've used it to communicate with SD cards, ALFAT SD and SPI peripherals without hardware implementation. Pay attention to clock polarity, and if the device validates the data before the clock change,or after. The only down side, besides speed, is you can't shiftin data while you're shifting out. Many devices send data at the same time you are shifting data into them. You will also need to dedicate a pin to select the device before a transfer.

modifyit
- 26th April 2006, 13:29
Great thanks for the confirmation