I2C Experts?

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

tsvisser

Member
Joined
Mar 15, 2010
Messages
8
Ideally, I'd love to pick someone's brain who is knowledgeable about I2C and the various development tools.  I'm not really sure that I want to invest the time into learning a full blown development environment like PIC or AVR from Amtel, but would love to know if there is a dumbed down / high level solution.  Ideally, I simply need a programmable MCU with some sort of hardware I/O board that has a couple of digital inputs and will send simple writes to the I2C slave device's registers...  so flipping a toggle switch will issue the appropriate command, flipping to another position, will issue another command, etc... That is really the extent of my needs, so a bridge with digital inputs and an I2C buss out would be dandy if one exists...

If anyone here also knows Altera's Quartus, I'd love to get ahold of you too, to get the low down on its capabilities and limitations.
 
I do have some embedded control system programming experience, but mostly work with stuff on the RS-232/422/485 buss and other industry specific / proprietary communication busses and have no experience with I2C.  Whether or not I will change my attitude about jumping in with both feet and learning more about I2C programmable MCU's sort of depends on whether or not I really need to in the future.
 
If you're looking for something quick and dirty to try some ideas give Arduino a try.

The boards are cheap (about £20 here in the UK). They are based on an ATMega328 AVR and have built in I2C, all controlled with a simple library/API, with a load of digital and analogue IO.

The development environment is very easy to work with, if you have experience of programming in any proper language you'll find it a real breeze.

http://www.arduino.cc

The nice thing about it is that it's all open source, so there are cheaper look-alike boards available which work perfectly well with the Arduino interface.

C

 
I downloaded the Arduino software and ordered a Nano off of eBay last night after doing some more research.  I love that the compiler runs in OS X, so its one less program I have to run on my Vista VM, to be honest, that is pretty much the reason I chose to go with it.  The Arduino boards are a little expensive, but I did notice some bare kit boards available or can probably even put together the bare parts necessary with various socket to DIP adapters, as this is for a product I hope to develop with an eventual commercial release.
 
sahib said:
What is your slave device and what does it do?

My first project is quite simple, just a TI DAC.  I only need to be able to engage the soft mute, put into mono mode with L/R assignment for differential / balanced outputs, switch between PCM and DSD modes, etc...  I've ordered a couple of other items from TI too, though, such as the necessary digital receivers to front end the DAC, a touchscreen controller (not for this project) and some other goodies.  In the past I've not done certain projects simply because at that time I felt the I2C integration was a disqualifying factor, but now that I've done some research, it's not such a big thing and I can leverage some of my other programming experience to help me with this facet of IC design.
 
If you are not afraid of "BASIC" (a very stripped-down version), one of the BASIC Stamps does I2C in a simple function, also reads/debounces switches, pots, many kiddie-tricks. So simple that even I was able to write and wire a non-trivial timer.
 
PRR said:
If you are not afraid of "BASIC" (a very stripped-down version), one of the BASIC Stamps does I2C in a simple function, also reads/debounces switches, pots, many kiddie-tricks. So simple that even I was able to write and wire a non-trivial timer.

I do remember BASIC with quite a bit of fondness.  It was my first programming language that I really got halfway proficient at.  Even before BASIC, I messed around with a sector editor, but didn't really know assembler well enough to know what I was doing, just using hex editors to modify registers (anyone else hack more gold in Wizardry or Bard's tale when they were younger?)  I think Arduino fulfills my needs quite nicely and would highly recommend it to anyone who has had at least some "curly bracket" style programming experience.  It's actually quite refreshing in its simplicity.
 
I am at a planning stage on a project with a friend of mine (he does the really heavy programming) and he is suggesting this Arduino too. I did not really have the time to check it out yet but seems to be pretty popular.
 
you probably checked this for arduino already.. I use it a lot (arduino that is) and the main thing with I2C is setting the right id's for communication
http://www.arduino.cc/en/Reference/Wire
http://www.arduino.cc/playground/Learning/I2C
 
Here's a little article on Arduino and gives some examples of why it beats Parallax's basic stamps:

http://todbot.com/blog/2006/09/25/arduino-the-basic-stamp-killer/

Blurb in Make Mag:

http://www.make-digital.com/make/vol07/?pg=58
 
