I2C advice please
Dr_Acula
Posts: 5,484
I'm working on an idea from Rayman http://www.rayslogic.com/propeller/programming/i2c/i2c.htm and others; building a 'universal' I2C board that can connect to all the propeller boards out there using P28 and P29.
Start with eeprom, sram, real time clock, digital inputs/outputs and ADC and DAC and maybe accelerometers, humidity, temperature.
1) Hardware. There are many formats. Or as this website puts it http://www.i2cchip.com/i2c_connector.html#Bus%20Length, even Philips change the pinout every year or two. I like the pinouts on that website, particularly the 6 pin one as it has a general purpose power supply (nominal 12V) pin so you can power other boards. I'm thinking relays for instance. Make one change to that design - use two rows of 6 instead of 1. Then you can use IDC polarised headers which are very cheap http://www.futurlec.com/ConnIDC.shtml and which you can't plug in the wrong way. And the nice thing about 6x2 headers is they are backwards compatible with this single row format. IDC is nice because you can make up a single ribbon cable and crimp a whole lot of plugs along it, each plugging into a board.
2) Boards. I wonder what is out there? Things like this real time clock board http://www.futurlec.com/Mini_DS1307.shtml. Maybe one could have a board with pads for a whole range of I2C chips and you just add the ones you want?
I started designing a board. Does anyone have a favourite ADC and DAC chip? I'm thinking cheap, DIP if possible and an object already in the OBEX?
I'd like some suggestions for other I2C chips people are using as well. Thoughts would be most appreciated!
Start with eeprom, sram, real time clock, digital inputs/outputs and ADC and DAC and maybe accelerometers, humidity, temperature.
1) Hardware. There are many formats. Or as this website puts it http://www.i2cchip.com/i2c_connector.html#Bus%20Length, even Philips change the pinout every year or two. I like the pinouts on that website, particularly the 6 pin one as it has a general purpose power supply (nominal 12V) pin so you can power other boards. I'm thinking relays for instance. Make one change to that design - use two rows of 6 instead of 1. Then you can use IDC polarised headers which are very cheap http://www.futurlec.com/ConnIDC.shtml and which you can't plug in the wrong way. And the nice thing about 6x2 headers is they are backwards compatible with this single row format. IDC is nice because you can make up a single ribbon cable and crimp a whole lot of plugs along it, each plugging into a board.
2) Boards. I wonder what is out there? Things like this real time clock board http://www.futurlec.com/Mini_DS1307.shtml. Maybe one could have a board with pads for a whole range of I2C chips and you just add the ones you want?
I started designing a board. Does anyone have a favourite ADC and DAC chip? I'm thinking cheap, DIP if possible and an object already in the OBEX?
I'd like some suggestions for other I2C chips people are using as well. Thoughts would be most appreciated!
Comments
- and I'd also allow pin-splitting, so that multiple ports can run - (a common way to avoid address pack-out issues )
NXP do some BUS controllers with UFm on some pins, and FM+ on others.
So a library might want to allow a mix of speeds, on selected pins ?
Microchip has a good range of i2c ADCs, but the best specs seem to be SPI.
At 12 bits and below, you need to check the prices of small uC, with 12b ADC and i2c slave support.
On my RTC module and all Bill Hennings PCB I use that BUS config.
On some other 10 pins Bus for both I2C and SPI
Look on pic's
I'm interested in hearing about other I2C layouts. There are probably many. Which is the most popular?
It Is standard on ALL Bill Hennings and my ones PCB's
If You look on this PCB's.
Them show how it is used.
http://forums.parallax.com/showthread.php?123551-3D-rendering-of-new-Mikronauts-PCB-s-layout-by-Sapieha-Open-for-comments-(15-PCB-s-added)&p=918345&viewfull=1#post918345
http://forums.parallax.com/showthread.php?123551-3D-rendering-of-new-Mikronauts-PCB-s-layout-by-Sapieha-Open-for-comments-(15-PCB-s-added)&p=918347&viewfull=1#post918347
@Cluso, that is intriguing. So I am guessing pulling USB data lines low will not cause any damage to anything. So the worst thing that happens if you plug the wrong thing in is it won't work. What if your mouse sent 5V up a data line, could that happen? (I don't know much about USB)
For now I have only RTC. And have planing for 2 more.
I don't know what Bill planed yet.
Ps. RTC are combined RTC/RAM and optionaly Boot rom
Only one person needs to build these. Once that person is making them, everyone could use that board. I guess we need a plug/cable standard?
Rayman did a 3AD accelerometer in this format
Vanmunch did a gyro in this format
i think Vanmunch was thinking of also doing the magnetometer in same format?
I was thinking just today I need an I2C RTC in this format. I'd really love someone else to do it, happy to share the expense.
I have samples of the mill-max self stacking machined headers if you'd like some.
On my RTC module You can even use DIP8 format for stacking.
http://forums.parallax.com/showthread.php?128467-NEW-Keyboard-Mouse-i2c-for-Propeller-Platform&p=965242&viewfull=1#post965242
http://gadgetgangster.com/find-a-project/56?projectnum=333
It has two 4 pin 0.1" space I2C connectors with pins as: GND, SCL, SDA, V+ (V+ is 3.3V or 5V selectable by jumper).
The atTiny84 which ships with I2C Keybd/Mouse slave code can be reprogrammed.
Thought you might be interested in OSEPP's I2C boards that feature a pass-through 4-pin connector that lets you daisy-chain their sensor boards: http://osepp.com/products/sensors-arduino-compatible/osepp-accelerometer-sensor-module/
I picked-up a couple of these and started using them with a QuickStart board. Seem to work well.
dgately
If you have a DIP8 RTC then I have an immediate need, lets do a deal
Just a thought, when I was a kid you could get IDC to DIP parts but I only recall 16 pin ones. An 8 pin one might help if a stack was getting too tall.
@jazzed - that is a very clever board.
and from dgately (very nice boards there btw and I like the premade plugs)
Hmm. How many possible combinations are there for pin arrangements. 4x3x2x1 ?
One idea is that for all the quadcopter projects, if you decide to add another sensor you would want the plug to be as light as possible. So those sort of 4 wire pre-made cables that dgately linked to would make the connections very light.
So would stacking. Maybe you need a "stack to offboard" adapter so that you can connect a sensor that might need to be some distance away? Just a simple DIP8 to 4 pin header could work. Maybe put a whole lot of different 4 pin arrangements on such a board?
I have a 1"sq pcb that has a DS1340C (16pin with internal xtal) and 1225 battery backup. It stacks with the CpuBlade and MemBlade on tubulars open sourced panel.
I have a pcb (IIRC 0.6"sq) that has gyro, accel, compass, pressure & temp giving 10DOF, using I2C.
I have chosen to have 3v3 regulators (sot23) on my I2C boards and receiving 5V input (6V max).
BTW I have read how little power the ATTiny44A uses and think that this could be used as a simple RTC - not very accurate, but capable without an external xtal, using a large cap for backup. A weeks backp should be fine??? As a group, if we could get this working, perhaps we could use the 6pin sot version of the attiny. I already have the prop programming these attiny's.
I have my main board that supports a Propeller Spinneret. I de-soldered the connector on the Spinneret so it could be mounted on my main board. I have my own I2C bus connector that is a Molex 4-pin connector that has SDA and SCL along with +3.3V and Ground. I only use the 3.3 volts to power a PCA9554 that is on the little board on the left. Other things on that board are powered through another connector.
I have only tested this with short connectors. The Spinneret already has termination resistors, so I feel that I can only run this wiring a few inches.
I2C addresses are a problem. I have 4 PCA9554 chips on the main board already. With two addresses taken by the RTC and ROM on the Spinneret, I only have a few other addresses left.
So far, I have built two I2C boards that will connect to my main board. The one you see here is 6 open drain lamp drivers and an H-Bridge motor controller. All works fine.
The other board I have has 8 relays on it. Each can be address programmed and daisy-chained with my own little connector system. You will note that there are two Molex connectors on the little board on the left. That way I can connect two boards to my main board through I2C.
I spent a good deal of time looking for a I2C connected ADC. No luck. I ended up using the MCP3208 which takes 3 pins and is NOT I2C. I am now looking for some sort of I2C sound generator.
I have another post somewhere on these boards that describes my project. If you know how to search my authored posts, you can find it. I don't know how to find the link in the middle of writing this post -- Sorry.
The second picture is my other I2C interface relay board. Those are double relays, so I actually have 8 relays with LEDs. This board also has the double Molex connector so I can hook two of them to my main board.
I have enjoyed reading the rest of everyone's posts on this topic.
Greg