Subject:
|
Re: Brainstorms
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Tue, 13 Aug 2002 03:22:24 GMT
|
Original-From:
|
Steve Baker <(sjbaker1@airmail.)NoMoreSpam(net)>
|
Reply-To:
|
sjbaker1@airmail#avoidspam#.net
|
Viewed:
|
1025 times
|
| |
| |
Matt Lawrence wrote:
> I think the addressing problem can be solved with random numbers and some
> serious bus scanning. Failing that, burning a serial number into each
> chip isn't that hard either. It would still require quite a bit of bus
> scanning, but even if the startup took several seconds, I don't see it as
> a problem.
I don't see how that can be - unless there is some sort of positional encoding
or use of some physical address wiring to the pins of the peripheral chips.
If I take (say) two identical motor controllers and a microcontroller and connect
them up, what is there to ensure that the 'Left' motor is always (say) motor ONE
and the 'Right' motor is always motor TWO. It's no use having a scheme to number
things that comes up with different numbers each time you reboot the system!
Wayne Gramlich wrote:
> The I2C bus is not really designed to support a bus scan.
> I'm not saying it can't be done, but I certainly haven't
> figured out how to do it. Until I see somebody who gives
> an extremely detailed description of how they do it, I will
> remain extremely skeptical. No offense is intended here.
The Philips I2C spec talks cryptically about such a system having
once existed:
"This verison of the 1992 I2C-bus specificiation includes the
following modifications:
* Programming of a slave address by software has been omitted.
The realization of this feature is rather complicated and has
not been used."
Dunno whether that means it's no longer supported - or whether it means
that it still works - but they can't be bothered to document it??!?
Then later, they list some advantages of I2C, they say:
"* Integrated addressing and data-transfer protocol allow
systems to be completely software-defined."
...so there is hope.
You can certainly scan the bus to find out what's there - that's fully
supported - but as far as I can tell, everything still has to have a
unique hardware address in order for that to work.
The scan mechanism is to send a "General Call" message - the spec says:
"When this address is used, all devices should, in theory, respond with
an acknowledge."
...and then, when they all try to acknowledge at once, the bus contention
logic shuts out all but one of them. The one that succeeds in responding
can then have it's address set by software - and then we can go back and
issue another General Call - devices that have just had their address set
don't respond to general call - so you can go around and number all of the
chips.
Well, something like that anyway - I'm not good at reading hardware specs!
So, using this mechanism, I think we can know what's on the bus - and
number them all uniquely. No random number generators needed - the I2C
bus contention mechanism "just does it".
HOWEVER, we still have the problem when there are (say) two identical motor
controllers on the bus - and numbering them uniquely allows us to talk
to one and not the other. However, there is *STILL* no guarantee that
the motors will always number themselves in the same way. So your typical
two-wheeled two-motor skid-steer robot will randomly turn left instead
of right following a reset! (Or worse, the left motor sensor and the
right motor sensor could be swapped - leading to violent spinning
instead of driving in a straight line.)
...this isn't an easy problem.
Even if you built each motor with a unique random number burned into an
EPROM, it would be hard for me to write a program for my robot and then
swap out a motor for some reason without either changing my program or
switching motors until I find a set of numbers that happen to result
in the system coming out with the same motor 'ordering'.
----------------------------- Steve Baker -------------------------------
Mail : <sjbaker1@airmail.net> WorkMail: <sjbaker@link.com>
URLs : http://www.sjbaker.org
http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net
http://prettypoly.sf.net http://freeglut.sf.net
http://toobular.sf.net http://lodestone.sf.net
|
|
Message is in Reply To:
| | Re: Brainstorms
|
| (...) [snip Philips uC] (...) The I2C bus is not really designed to support a bus scan. I'm not saying it can't be done, but I certainly haven't figured out how to do it. Until I see somebody who gives an extremely detailed description of how they (...) (22 years ago, 13-Aug-02, to lugnet.robotics)
|
53 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|