tsvisser said:
Ideally, I'd love to pick someone's brain who is knowledgeable about I2C and the various development tools.  I'm not really sure that I want to invest the time into learning a full blown development environment like PIC or AVR from Amtel, but would love to know if there is a dumbed down / high level solution.  Ideally, I simply need a programmable MCU with some sort of hardware I/O board that has a couple of digital inputs and will send simple writes to the I2C slave device's registers...  so flipping a toggle switch will issue the appropriate command, flipping to another position, will issue another command, etc... That is really the extent of my needs, so a bridge with digital inputs and an I2C buss out would be dandy if one exists...

Forget the Arduino stuff. Get one of the Silicon Labs development boards. SiLabs micros are 8051s with a better core (most instructions are one or two clocks instead of twelve), proper I/O (none of that wacky pseudo-thing with the weird pullups, just proper totem-pole outputs), UARTs, timers, I2C, SPI, USB, onboard oscillators, a decent amount of RAM and onboard flash, a couple of comparators and on some variants, 12-bit DACs and ADCs.

You can get a C8051F310 kit for $69 -- and the bonus is that this kit includes the debug/programming dongle, which works with ALL of their devices. Most of their kits are less than $100, and you can buy just the board for generally less than $50 (the dongle by itself is only $39). Arduino doesn't offer this non-intrusive debug (the chip does but the Atmel dongle is pricey and the Arduino I last looked at didn't bring out the debug pins). The kit comes with a version of the Keil compiler which is fine but limited to 4k-byte object size (which might be fine for your experiments), and SiLabs is very supportive of the Small Device C Compiler (SDCC).

Yeah, I like their micros.

No, sir, I do not like PICs. Not one bit ...

If anyone here also knows Altera's Quartus, I'd love to get ahold of you too, to get the low down on its capabilities and limitations.

Been awhile since I've used a Brand A FPGA as we're a Brand X shop. So if you want to know what sucks about Xilinx ISE, lemme know :) Warning: the list is extensive.

-a
 
I am not going to say anything bad about 8051s, it is a widely used and respected platform, (Peavey used a lot of them for low end stuff) but there is definitely a tendency to stay with the family you learned on.

I started on PICs, and haven't found a reason to jump ship yet. While I concede the newer stuff is head and shoulders better than that early stuff I learned on. 

I suspect there are several candidates with I2C, SPI, or whatever serial com firmware built in, and reasonable instruction execution overhead.

One feature I like about the 8051 IIRC was that they had a variant with 8 bit D/A built in... Most micro's with internal A/D have a D/A string onboard, but don't give you access to it or provide more than one.

That said there are always other ways to get data out...

I'm an old analog dog, and just love the power of modern micro's.

JR
 
JohnRoberts said:
One feature I like about the 8051 IIRC was that they had a variant with 8 bit D/A built in... Most micro's with internal A/D have a D/A string onboard, but don't give you access to it or provide more than one.

The SiLabs 8051s generally have two 12-bit DACs and a 200 kS/s 12-bit ADC with a nine-input analog mux in front (eight inputs are from I/O pins and the 9th is from an on-board temperature sensor diode). There's a couple of comparators, too. It's a pretty good way of doing a housekeeping system. The ADC conversion can be started from an external trigger, or a timer overflow, or just by setting a bit in software. Conversion-done can interrupt, as can the comparators (on either edge).

Definitely neat little parts.

I'm working on a design that uses the SiLabs C8051F120 to handle a temperature-control loop, shutter control (basically banging an H-bridge one way or the other for 100 ms to throw a solenoid), stepper-motor control (reading position sensors, driving an Allegro A3894 motor amplifier chip, which on my prototype keeps inexplicably destroying itself when enabled) and it uses I2C to talk to an FPGA. I also use the micro to configure the FPGA from a cheap SPI EEPROM.

(For those who might ask why I'm not using the F120's EMIF ... the FPGA is on the other side of a vacuum feedthrough and I didn't have enough pins for EMIF. I2C needs only two ...)

-a
 
That is a pretty serious part...  Another feature I notice that looks useful is the switchable gain in front of the A/D. While I doesn't seem like you would need that with 3V rails, it could help interface with cheapo microphones, and scale sources to better utilize the limited resolution of A/Ds.

I typically have pins left over, when using much lesser parts, but I did manage to fill all 13 A/D inputs in one recent design, while they aren't all cranking along at the same time.

These puppies have come a long way since the old 4 bangers 
220px-Intel_4004.jpg


JR
 
Back
Top