Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: OT: I2C question for the expert

2005-05-17 by Ken Wada

--- In lpc2000@yahoogroups.com, "Gus" <gus_is_working@y...> wrote:
> Hello,
> 
> I need to move data fast between 2 I2C devices ASAP. One device is a 
> PIC18F458 micro and the other is an LPC2114 micro. 
> 
> 1) Is it best if I set up one as a slave and the other as master or 
> it is better to set them up both as master/slave?
The fastest possible way, and the most straight-fwd, given your line 
of questions...is to ALWAYS rig up ONE master, and everything else as 
SLAVES.

> 
> 2) It seems to be too slow to do stop/start conditions when sending 
> data. If data is going both dirrections at the same time, is there a 
> way to come over start/stop condisions?
Yes, If you have a single MASTER, multiple slave system, then the 
master can always send a repeat start condition, this will maybe save 
a few microseconds...not much, but it is a bit more efficient...

> 
> 3) What address am I allowed to use on I2C? Is there legal issues on 
> using sertain I2C addresses? I can only use 7-bit addressing
There are no legal issues with I2C addresses. You can pretty much use 
any 7-bit address you want. You need to be wary though. If you use ANY 
address, then you will then be unable to use the wide plethora of 
currently available I2C silicon there is out there!

Another brief note about multi-master systems...

Multi-master systems are a pretty cool, yet fraught with pitfalls, 
feature of I2C. In other words, very tricky, but very rewarding once 
you have the system fully debugged.

There are only four modes you need to deal with for multi-master 
systems. They are:

--> Master transmit
--> Master receive
--> Slave transmit
--> Slave receive

Non-intelligent I2C devices ALWAYS communicate slave transmit and 
slave receive modes. In general, when I program up a multi-master 
system, I usually create four (4) separarate buffers. One buffer for 
each mode of operations. In this way, you will, (at the expense of 
memory), will be able to create a pretty efficient multi-master I2C 
device driver....

Do not worry about contention in a multi-master I2C using the LPC2xxx 
device. The LPC2xxx silicon is modeled after the venerable Philips 
80c5xx chip. This I2C silicon has every single I2C vector that is 
defined in the I2C specification! Including generating interrupts on a 
contention violation!

Hope this long-winded explanation helps.

Ken Wada

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.