I2C, SPI, EPROMS and ADC. I'm a bit lost
Nick Mueller
Posts: 815
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
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
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
http://www.maxim-ic.com/products/i2c/index.cfm?CMP=3835
I'm using a MAX1237 (12bit) in my project at the moment.
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.
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.
> 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
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.
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com - a new blog about microcontrollers
> 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.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--DFaust
One channel you could sample at up to 20ksps [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com - a new blog about microcontrollers
> 20 bits to be exchanged.
Yes, sorry, I wasn't precise enough.
Also with the (E)EPROM. But that was obvious.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO