Yahoo Groups archive

AVR-Chat

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

Thread

Re: Tiny2313 USI code to make I2C master

Re: Tiny2313 USI code to make I2C master

2009-06-10 by internetwasteland

--- In AVR-Chat@yahoogroups.com, "Dennis Clark" <dlc@...> wrote:
>
> Greetings,
> 
>   Another fellow and I are working on creating avr-gcc code to make an I2C
> master on a Tiny2313 using the USI module.  We have some code from M8 or
> M128 as a source, but those have full I2C implementations, not the
> "halfway" module in the T2313.  Has anyone implemented such a thing? 
> I'd surely love to avoid re-inventing THIS wheel.

I've written an I2C master on a Tiny24 without using the USI.  It's
actually quite easy to bit-bang I2C.  It's not in avr-gcc, but that
shouldn't be a problem.

I'll see if I can dig the source out of my archives.

Bill

Tiny2313 USI code to make I2C master

2009-06-10 by Dennis Clark

Greetings,

  Another fellow and I are working on creating avr-gcc code to make an I2C
master on a Tiny2313 using the USI module.  We have some code from M8 or
M128 as a source, but those have full I2C implementations, not the
"halfway" module in the T2313.  Has anyone implemented such a thing? 
I'd surely love to avoid re-inventing THIS wheel.

thanks,
DLC

-- 
Dennis Clark
TTT Enterprises

Re: [AVR-Chat] Tiny2313 USI code to make I2C master

2009-06-10 by John Samperi

At 01:00 AM 11/06/2009, you wrote:
>make an I2C
>master on a Tiny2313 using the USI module.

Someone by the name of Tom Deutschman has written some code
for master and slave.

The only thing I can get from one of the files is:
http://www.projectpoint.us/twi_master.c

but it does not seem to work anymore.


Regards

John Samperi

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

Re: [AVR-Chat] Tiny2313 USI code to make I2C master

2009-06-11 by Roy E. Burrage

Google shows him here:

       http://wizbangdesigns.blogspot.com/

He has a couple of pretty cool adapter boards for the USBKEY and Dragon 
boards for those who have a difficult time finding the header 
connectors, but links to the on-line store don't work.  Perhaps an 
e-mail directly to him will work for this as well as his TWI Master code.


REB



John Samperi wrote:
> At 01:00 AM 11/06/2009, you wrote:
>   
>> make an I2C
>> master on a Tiny2313 using the USI module.
>>     
>
> Someone by the name of Tom Deutschman has written some code
> for master and slave.
>
> The only thing I can get from one of the files is:
> http://www.projectpoint.us/twi_master.c
>
> but it does not seem to work anymore.
>
>
> Regards
>
> John Samperi
>
> ********************************************************
> Ampertronics Pty. Ltd.
> 11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
> Tel. (02) 9674-6495       Fax (02) 9674-8745
> Website  http://www.ampertronics.com.au
> *Electronic Design * Custom Products * Contract Assembly
> ********************************************************
>


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

Re: [AVR-Chat] Tiny2313 USI code to make I2C master

2009-06-11 by dlc

Hey, it's worth a try!  I'll see if he is still "out there".  If I find 
anything out, or get something to work I'll be sure to post about it!

thanks all,
DLC

Roy E. Burrage wrote:
> Google shows him here:
> 
>        http://wizbangdesigns.blogspot.com/
> 
> He has a couple of pretty cool adapter boards for the USBKEY and Dragon 
> boards for those who have a difficult time finding the header 
> connectors, but links to the on-line store don't work.  Perhaps an 
> e-mail directly to him will work for this as well as his TWI Master code.
> 
> 
> REB
> 
> 
> 
> John Samperi wrote:
>> At 01:00 AM 11/06/2009, you wrote:
>>   
>>> make an I2C
>>> master on a Tiny2313 using the USI module.
>>>     
>> Someone by the name of Tom Deutschman has written some code
>> for master and slave.
>>
>> The only thing I can get from one of the files is:
>> http://www.projectpoint.us/twi_master.c
>>
>> but it does not seem to work anymore.
>>
>>
>> Regards
>>
>> John Samperi
>>
>> ********************************************************
>> Ampertronics Pty. Ltd.
>> 11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
>> Tel. (02) 9674-6495       Fax (02) 9674-8745
>> Website  http://www.ampertronics.com.au
>> *Electronic Design * Custom Products * Contract Assembly
>> ********************************************************
>>
> 
> 
> [Non-text portions of this message have been removed]
> 
> 
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
> 

-- 
Question with boldness even the existence of a God;
because, if there be one, he must more approve of the
homage of reason, than that of blind-folded fear.
Thomas Jefferson
-------------------------------------------------
Dennis Clark          TTT Enterprises
www.techtoystoday.com
-------------------------------------------------

Re: [AVR-Chat] Tiny2313 USI code to make I2C master

2009-06-11 by John Samperi

At 10:34 AM 11/06/2009, you wrote:
>Google shows him here:
>        http://wizbangdesigns.blogspot.com/

How embarrassing, he has been a contributor to avrfreaks.net for a long
time, I just knew him as Tom.

Recently he has been trekking Iran, so not sure if he is back home yet.

http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=78507&highlight=iran 


Regards

John Samperi

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

Re: [AVR-Chat] Re: Tiny2313 USI code to make I2C master

2009-06-14 by dlc

Thanks, that sounds useful.

DLC

