How to use SPI (Serial Peripheral Interface) in AVR Microcontrollers


Posted on Feb 6, 2014

SPI stands for Serial Peripheral Interface and it is the simplest among all the communication protocols. 8bit data registers in the devices are connected by wires. These data registers works as shift registers and one of the device controls the data exchange inside the SPI Network. The device or devices that controls the operation inside the netwo


How to use SPI (Serial Peripheral Interface) in AVR Microcontrollers
Click here to download the full size of the above Circuit.

rk is known as the Master. For more elaboration, you may read the Wikipedia article: Serial Peripheral Interface Bus. There can be multiple Masters in a system. There may be multiple slaves too. The slave need not to be another micro controller. It can be an SD card, or some display device or may be some other electronic circuit. Irrespective of the device attached as a slave, it needs to get selected by master device(s) for data transfer. If the system is a multi-master network, then each individual secondary master needs to be selected for mastering the SPI BUS. An SPI bus consist of two DATA lines, one clock line, and device select (or slave select) lines. The clocking signal is generated by the master in the network. Here, in this experiment, one system is build up to receive any character transmitted in the SPI. And it displays the character on the LCD display. So the receiver circuit is essentially a slave. As the receiver system will never transmit any data, we can keep it enabled all the time. There would be a master device that will transmit a string of character, either once, or repetitively. So let`s see, what are the available resources for this communication. When a serial transfer is complete, the SPIF Flag is set. An interrupt is generated if SPIE in SPCR is set and global interrupts are enabled. If SS is an input and is driven low when the SPI is in Master mode, this will also set the SPIF Flag. SPIF is...




Leave Comment

characters left:

Related Circuits

  • New Circuits

    .

     


    Popular Circuits

    600 watt audio amplifier (LM4702)
    Dual Power Supply 15V
    low power switching regulator
    1993 vw passat electrical schematic
    High Current LM317 CV Power-Supply
    Levitron Design
    Complete SS Laser Power Supply Schematics
    Multi-point circuit diagram of a remote control switch
    Switching power supply circuit with STK6303
    Analog switches carrier suppression amplitude modulation circuit



    Top