Shop OBEX P1 Docs P2 Docs Learn Events
I2C, SPI, EPROMS and ADC. I'm a bit lost — Parallax Forums

I2C, SPI, EPROMS and ADC. I'm a bit lost

Nick MuellerNick Mueller Posts: 815
edited 2007-10-16 19:41 in Propeller 1
Hi!

Short description what I need:
a) A bigger EPROM, a 24LC512
b) an ADC that hooks onto the I2C bus

Now what I understood so far:
Bigger EPROM is no big deal, just have to fix the address-mask and I can read/write the upper half and leave the lower half to the boot process etc. No change in the pins A0 .. A2

Now the ADC:
I know that the I2C is TM by Philips and that they want $$$ if a vendor uses it. But there are compatibe 2/3 wire protocols. Is SPI one of them?
Or asking the other way round:
Can (and if how) I hook a ADC0834 directly to the I2C bus the EPROM is connected to? My understanding is, that I even don't need a chip select, because of a different device type. Right?

If that ADC0834 fails, what 8-bit 4 channel ADC with I2C would you recommend? Doesn't have to be fast, 10kHz sampling rate is good enough.



TIA,
Nick

PS:
It would be great to find some AppNotes here (blessed by Parallax; cast in PDF) that show solutions to those recurring questions.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!

The DIY Digital-Readout for mills, lathes etc.:
YADRO

