Jump to content
Sign in to follow this  
wasson65

I2C Lans and Wans between MSP430's

Recommended Posts

Warning: Long Post coming...

 

One problem with the I2C bus idea on the robot is that it creates a possible choke point. Also, many interesting I2C devices have limited addressing options. Plus, biologically complex systems have a hierarchy of connections between different systems and subsystems.

 

So I'm planning to have several different levels of I2C busses, and connect the MSP430 to one of the busses at a time via a dual 2bit-to-4 analog switch, using 2 output pins to select which of the 4 busses I want to connect to. Because the bus has external pullups and the traffic will all be broadcast, there's no problem if a chip decides to ignore a bus for a little while.

 

Each MSP430 would have a maximum of 4 I2C busses to use:

1. Private LAN - for this subsystem's use only. A handful of devices on this bus, generally slaves, used only by this controller.

2. Lower WAN - This bus is for subsystems that are "below" me in terms of the robot's nervous system.

3. Peer WAN - This bus is for my 'peer' subsystems that are at the same level of generalization as this subsystem.

4. Higher WAN - This bus is for communicating with subsystems that are higher up the nervous system than I.

 

Each layer's Higher WAN is the same WAN as the higher layer's Lower WAN.

 

Here's an initial stab at the layers of abstraction:

 

Conscious Brain:

Higher WAN: None

Peer WAN: Morality Module

Lower WAN: Navigation

 

Navigation:

Higher WAN: Conscious Brain

Peer WAN: Emotions modules

Lower WAN: Navigation Goal, Obstacle Detection

Private LAN: EEProm

 

Navigation Goal

Higher WAN: Navigation, Emotions modules

Peer WAN: Obstacle Detection

Lower WAN: Motion Control

Private LAN: EEProm

 

Motion Control

Higher WAN: Navigation, Emotions

Peer WAN: Tail Control, Head Control

Lower WAN: Steering Control, Speed Control

 

Steering Control

Higher WAN: Motion Control, Tail Control, Head Control

Peer WAN: Speed Control

Lower WAN: NONE

 

The lowest level "reflex" subsystems will only have their Private LAN, Peer WAN, and Higher WAN.

 

The middle layers of subsystems (spinal cord, brain stem, emotions) would their Private LAN, Lower WAN, Peer WAN, and Higher WAN.

 

The top layers (the real 'brains') will have Private LAN, Peer WAN, and Lower WAN.

 

Example:

The "historical path" subsystem might have a LAN with a compass and an EEPROM on it, and take readings from the compass and store them in the EEPROM. Then it would be connected to a Peer WAN, where it could communicate with other low level subsystems, and a Higher WAN, where it could broadcast data like "we have completed a 360 degree turn".

 

The "Navigation Goal" subsystem may have nothing on it's private LAN, and could hear the "360 degree turn" info on it's Lower LAN, and broadcast an event "circular search pattern completed" on the Higher WAN.

 

The "Find Home" subsystem can see the "circular search pattern completed" on it's Lower WAN, and then broadcast "Send obstacle data" event on it's Lower WAN. An ultrasonic obstacle detector could respond with an "obstacle bearing and distance" event. The "Find Home" subsystem could then send another event on the Lower WAN saying "New Navigational Heading Goal", which could be picked up by the "Navigation Goal" subsystem on it's Higher WAN and broadcast "change heading to" on it's Lower WAN, where the motor controller would see the event on it's Higher WAN and decide if the best thing to do is to turn slightly or stop and perform a 3-point turn. Then the "Find Home" subsystem would send an event on it's Higher WAN saying "Trying to get home", and the brain could see that the robot is responding to the "let's go home" event he had broadcast on his Lower WAN.

 

This mimics the biological systems where you can communicate with peers and one layer up and down, but you don't talk directly from the lowest level reflex actions to the conscious brain, but instead go through generalizing layers, where the abstraction level of the concepts get higher as you approach the brain.

 

Thoughts?

Share this post


Link to post
Share on other sites

Are you familiar with adapter pattern?

It seems that most of your problems come from different implementations/behavior of I2C devices and some specific needs you have. I would try to isolate those devices as much as possible using LP as an adapter between a device like motor, sensor, etc., and the rest of LPs. Each adapter would know how to "speak" to the device, but would communicate with other LPs using some other protocol. Basically there would be a layer of abstraction between nervous system and the end device. This way you could develop your own protocol that suits your needs and would not have to worry that some I2C devices do not have addresses. You could also add some sort of arbitrator to control the flow of information between most important parts of the system. One rouge LP pulling line down could hose all other devices.

 

Hmmm, I have a spare Roomba in my garage, maybe I should use your project as an inspiration to revive it.

Share this post


Link to post
Share on other sites

I am building a robot similar to this. I have dedicated UC controlling the motors, sensors and displays (to be implemented). they then communicate with a brain with a can bus using a chip from Microchip. I forget the number but you can communicate to it usin SPI

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×