Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I2C Communication Between two Micorcontrollers

Status
Not open for further replies.

sadashiv_sm

Member level 3
Joined
Mar 23, 2004
Messages
64
Helped
6
Reputation
12
Reaction score
3
Trophy points
1,288
Location
Mumbai,India
Activity points
549
iic half-duplex communication

Hello Freinds...

is it possible to do I2C Between Two Microcontrollers???
If yes
How To do this....??

this was one of the interview question i am not able to answer. :-(

Thanks

Sadashiv
 

The communication between two controller is Master and slave mode right. whether it will work on Full duplex mode?
 

this is can concepet .
i did number of times.
1] use serial master and slave config using 9th bit
2] use polling concept bet 2 / 3 lines
3] using timers i.e set as ext. timers , start / stop logic

this is the well know methods and well run , each has its own imp.
 

Since I2C supports multimaster mode, you can implement master and slave sw modules on the same microcontroller. This way the communication can go both ways, the master of a microcontroller addresses the slave of the other and vice versa. Take care to implement also the arbitration, in case both masters want to transmit in the same time!

Best Regards
 

don't forget that in one i2c bus the communication will be half duplex (arbitration). It can be either way (one master the other slave, master can read or write to slave)
 

Some microcontrollers have I2C slave hardware and some don't. If the uC doesn't have the I2C slave hardware, it can be replaced with firmware. However, in most cases firmware implementation of I2C slave is highly impractical.
 

If you need some detailed info about I2C, please, look into application notes on the Silabs (Cygnal) site. Few moths ago, I wrote some 8051F01x I2C code based on these documents.
As I remembered, l also googled some nice document made by Michrochip which includes waveforms, detailed description of this topic and discussing some details about procedure, how to wait for an answer from slave. Maybe, I could find it somewhere if you really need it.
IMHO, I2C is my contemprorary favourite for short - up to 30 cm - distance, because I am really tired to solve an arbitration by software itself - for example, by 9-th bit of RS232, as mentioned above. I2C makes it by the HW and SW together and if you lost the arbitration, you can easily wait for free I2C link - of course, it is supported by HW on Cygnals too -, and try to "win" next time. All code is then interrupt driven state diagram which is "half duplex", but allows you to recognize Tx and Rx states. Broadcasting - aka general calling address - is also possible.
Last but not least,there is also Philips's application note AN255 about I2C describing a long distance I2C link (hunderds of meters). Very interesting reading at all. (But now, I am trying to build low cost duplex optical link - <20$ - up to 10 meters & 3Mb/s, so I have not time to try now.)
Jan
 

hi

you must got your answer by now as my fellows have already answer your question. I would simply say that communication between to ucs is just easy like when you use a mc to communicate serially with any i2c chip. you can use both either in ful or in half duplex mode. one will be master and one will be slave.

regards
 

Pardon my ignorance but what is I2C? I've been trying to follow this thread but I don't understand what is being talked about
 

the Inter-Integrate Bus IIC bus or I2C Bus is a communication Bus developed by phillips, and it can communicate betwen 2 or more devices, it uses just 2 lines, serial Data line or SDA and the serial clock line or SCL (some times its called SCK) to connect to the devices... each device has an unique address to ID over the bus...

you can find the I2C spec at...
**broken link removed**
 
fast_learner said:
Pardon my ignorance but what is I2C? I've been trying to follow this thread but I don't understand what is being talked about
Apologies for a link to Wikipedia, but here's a summary on I2C and its capabilities: https://en.wikipedia.org/wiki/I2C
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top