internetwasteland wrote:
> --- In AVR-Chat@yahoogroups.com, "Dennis Clark" <dlc@...> wrote:
>> Greetings,
>>
>>   Another fellow and I are working on creating avr-gcc code to make an I2C
>> master on a Tiny2313 using the USI module.  We have some code from M8 or
>> M128 as a source, but those have full I2C implementations, not the
>> "halfway" module in the T2313.  Has anyone implemented such a thing? 
>> I'd surely love to avoid re-inventing THIS wheel.
> 
> I've written an I2C master on a Tiny24 without using the USI.  It's
> actually quite easy to bit-bang I2C.  It's not in avr-gcc, but that
> shouldn't be a problem.
> 
> I'll see if I can dig the source out of my archives.
> 
> Bill
> 
> 
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
> 

-- 
Question with boldness even the existence of a God;
because, if there be one, he must more approve of the
homage of reason, than that of blind-folded fear.
Thomas Jefferson
-------------------------------------------------
Dennis Clark          TTT Enterprises
www.techtoystoday.com
-------------------------------------------------

Re: Tiny2313 USI code to make I2C master

2009-06-17 by internetwasteland

--- In AVR-Chat@yahoogroups.com, dlc <dlc@...> wrote:

> Thanks, that sounds useful.

I've tried to upload the file I2C.ZIP to the files area.

I'll check later to see if it came through.

Bill

Re: [AVR-Chat] Re: Tiny2313 USI code to make I2C master

2009-06-18 by dlc

Bill,

   I got the file.  The code looks stupid simple, how well does it work 
and with what devices have you tried it?  The code seems pretty obvious, 
but the demo routines in there don't seem complete, for instance:
    if (!I2CPut(atod_reg, 2))

atod_reg is never set to anything, it will be two bytes of zeros.

   I'll give it a whirl, I've seen some code that uses the USI interface 
to do I2C and it is about 10x more complex and isn't even interrupt 
driven (based on Atmel app note).  I'm not terribly impressed with the 
USI interface...

Again, thanks,
DLC

internetwasteland wrote:
> --- In AVR-Chat@yahoogroups.com, dlc <dlc@...> wrote:
> 
>> Thanks, that sounds useful.
> 
> I've tried to upload the file I2C.ZIP to the files area.
> 
> I'll check later to see if it came through.
> 
> Bill
> 
> 
> 
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
> 

-- 
-------------------------------------------------
Dennis Clark          TTT Enterprises
www.techtoystoday.com
-------------------------------------------------

Re: Tiny2313 USI code to make I2C master

2009-06-18 by internetwasteland

--- In AVR-Chat@yahoogroups.com, dlc <dlc@...> wrote:

>    I got the file.  The code looks stupid simple, how well does it
work
> and with what devices have you tried it?  The code seems pretty
obvious,
> but the demo routines in there don't seem complete, for instance:
>      if (!I2CPut(atod_reg, 2))
> atod_reg is never set to anything, it will be two bytes of zeros.
>
>    I'll give it a whirl, I've seen some code that uses the USI
interface
> to do I2C and it is about 10x more complex and isn't even interrupt
> driven (based on Atmel app note).  I'm not terribly impressed with the
> USI interface...

The code was written to talk to a TI ADS1110
<http://focus.ti.com/docs/prod/folders/print/ads1110.html>   chip.  I
have run it
successfully, though the full application is still under development
(it got pushed aside for nearly a year when work decided that something
else needed to be done first).

Yes, it is simple.  Once you have the low-level bit drivers written, the
rest is just stringing them together appropriately.

The USI could not be used for I2C, it was already in use talking SPI to
the
rest of the project.

I'll update the source files with some more examples of talking to the
ADS1110.  Check for a new version of I2C.ZIP in the files section.

Bill




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

Re: [AVR-Chat] Re: Tiny2313 USI code to make I2C master

2009-06-18 by Dennis Clark

Bill,

  Thanks a ton.  You'll save me the hassle of writing it myself. 
Especially if yours works already and I don't have a bus analyzer on
hand!  I'm running at 4MHz, and may move to 1MHz to save power so the
timing can either be changed or I'll just accept the slower clock, a few
hundred milliseconds delay isn't going to bother anything in my case.

Again thanks,
DLC

> --- In AVR-Chat@yahoogroups.com, dlc <dlc@...> wrote:
>
>>    I got the file.  The code looks stupid simple, how well does it
> work
>> and with what devices have you tried it?  The code seems pretty
> obvious,
>> but the demo routines in there don't seem complete, for instance:
>>      if (!I2CPut(atod_reg, 2))
>> atod_reg is never set to anything, it will be two bytes of zeros.
>>
>>    I'll give it a whirl, I've seen some code that uses the USI
> interface
>> to do I2C and it is about 10x more complex and isn't even interrupt
>> driven (based on Atmel app note).  I'm not terribly impressed with the
>> USI interface...
>
> The code was written to talk to a TI ADS1110
> <http://focus.ti.com/docs/prod/folders/print/ads1110.html>   chip.  I
> have run it
> successfully, though the full application is still under development
> (it got pushed aside for nearly a year when work decided that something
> else needed to be done first).
>
> Yes, it is simple.  Once you have the low-level bit drivers written, the
> rest is just stringing them together appropriately.
>
> The USI could not be used for I2C, it was already in use talking SPI to
> the
> rest of the project.
>
> I'll update the source files with some more examples of talking to the
> ADS1110.  Check for a new version of I2C.ZIP in the files section.
>
> Bill
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>


-- 
Dennis Clark
TTT Enterprises

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.