Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 28th August 2008, 03:20 AM   (permalink)
Default diff bet UART & I2C

i'm new in PIC,can anyone tell me what is the different between UART,& I2C.thanks for your help
poppy2008 is offline  
Old 28th August 2008, 03:30 AM   (permalink)
Default

UARTS are used for asycronous serial communication. No clock is required and the timing of the bits is determined from the leading edge of each character. A minimal full-duplex interface requires three wires, TxD(Transmit Data), RxD(Receive Data) and Ground. The full duplex means there can be data going in both direction at the same time.

I2C is sycnronous data transfer with a data line and a clock line. It is half duplex, meaning data can only go one way at any given time.
__________________
We never have time to do it right; but we always have time to do it over.
Papabravo is offline  
Old 28th August 2008, 03:59 AM   (permalink)
Default

thanks a lot
poppy2008 is offline  
Old 30th August 2008, 07:47 PM   (permalink)
Default

adding further,
UART is a point-to-point communication i.e. only two devices talk to each other, u can not connect extra device on the same UART (unless u r using RS485 drivers/lines)!!
I2C gives freedom over that, u can connect as many as 128 devices on the same 2 wire line (with 7-bit address range), saving a lots of wiring for u!!

common use of UART is to talk outside the board using RS232, RS422 etc. drivers,while I2C is used mainly to communicate between the devices on the same board!!

----------------------
http://dharmanitech.blogspot.com
CCD is offline  
Old 31st August 2008, 09:59 PM   (permalink)
Default

Quote:
Originally Posted by Papabravo View Post
No clock is required and the timing of the bits is determined from the leading edge of each character.
I am not sure what you meant by this, I assume you mean that the clock is not part of the communciations protocol such as I2C which uses a clock from DTE to DCE? But just to clarify, a clock is required when using UARTs, whether it be an internal or external clock, it is still used. A PLL is commonly used to sync the clock with the incoming received data.
__________________
"Remember, you're special.....just like everyone else."
rezer is offline  
Old 31st August 2008, 10:20 PM   (permalink)
Default

The very name UART, being an Asynchronous communication method, is that it is not SYNCHRONIZED with a clock. Rather, unintelligent UART methods only rely on being set with the same parameters such as baud, parity, and stop bits. Intelligent UARTs(not an official name, just one I use) can look at a frame of data and determine it's parity, baud rate and stop bits by itself, but it's only used in more complex devices.

EDIT: It's also important to mention that the I2C interface supports clock stretching, where devices that need more time to receive and process data can pull the clock line low (due to being designed to be open-drain) to tell the master device that it's not ready. Though I2C can theoretically support 127 devices, your average I2C slave device can't have it's address fully configured,
__________________
Feels good, man.

Last edited by ArtemisGoldfish; 31st August 2008 at 10:29 PM.
ArtemisGoldfish is offline  
Old 1st September 2008, 12:05 AM   (permalink)
Default

Quote:
Originally Posted by ArtemisGoldfish View Post
The very name UART, being an Asynchronous communication method, is that it is not SYNCHRONIZED with a clock. Rather, unintelligent UART methods only rely on being set with the same parameters such as baud, parity, and stop bits. Intelligent UARTs(not an official name, just one I use) can look at a frame of data and determine it's parity, baud rate and stop bits by itself, but it's only used in more complex devices.

EDIT: It's also important to mention that the I2C interface supports clock stretching, where devices that need more time to receive and process data can pull the clock line low (due to being designed to be open-drain) to tell the master device that it's not ready. Though I2C can theoretically support 127 devices, your average I2C slave device can't have it's address fully configured,
True, it is not synchronized with a clock, and if you look at my post, that was not my point. Just because it's not synced with a clock doesn't mean it doesn't use one. My statement was made for clarification. It was mentioned that UARTs DON'T USE a clock. My point was, they DO use a clock it's just not synced with the data, as the name implies.
__________________
"Remember, you're special.....just like everyone else."
rezer is offline  
Old 1st September 2008, 04:33 AM   (permalink)
Default

Uh, no, if the data isn't synchronized with a clock pulse, what's the point of it? A UART only needs to work with 3 lines: Tx, Rx, and ground. The only clock signals involved here are at each device, where they both have to generate a timing signal for internal UART handling. There is NO clock signal connection between the two devices. Also, if you're referring to the clock element of the UART itself, of course it needs a clock, all electronics need a time element to actually progress in execution.
__________________
Feels good, man.

Last edited by ArtemisGoldfish; 1st September 2008 at 04:41 AM.
ArtemisGoldfish is offline  
Old 1st September 2008, 05:10 AM   (permalink)
Default

Quote:
Originally Posted by ArtemisGoldfish View Post
Uh, no, if the data isn't synchronized with a clock pulse, what's the point of it? A UART only needs to work with 3 lines: Tx, Rx, and ground. The only clock signals involved here are at each device, where they both have to generate a timing signal for internal UART handling. There is NO clock signal connection between the two devices. Also, if you're referring to the clock element of the UART itself, of course it needs a clock, all electronics need a time element to actually progress in execution.
I know there is no clock signal between the devices. That's not what I am saying. I am referring to the TX/RX clocks used to clock the bits into the shift registers. If you are talking about a data format of 8,N,1, than the receiving UART somehow has to lock on (and yes synchronize itself) to the incoming data stream. It uses a technique called center-sampling to do this. Depending on how the clock is configured, it will either use the incoming start bit or a PLL to sync the clock with the data stream.
I think you misunderstood my earlier posts. Here's the jist of it:

