OK I barely remember my first computer having serial ports for mice/keyboard and parallel ports for printers.
I understand those evolved into usb and so now we need to convert usb-2-serial for communicating with an arduino board over a USB port.
I think I understand that in much the same way, Bluetooth and wifi communication needs to be "converted" or parsed into serial as well and so their data comes in via the same serial port. I would guess the same happens with IR but I haven't done any IR examples yet.
Then I read something about being able to communicate with lcd displays via a new "protocol" named I2C which is faster.
Then today I also read, during my wifi communication attempts, that there is something better than spi.
I'm a very visual person and I'm trying to out these into perspective. Can someone clear these up for me and put them into context?
Wifi uses TCP/IP or "packet" protocol, not serial.
Marciokoko:
What about Bluetooth?
Bluetooth supports serial as one of its available protocols.
SPI is the fastest serial interface, with 16 MHz system clock it can transfer at speeds approaching 1 byte/uS (17 clocks for an 8 bit transfer) using dedicated internal hardware. The Master and the Slave can both transfer at the same time.
I2C can be pretty quick, with a 400KHz clock and different dedicated internal hardware, but there is more handshaking as part of the protocol. The master sends, the slave responds.
Serial can be faster or slower than I2C using yet a third set of dedicated hardware. There is no dedicated clock, each end starts timing from a start bit and generates 16 clocks/bit (8 clocks?) and samples the data in the middle of the bit time. The IDE serial monitor supports 115200 bits/second, the hardware will support 1MBit/second with 16 MHz system clock. Both master & slave can send at the same time, and generally need 10 bits for an 8-bit byte (start bit, 8 data bits, stop bit).
If you want really fast, than use a parallel interface - put 8 bits on a parallel port, use additional control lines to clock it into a slave device - so the bit rate just multiplied by 8 right there!
The "protocol" is how you define the message traffic and what it represents.
See my posts about I2C and SPI:
WiFi, Bluetooth, and USB are complex communications protocols that can do a lot of different things. Frequently, the easiest thing to do is wrap a "module" around them that LOOKS like a serial port. You can get bluetooth-2-serial, wifi-2-serial, and usb-2-serial modules, and they are much easier to talk to than "native" bluetooth, wifi, or usb...
Thanks Westfw. That's what I'm looking for. A condensed description of what each is and how they are related.
So wifi, but and usb are comm technologies like serial but obviously more complex, which is why they came later. Those technologies use different protocols to talk.
Spi and i2c are comm protocols? But not for standalone devices themselves but more for components in a board?
Spi is the same as Serial?
Spi and i2c are comm protocols? But not for standalone devices themselves but more for components in a board?
Pretty much.
Spi is the same as Serial?
No, not at all. Serial relies on a known clock rate (AKA the "baud rate"), SPI is self-clocked.
Marciokoko:
Spi and i2c are comm protocols? But not for standalone devices themselves but more for components in a board?
I2C is fairly widely used. For example, the Nintendo Wii's controllers use I2C. And that is not on a board as such. Ditto for the Lego Mindstorm.