[chbot] Small Micros with I2C bus

Charles Manning manningc2 at actrix.gen.nz
Wed Apr 27 01:16:57 BST 2011


On Monday 25 April 2011 00:21:00 Paul Davey wrote:
> On Sun, Apr 24, 2011 at 11:56 PM, Andrew Errington
>
> <a.errington at lancaster.ac.uk> wrote:
> > On Fri, 22 Apr 2011 00:08:37 Paul Davey wrote:
> >> I thought it may be a good time to experiment with I2C
> >
> > Could you bit-bang the I2C interface?  Then you wouldn't need a built-in
> > peripheral.
> >
> > Andrew
>
> Probably, but where's the fun in that? also that means the micro cant
> do others things at the same time :P
> Also I do not want to write all the code to bit bang it and I am not
> looking at the range so small that they don't have I2C/TWI
> peripherals.

Bitbanging is CPU intensive but  can be implemented quite easily using 
interrupts.

There's even AVR code to implement low speed USB in software (way faster than 
I2C) using interrupts.

If you're interested there's a simple implementation I did at: 
http://lejos.svn.sourceforge.net/viewvc/lejos/trunk/nxtvm/platform/nxt/i2c.c


-- CHarles



More information about the Chchrobotics mailing list