Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Spi,i2c

Status
Not open for further replies.

uC000

New Member
I am new to uC world. Why an 8051 sends/receives through the SPI as well I2C interfaces?. why not all SPIs or all I2Cs?. Is it because of the peripherals that are some SPI and some I2C?.:p
 
Precisely that... Phillips brought I2C into the world for chip to chip communication.... Can't travel very far, but can have many nodes... There are as many SPI devices as I2C devices... Most micros have a single module that can be configured one way or the other.... Sometimes the device you need may only be available in one version..

I had an instance once where I needed SPI SRAM... But I also needed an RTC but the devices I wanted were not the same bus... I had to bit bang the SPI and use the MSSP module for the I2C...
 
It all has to do with the peripherals that are available on the chip.

The original 8051/8052 did not have an SPI or an I2C port. However, some of the modern 8051 derivatives do have the SPI/I2C hardware. Atmel's AT89S8253 has a port that does SPI only.

You can use a technique called "bit banging" to do SPI/I2C in software if you really know what you're doing.
 
so, some devices like FPGAs have SPI bus interface and some others have I2C interface. That is why micro controllers talk to one through I2C and to other through SPI. I am reading some sample codes , so..., basic stuff,...:eek:
 
so, some devices like FPGAs have SPI bus interface and some others have I2C interface. That is why micro controllers talk to one through I2C and to other through SPI. I am reading some sample codes , so..., basic stuff,...:eek:

FPGA is just a package/pinout style (Flipchip Pin Grid Array...like what a computer CPU is). Microcontrollers that come in standard PDIP packages can also have SPI and I2C ports on chip as well.
 
FPGA is just a package/pinout style (Flipchip Pin Grid Array...like what a computer CPU is). Microcontrollers that come in standard PDIP packages can also have SPI and I2C ports on chip as well.
FPGA stands for Field-Programmable Gate Array. You can program SPI/IIC/I2S/Parallel/USB/whatever protocol you want into the FPGA.

SPI and I2C have different capabilities and were designed for different purposes. SPI generally allows for much faster bidirectional data transfer with no data framing requirements, and a hardware chip select line to each SPI device. I2C on the other hand is a slower, half-duplex protocol that has framing requirements and addressing as part of it, meant for a number of devices on a 2-wire bus.
 
FPGA stands for Field-Programmable Gate Array. You can program SPI/IIC/I2S/Parallel/USB/whatever protocol you want into the FPGA.

Apparently there are two different uses for the same acronym. My bad.

SPI and I2C have different capabilities and were designed for different purposes. SPI generally allows for much faster bidirectional data transfer with no data framing requirements, and a hardware chip select line to each SPI device. I2C on the other hand is a slower, half-duplex protocol that has framing requirements and addressing as part of it, meant for a number of devices on a 2-wire bus.

Each of the two protocols have their pros as well as their cons -

I2C -

Pros - Software addressing requires only two wires to interface, software addressing, can have multiple masters as well as multiple slaves

Cons - Slower bit transfer rate, more sensitive to data path capacitance (which affects rise time), half duplex

SPI -

Pros - Faster bit transfer rate, full duplex

Cons - 3 wire interface + 1 pin for each SPI device's chip select line, can only have 1 master device
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top