Using Serial Peripheral Interface (SPI) Master and Slave with Atmel AVR Microcontroller

Sometimes we need to extend or add more I/O ports to our microcontroller based project; the question is how fast the response we need for these new I/O ports. Because usually we only have a limited I/O port left than the logical choice is to use the serial data transfer method; which usually only required maximum one to four ports for doing the data transfer. Currently there are few types of modern embedded system serial data transfer interface widely supported by most of the chip’s manufactures such as I2C (read as I square C), SPI (Serial Peripheral Interface), 1-Wire (One Wire), Controller Area Network (CAN), USB (Universal Serial Bus) and the RS-232 families (RS-423, RS-422 and RS-485). The last three interface types is used for quiet long connection between the microcontroller and the devices, up to 1200 meters for the RS-485 specification, while the first three is used for short range connection. You could read more information at ermicroblog