Each intelligent shield needs a micro controller to implement the intelligent shield protocol.
The shield system uses the I2C bus, but adds dynamic address allocation. Therefore the will never be an address conflict between shields. The I2C bus is the low-level signalling used by the intelligent shields, above they use a the same higher level protocol. The I2C bus is used in multi-master mode, to enable a shield to send an interrupt on the bus. Multi-master means that there are several nodes on the bus that can initiate communication.
Apart from the I2C bus the intelligent shield system also contains an SPI bus, though the Slave Select (SS) signal is missing. To activate the SPI bus on a shield the equivalent of a Slave Select command is sent as a command over the I2C bus.
All signals but the Shield Enable is connected as a straight bus to every shield. The Shield Enable on the other hand is connected as both an input and an output signal. Each shields Shield Enable Output is connected to the next shields Shield Enable Input. This makes it possible to enable just one shield at a time.
The dynamic address resolution algorithm uses the Shield Enable to wake each shield in order, and give a unique address to each newly enabled shield. This algorithm has the advantage that the physical layout of the shields also become the virtual layout. When programming the fourth physical shield will also be the fourth logical shield.
Higher level software
Each shield implements a higher level protocol that uses I2C. The dynamic address resolution algorithm is part of this protocol. Other functions of the higher level protocols are:
Reflection. It should be possible to ask a shield what it can do.
Configuration. Some shields can be used in different ways. For example, a motor shield may be able to drive two DC motors or one stepper motor. For such a shield the user needs to configure what kind of motor has been connected. It is also possible to configure a static address, in case you need to use the shield in an existing I2C system that does not implement the high level protocol.
Configuration is also necessary to make it easy to bind the hardware to your software. For example giving a name to a motor. You could configuring that shield one has the motor named “left” and shield two has the motor named “right”. Then just use the names "left" and "right" in your software.
Debug. During development of a shield firmware it helps if you can get debug messages.
Firmware updates. Since each shield has a micro controller we are going to need to update its firmware. To make it easy we should be able to do that through the intelligent shield bus.
Of course the higher level protocol also has commands that actually do things, such as set the speed of a motor, the number of steps to move a stepper, and so forth. The commands are standardized – it does not matter which motor shield you use, they all use the same commands.
As described above an intelligent shield can be configured with a static I2C address. After it has been given a static I2C address it can be used as any other I2C component. Thus an intelligent shield will work just fine as a shield for any system that uses I2C.
Any old shield or component that uses I2C can also be used together with intelligent shields. Just tell the new system that one, or more, I2C addresses are taken. The dynamic address resolution skips these addresses. Thus new and old can co-exist.
Furthermore, an old Arduino and shield can be made into a new intelligent shield. You just have to make a sketch that implements the commands necessary to use the old shield, and load it to your Arduino. Then the combination will make an excellent new intelligent shield. You do not have to throw away any old hardware just to use this new system.
Use existing CPU boards
This project will not build a CPU board. The idea is to provide a new, shield system...Read more »