Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

I2C / TWI

I2C / TWI

2007-06-26 by Dave VanHorn

Does anyone have tips/pointers on using the TWI/I2C that they could 
share?  I'm about done weeding through all the alligators, and I'm 
about ready to actually drain the swamp I came here for.

Asm code would be ideal, I'm looking to implement this as interrupt 
driven.

I'm talking to several of the Acroname ultrasonics.

Re: [AVR-Chat] I2C / TWI

2007-06-26 by John Samperi

At 04:30 AM 27/06/2007, you wrote:
>Does anyone have tips/pointers on using the TWI/I2C that they could
>share?

For bit banged ASM stuff look at AVR300 and AVR302, I have used the
master and it works very well. Some people think that there may be
some merits on using the bit banged TWI as they suspect some hardware
issue with the hardware TWI. I have some more bits if you get stuck,
I have partially translated the C code for AVR315 (Master) into ASM but
it is not pretty yet.



Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Email: john@ampertronics.com.au
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.9.8/869 - Release Date: 25/06/2007 5:32 PM

Re: [AVR-Chat] I2C / TWI

2007-06-27 by David VanHorn

> For bit banged ASM stuff look at AVR300 and AVR302, I have used the
> master and it works very well. Some people think that there may be
> some merits on using the bit banged TWI as they suspect some hardware
> issue with the hardware TWI. I have some more bits if you get stuck,
> I have partially translated the C code for AVR315 (Master) into ASM but
> it is not pretty yet.

I'd prefer to use the TWI hardware.  I need this fast, and I'm in a
very limited environment, one master, and exactly four slaves.
I already implemented a "broken comms" timer, so that it will restart
if the comms hangs.  Only a truly hung hardware (broken) would stop
me.

Re: [AVR-Chat] I2C / TWI

2007-06-27 by Ranjit Puri

Hi Dave,

Heres some bit banged TWI code for you.
http://ranjit.puri.googlepages.com/I2C_AVR_sampleC.zip

Regards
Ranjit

On 6/27/07, David VanHorn <microbrix@gmail.com> wrote:
>
>   > For bit banged ASM stuff look at AVR300 and AVR302, I have used the
> > master and it works very well. Some people think that there may be
> > some merits on using the bit banged TWI as they suspect some hardware
> > issue with the hardware TWI. I have some more bits if you get stuck,
> > I have partially translated the C code for AVR315 (Master) into ASM but
> > it is not pretty yet.
>
> I'd prefer to use the TWI hardware. I need this fast, and I'm in a
> very limited environment, one master, and exactly four slaves.
> I already implemented a "broken comms" timer, so that it will restart
> if the comms hangs. Only a truly hung hardware (broken) would stop
> me.
>  
>



-- 
Ranjit


[Non-text portions of this message have been removed]

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.