Serial communication

Status
Not open for further replies.
Hi there,

What's the difference on USART, UART, I2C and SPI and where to use which?

Can't you do serial communiation with all pins on a PIC, if you just make a function in the source code?
 
You need to read the datasheets to see the differences. These integrated hardware peripherals allow you to spend your hardware cycles on an application rather than bit banging serial communication. Using the hardware allows you to move data at higher speeds than would be possible with bit banging.

BTW you can't use ANY pin to do serial communication, you can only use IO pins to perform that function.
 
Electronics4you said:
Hi there,

What's the difference on USART, UART, I2C and SPI and where to use which?
Not much they are all boering.
Start by looking at UART on wikipedia pay attention sync vrs async.
Once you understand a UART look at the datasheets (or wikipedia) and the rest will make sense.

Electronics4you said:
Can't you do serial communiation with all pins on a PIC, if you just make a function in the source code?
Yes, you can ignore all the built in support and do what is know as bitbang (software serial interface) on any general purpose IO pin. But this loads the processor. It is better to use the built in hardware to do serial IO if the chip has it.

On the other hand it is a very good learning experience to write a bitbang routine and get it working. In practice they should only be used if the chip does not have hardware support.

HTH
3v0
 
A UART is for asynchronous signals only (like an RS232 style signal) a USART is synchronous (meaning it requires a clock line) or asynchronous. SPI and I2c are serial busses that have both physical and protocol specifications. Any USART can be used as a UART even if doesn't nativly support asynchronous operation by feeding the USART a custom clock line.
 
Hi, I'm curious too. I have read about UART and USART, I2C, SPI.
For all I know, SPI was developed to provide relatively high-speed, short distance communication using a minumum number of microcontroller pins. How fast is it? How many clock cycle for 1 byte of communication, as compared to I2C?

Since it uses hardware cycle, doesthat means my main program will execute with no delay?

Pardon me, i come from a mechanical background, I'm concern about the performance of SPI right now. I search through to web but nothing was mention. Maybe because it's common, and I would like to find out.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…