Shop OBEX P1 Docs P2 Docs Learn Events
I2C advice please — Parallax Forums

I2C advice please

Dr_AculaDr_Acula Posts: 5,484
edited 2012-04-27 22:04 in Propeller 1
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!

Comments

  • jmgjmg Posts: 15,183
    edited 2012-04-27 01:42
    If you are doing Library, be sure to cover all the i2c speeds, 1MHz and 3.4MHz exist, and there is a new 5MHz (one way) spec.
    - 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.
  • SapiehaSapieha Posts: 2,964
    edited 2012-04-27 02:10
    Hi Dr.

    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
    640 x 480 - 84K
    874 x 382 - 60K
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-04-27 03:07
    Thanks Sapieha. Is that your design or a "standard" design?

    I'm interested in hearing about other I2C layouts. There are probably many. Which is the most popular?
  • SapiehaSapieha Posts: 2,964
    edited 2012-04-27 03:11
    Hi Dr.

    It Is standard on ALL Bill Hennings and my ones PCB's

    Dr_Acula wrote: »
    Thanks Sapieha. Is that your design or a "standard" design?

    I'm interested in hearing about other I2C layouts. There are probably many. Which is the most popular?
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-04-27 04:22
    I am using mini-USB connectors which have 5v & Gnd at the ends. This way the 2 prop pins can also connect to other devices such as PS2, USB, serial, etc.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-04-27 04:54
    Hi Sapieha, do you or Bill have any I2C boards available?

    @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)
  • SapiehaSapieha Posts: 2,964
    edited 2012-04-27 05:01
    Hi Dr.

    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
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-04-27 05:13
    I'll need a RTC too. Also ADC and DAC.

    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?
  • TubularTubular Posts: 4,706
    edited 2012-04-27 05:45
    The advantage of a DIP8 format is that the I2C can be 'stacked' onto many existing boards (anything that uses the DIP8 for EEPROM). The Propeller Platform has 2 I2C dip sockets, one for I2C address 0 and one for I2C address 1.

    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.
    1024 x 768 - 95K
    1024 x 893 - 56K
  • SapiehaSapieha Posts: 2,964
    edited 2012-04-27 05:51
    Hi Tubular.

    On my RTC module You can even use DIP8 format for stacking.

    Tubular wrote: »
    The advantage of a DIP8 format is that the I2C can be 'stacked' onto many existing boards (anything that uses the DIP8 for EEPROM). The Propeller Platform has 2 I2C dip sockets, one for I2C address 0 and one for I2C address 1.

    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.
  • jazzedjazzed Posts: 11,803
    edited 2012-04-27 06:36
    Here's another solution:
    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.
  • dgatelydgately Posts: 1,633
    edited 2012-04-27 08:13
    Dr_Acula wrote: »
    I'm interested in hearing about other I2C layouts. There are probably many. Which is the most popular?


    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
  • TubularTubular Posts: 4,706
    edited 2012-04-27 14:05
    @Sapieha,

    If you have a DIP8 RTC then I have an immediate need, lets do a deal :)
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-04-27 16:00
    Some amazing ideas here.

    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.
    It has two 4 pin 0.1" space I2C connectors with pins as: GND, SCL, SDA, V+

    and from dgately (very nice boards there btw and I like the premade plugs)
    Pin 1: Power
    Pin 2: I²C Data
    Pin 3: Ground
    Pin 4: I²C Clock

    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?
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-04-27 16:28
    Using the miniUSB in a default case for PS2 has serial resistors 150R and 10K pullups. This will work with PS2 (keyboard & mouse), I2C, serial. For master USB, the 2 10Ks are linked (to save space, a solder bridge is used, or kynar wire between 2 vias) to ground. For USB master, a 1K5 is used, one end connected to 3v3 and the other to either of the io pins for LS or FS. Alternately, these 4 lines (one of my pcbs does this) can be driven by prop outputs making the whole thing configurable.

    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.
  • G McMurryG McMurry Posts: 134
    edited 2012-04-27 22:04
    Here is my project...

    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.
    IMAG1032.jpg

    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.
    IMAG1035.jpg

    I have enjoyed reading the rest of everyone's posts on this topic.

    Greg
    800 x 478 - 319K
    478 x 800 - 242K
Sign In or Register to comment.