Comments

  • LeonLeon Posts: 7,620
    edited 2007-10-16 08:52
    SPI is completely different from I2C, it's much easier to use and a lot faster. It has the disadvantage that separate enable outputs are needed for each device. You should be able to use the same connections as the EEPROM for an I2C ADC, as they will have different addresses.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • DarrenYDarrenY Posts: 61
    edited 2007-10-16 11:38
    Maxim produce a selection of I2C based ADC's.....

    http://www.maxim-ic.com/products/i2c/index.cfm?CMP=3835

    I'm using a MAX1237 (12bit) in my project at the moment.
  • RaymanRayman Posts: 14,162
    edited 2007-10-16 12:43
    AppNotes. Now, there's an idea!
  • hippyhippy Posts: 1,981
    edited 2007-10-16 13:46
    Nick Mueller said...
    I know that the I2C is TM by Philips and that they want $$$ if a vendor uses it.

    I don't believe that was ever the case ( but depends on definition of "vendor" ) and does not appear to be so now. Brian Boles of Microchip has previously been attributed with saying; Only I2C implementations in SILICON (custom or ASIC) are subject to royalty. Users of that silicon or software implementations do not have to pay any royalty, but that obviously is not an official Philips' statement.

    The only statement I could find on Philips' site about I2C Licensing says; I²C Licensing information - I2C licenses under the remaining patents in the program will be free of any royalties, for any use of the patents after October 1, 2006, without any prejudice to any claims for past use whatsoever.

    http://www.nxp.com/products/interface_control/i2c/licensing

    I don't know of any user of a device which includes an I2C interface ever having to pay a royalty to Philips for using it.
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-10-16 16:47
    > SPI is completely different from I2C,..

    So that was part two of my being lost.

    I'll pick a MAX1037 or MAX1039 for the ADC. Or look for something similar NOT from MAX. smile.gif


    > Only I2C implementations in SILICON (custom or ASIC) are subject to royalty.

    That's my knowledge too.



    Thanks,
    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-16 17:01
    One of the "vendors" to cast I2C in silicon was ATMEL. So they coined the new exotic word TWI to fool the Phlips lawyers smile.gif

    Addressing: Each I2C device type has a unique base address burned into the chip. As there are only 5 bits for this and there are more than 32 device types on the market there are many dubletts. You ALWAYS have to consult the datasheet.

    Popular devices come with two different addresses to relax this situation. The alternatvie of the chip is generally called ....A.
  • Bill HenningBill Henning Posts: 6,445
    edited 2007-10-16 17:55
    Hi Nick,

    I don't think you will be able to sample four A/D channels over I2C at 10ksps as I2C is (nominally) limited to 400kbps and there is protocol overhead.

    You'd be far better off going with any of the zillion or so SPI based A/D converters; I've mostly been using the single channel ADS7822, which for 8 bit A/D can do up to 277ksps

    say you added a multiplexer in front of it, you could actually sample four channels at over 60ksps/channel!

    Or, you could just use an MCP3204 four channel SPI A/D converter, capable of 200ksps as I recall [noparse]:)[/noparse]

    Best Regards,

    Bill
    Nick Mueller said...
    Hi!
    b) an ADC that hooks onto the I2C bus

    Now the ADC:
    I know that the I2C is TM by Philips and that they want $$$ if a vendor uses it. But there are compatibe 2/3 wire protocols. Is SPI one of them?
    Or asking the other way round:
    Can (and if how) I hook a ADC0834 directly to the I2C bus the EPROM is connected to? My understanding is, that I even don't need a chip select, because of a different device type. Right?

    If that ADC0834 fails, what 8-bit 4 channel ADC with I2C would you recommend? Doesn't have to be fast, 10kHz sampling rate is good enough.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com - a new blog about microcontrollers
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-10-16 18:50
    > I don't think you will be able to sample four A/D channels over I2C at 10ksps as I2C is (nominally) limited to 400kbps
    > and there is protocol overhead.

    Rough math:
    10ksps with 8 bits (I really don't need more bits) is 80kbps. 1/5 of the 400kbps. Nuff headroom for one port to be sampled quick, I think. If I can save those two pins for the SPI, I am completely happy with 1ksps.

    And why I don't want an other protocol?
    Saving pins (running out of them; see above), saving cogs.

    My app has quite some math running in the background shuffling data and calculating values for the next round. So I think I can need every cog I have.

    That AD-sampling is just a little task running with low priority. One ADC only needs values every few seconds, The other one around 20 times a second and the remaining two ADs are just spares that might be checked every few seconds. The EPROM will be accessed maybe every 10 seconds with few data to transmit (more or less just uptime).


    It's always a design consideration. That's why I have chosen the propeller. smile.gif


    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • D FaustD Faust Posts: 608
    edited 2007-10-16 18:57
    You mean EEPROM not EPROM right.· Just to clarify, EPROM cannot be electrically erased, it needs UV light.· EEPROM is what the prop and stamp use.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --DFaust
  • Bill HenningBill Henning Posts: 6,445
    edited 2007-10-16 19:21
    Agreed; I thought you wanted 4 ports sampled at 10ksps - which would not work, as reading a port would require approx. 20 bits to be exchanged.

    One channel you could sample at up to 20ksps [noparse]:)[/noparse]
    Nick Mueller said...
    > I don't think you will be able to sample four A/D channels over I2C at 10ksps as I2C is (nominally) limited to 400kbps
    > and there is protocol overhead.

    Rough math:
    10ksps with 8 bits (I really don't need more bits) is 80kbps. 1/5 of the 400kbps. Nuff headroom for one port to be sampled quick, I think. If I can save those two pins for the SPI, I am completely happy with 1ksps.

    And why I don't want an other protocol?
    Saving pins (running out of them; see above), saving cogs.

    My app has quite some math running in the background shuffling data and calculating values for the next round. So I think I can need every cog I have.

    That AD-sampling is just a little task running with low priority. One ADC only needs values every few seconds, The other one around 20 times a second and the remaining two ADs are just spares that might be checked every few seconds. The EPROM will be accessed maybe every 10 seconds with few data to transmit (more or less just uptime).


    It's always a design consideration. That's why I have chosen the propeller. smile.gif


    Nick
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com - a new blog about microcontrollers
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-10-16 19:41
    > Agreed; I thought you wanted 4 ports sampled at 10ksps - which would not work, as reading a port would require approx.
    > 20 bits to be exchanged.

    Yes, sorry, I wasn't precise enough.

    Also with the (E)EPROM. But that was obvious. smile.gif


    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
Sign In or Register to comment.