Just as an experiment I thought I'd try this...
My motivation:
Pictured above is an Allen Bradley SLC-500 PLC. We use these a lot in work to automate industrial processes. They're very expensive, and all they are is a simple motherboard connecting daughter boards. The first slot is the CPU and does all the processing, and the rest of the cards are "dumb" cards which add different kinds of inputs or outputs, counters, comms, etc. Have I mentioned that they're very expensive?
My hope is to copy this modular, "slot in" design, so someone could just slide in a new pre-programmed module in their rack. This concept could be used to add:
The whole idea is not dissimilar to the Arduino "shield" idea, but I'm using I2C to connect them instead of all the pins. The trouble with the stackable shield idea is that pretty soon you'll get two cards that want to use the same pin, and then they can't be used together. Using I2C you have a theoretical limit of 255 devices
Above you can see my half-finished product. I've used a bunch of Arduino Pros, which have a 6 pin header on one side supplying power and serial comms. This plugs into an 8-pin female header on the motherboard. The remaining two pins are the I2C pins (analog 4 and 5), which I had to bring down using some wire and a couple of pins.
Each of these cards will eventually be configured to perform a particular task
Motherboard
The motherboard itself is a bit of strip board, connecting each of the pins to the corresponding pin of every daughter board (with the exception of the serial pins, 'cos serial can't work that way).
There's a set of male headers beside every card, this basically brings out the serial pins so I can connect my FTDI board to each card for debugging (not all are wired yet).
There should also be a 3-pin header beside each board for addressing (see the next section)
Oh I almost forgot, hiding away between the two leftmost boards is an I2C RTC module. I do plan to use this later...
Addressing
In order for I2C to work, each slave device needs a unique address. I don't want to have to reprogram the individual daughter cards after they've been configured, so I've brought down digital pins 11-13 to the motherboard. These pins will be either wired to +5v or 0v, depending on which slot they're in. These 3 inputs are then used to calculate the I2C address, giving 8 possible addresses.
Demo
In the picture you can see three of the Pros connected to a Duemilanove as the main CPU. As a very simple test program I have the CPU turning on the LED on each of the expansion boards in turn, then waiting, and turning them off again, to create a kind of chaser effect.
Eventually there'll be 5 Pros connected to the backplane (I don't have enough female header strips to complete the board today). I honestly don't know what I'm going to do with it afterwards, but I think this demonstrates a good proof of concept and I hope someone can think of a good use for this arrangement :).
[UPDATED] Source code:
The code's still not quite finished yet, but it now supports all the basic pin commands, except with an extra parameter to specify the card you want to address:
CPU code - here
Expansion board code - here
More photos
As always, comments, suggestions and fan mail are greatly appreciated
My motivation:
Pictured above is an Allen Bradley SLC-500 PLC. We use these a lot in work to automate industrial processes. They're very expensive, and all they are is a simple motherboard connecting daughter boards. The first slot is the CPU and does all the processing, and the rest of the cards are "dumb" cards which add different kinds of inputs or outputs, counters, comms, etc. Have I mentioned that they're very expensive?
My hope is to copy this modular, "slot in" design, so someone could just slide in a new pre-programmed module in their rack. This concept could be used to add:
- Additional digital or analog IO
- A real time clock
- EEPROM card
- Pre-built sensor cards
- Dedicated counter modules
- GPS modules
- Ethernet, or XBee or other RF comms
- Flash storage cards
- Motor, servo and stepper drivers
- RS485 comms card
The whole idea is not dissimilar to the Arduino "shield" idea, but I'm using I2C to connect them instead of all the pins. The trouble with the stackable shield idea is that pretty soon you'll get two cards that want to use the same pin, and then they can't be used together. Using I2C you have a theoretical limit of 255 devices
Above you can see my half-finished product. I've used a bunch of Arduino Pros, which have a 6 pin header on one side supplying power and serial comms. This plugs into an 8-pin female header on the motherboard. The remaining two pins are the I2C pins (analog 4 and 5), which I had to bring down using some wire and a couple of pins.
Each of these cards will eventually be configured to perform a particular task
Motherboard
The motherboard itself is a bit of strip board, connecting each of the pins to the corresponding pin of every daughter board (with the exception of the serial pins, 'cos serial can't work that way).
There's a set of male headers beside every card, this basically brings out the serial pins so I can connect my FTDI board to each card for debugging (not all are wired yet).
There should also be a 3-pin header beside each board for addressing (see the next section)
Oh I almost forgot, hiding away between the two leftmost boards is an I2C RTC module. I do plan to use this later...
Addressing
In order for I2C to work, each slave device needs a unique address. I don't want to have to reprogram the individual daughter cards after they've been configured, so I've brought down digital pins 11-13 to the motherboard. These pins will be either wired to +5v or 0v, depending on which slot they're in. These 3 inputs are then used to calculate the I2C address, giving 8 possible addresses.
Demo
In the picture you can see three of the Pros connected to a Duemilanove as the main CPU. As a very simple test program I have the CPU turning on the LED on each of the expansion boards in turn, then waiting, and turning them off again, to create a kind of chaser effect.
Eventually there'll be 5 Pros connected to the backplane (I don't have enough female header strips to complete the board today). I honestly don't know what I'm going to do with it afterwards, but I think this demonstrates a good proof of concept and I hope someone can think of a good use for this arrangement :).
[UPDATED] Source code:
The code's still not quite finished yet, but it now supports all the basic pin commands, except with an extra parameter to specify the card you want to address:
- digitalRead()
- digitalWrite()
- analogRead()
- pinMode()
CPU code - here
Expansion board code - here
More photos
As always, comments, suggestions and fan mail are greatly appreciated
No comments:
Post a Comment