SPI & ADCs: bit-banging vs SPI.h

I just did a bit-bang library for a number of Microchip SAR ADCs. For the MCP3201 I can get a reading in 9 microseconds. This requires two bytes and is the maximum spec speed for this ADC. I use a few nops to get a nice clock.

I did bit-bang SPI for SD cards as an option in the SdFat library, the base for Arduino SD.h. I get about the equivalent of 2.5 MHz SPI clock.

My estimate is bit-bang SPI is about 1/3 as fast as full speed hardware SPI.

I like bit-bang for ADCs in ISRs. That leaves hardware SPI free for non-interrupt use.