NO clock signal between devices. Thereby making asynchronous.
LOCAL TX/RX clocks required for shifting data in to, and out of the ports.

You may say at this point, "Well no xxxx". But not knowing the experience of the OP, I wanted to clarify the requirements of the clocks that work locally at the device because of what was said in an earlier post.

If you still disagree, feel free to provide a data sheet of a device you are referring to and I will do the same.
__________________
"Remember, you're special.....just like everyone else."
rezer is offline  
Old 1st September 2008, 09:14 AM   (permalink)
Default

Quote:
Originally Posted by rezer View Post
A PLL is commonly used to sync the clock with the incoming received data.
Sorry, but that isn't so - as it's an asyncronous process there's no clock signal to be recovered, so PLL's aren't used - and couldn't be. You use a completely separate clock at the receiving end, which needs to be close enough to remain in sync only for a single word length, as it resyncronises every start bit.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 1st September 2008, 12:06 PM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin View Post
Sorry, but that isn't so - as it's an asyncronous process there's no clock signal to be recovered, so PLL's aren't used - and couldn't be. You use a completely separate clock at the receiving end, which needs to be close enough to remain in sync only for a single word length, as it resyncronises every start bit.
Wouldn't a real UART use a Delay-Locked loop to change the phase of the baud rate's internal clock to be aboots 90 (whoops, not 45) degrees out of phase (to facilitate center-sampling), and a Fractional Baud Rate Generator to create the actual baud rate clock?
__________________
Feels good, man.

Last edited by ArtemisGoldfish; 1st September 2008 at 12:11 PM.
ArtemisGoldfish is offline  
Old 1st September 2008, 12:49 PM   (permalink)
Default

Quote:
Originally Posted by ArtemisGoldfish View Post
Wouldn't a real UART use a Delay-Locked loop to change the phase of the baud rate's internal clock to be aboots 90 (whoops, not 45) degrees out of phase (to facilitate center-sampling), and a Fractional Baud Rate Generator to create the actual baud rate clock?
I don't think any do, nor would there be any advantage - there's nothing in the received data to lock to, so why phase lock to a locally generated signal?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 1st September 2008, 04:45 PM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin View Post
Sorry, but that isn't so - as it's an asyncronous process there's no clock signal to be recovered, so PLL's aren't used - and couldn't be. You use a completely separate clock at the receiving end, which needs to be close enough to remain in sync only for a single word length, as it resyncronises every start bit.
Well it depends on the clock speed doesn't it? If the clock speed is x1 with respect to your baud rate, than a PLL would be required for synchronization of the clock to the incoming data stream because there would be no way to use center-sampling. You don't phase-lock to a locally generated signal, you are correct, but you would for the incoming signal. But obviously, if your clock is faster than your baud rate, say x16, than you don't need a PLL. To say that you could not use a PLL is not true. I have experience working on such systems that used a PLL for data sync.

But my point was simply this, a seperate clock is used at the receiving end, just as you said.
__________________
"Remember, you're special.....just like everyone else."

Last edited by rezer; 1st September 2008 at 04:46 PM.
rezer is offline  
Old 1st September 2008, 04:51 PM   (permalink)
Default

Quote:
Originally Posted by rezer View Post
To say that you could not use a PLL is not true. I have experience working on such systems that used a PLL for
I didn't say 'could' not, I said 'do' not - it would be a silly way to do it, far easier to use a higher frequency and divide down.

Do you know of any hardware UART's that use a PLL?, presumably if you have experience using such a device, it was built from scratch to overcome a specific problem?. Many of the older UART's don't even have their own clock, you have to provide it, at a multiple of that required.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 1st September 2008, 04:57 PM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin View Post
I didn't say 'could' not, I said 'do' not - it would be a silly way to do it, far easier to use a higher frequency and divide down.

Do you know of any hardware UART's that use a PLL?, presumably if you have experience using such a device, it was built from scratch to overcome a specific problem?. Many of the older UART's don't even have their own clock, you have to provide it, at a multiple of that required.

Actually you said PLLs "couldn't be" used. Read your post. And yes, many UARTs don't provide their own clock but I don't know what you mean by "...at a multiple of that required." Multiple of the baud rate?
__________________
"Remember, you're special.....just like everyone else."
rezer is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Buzzer/Speaker...What's the diff? Urahara Micro Controllers 28 31st July 2008 11:15 AM
Choosing transistors for a VCA diff pair atferrari Electronic Projects Design/Ideas/Reviews 5 5th March 2008 04:30 PM
the diff. in the applications of PIC & PLC h.d Electronic Projects Design/Ideas/Reviews 5 12th October 2007 02:22 PM
Accurate low voltage diff measurement Oznog General Electronics Chat 3 3rd May 2004 05:41 AM
npn vs pnp diff. amp mozikluv General Electronics Chat 0 27th September 2003 04:44 AM



All times are GMT. The time now is 04:20 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker