Professional Documents
Culture Documents
College of Electronics Technology Bani Walid: Presented By: Mohamed Awad Mohamed Abolobaidh
College of Electronics Technology Bani Walid: Presented By: Mohamed Awad Mohamed Abolobaidh
College of Electronics Technology Bani Walid: Presented By: Mohamed Awad Mohamed Abolobaidh
BANI WALID
Presented By:
Mohamed awad
Mohamed abolobaidh
Serial Peripheral Interface
(SPI)
Advantages
1_Full duplex communication
2_Less power consumption as compared to I2C
3_Higher hit rates (or throughput)
But there are some disadvantages as well, like higher number of
wires in the bus, needs more pins on the microcontroller, etc.
SPI four pins used to connect to aMISO MOSI SCK SSand these
pins be present in the PORTB
3_SS This stands for Slave Select. This pin would be discussed
in detail later in the post
SPIF
In master mode, this bit is set in two situations: when a serial
transfer is completed, or when SS pin is an input and is
driven low by an external device. Setting the SPIF ag to one
will cause an interrupt if SPIE in SPCR is set and global
interrupts are enabled.
WCOL
The WCOL bit is set if you write on SPDR during a data transfer.
SPI2X
When the SPI is in master mode, setting this bit to one doubles
the SPI speed.
The SPI Data Register (SPDR)
REFRENCE
MazidiAVR