259
Software SPI – Interfacing MCP4921
Software SPI is the only solution in absence of USI/USCI modules. We need to code every step after
studying device datasheet since there are four modes of SPI communication and we need to be sure
which modes are supported by the device we are trying to communicate with. It should be noted that
software SPI is not as fast as hardware-based SPI and this become more evident when software SPI is
used to drive displays like TFTs, OLEDs, dot-matrix displays and monochrome displays like the one
shown below. Software SPI may encounter issues due to glitches if improperly coded.
However, for a beginner, software-based SPI is good for understanding the concept behind SPI
communication. Shown below is a typical SPI bus timing diagram. As you see it is simply a pattern of
ones and zeroes. Digital I/O can generate these patterns if coded.