Yahoo Groups archive

AVR-Chat

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

Thread

i2c temperature sensor code

i2c temperature sensor code

2007-04-11 by jasonparkerhendrix

Does anyone have example winavr code for working with temperature 
sensors via i2c? 

Specifically I'm working with a TMP75AIDR 
(http://focus.ti.com/lit/ds/symlink/tmp75.pdf) and an ATMEGA32 
(http://www.atmel.com/dyn/resources/prod_documents/doc2503.pdf) 

However, any winavr code for any other i2c sensor and/or avr would be 
very welcomed. 

Thanks!

Re: [AVR-Chat] i2c temperature sensor code

2007-04-12 by Ranjit Puri

Hi,

Heres some classic bit-banged I2C code (written for AVR GCC) that talks to a
DS1631 I2C temperature sensor (see attached).

Regards
Ranjit

On 11 Apr 2007 18:25:08 -0700, jasonparkerhendrix <hendrix.jason@gmail.com>
wrote:
>
>    Does anyone have example winavr code for working with temperature
> sensors via i2c?
>
> Specifically I'm working with a TMP75AIDR
> (http://focus.ti.com/lit/ds/symlink/tmp75.pdf) and an ATMEGA32
> (http://www.atmel.com/dyn/resources/prod_documents/doc2503.pdf)
>
> However, any winavr code for any other i2c sensor and/or avr would be
> very welcomed.
>
> Thanks!
>
>
>  
>



-- 
Ranjit


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

Re: [AVR-Chat] i2c temperature sensor code

2007-04-12 by Alex Gibson

Ranjit Puri wrote:
> Hi,
> 
> Heres some classic bit-banged I2C code (written for AVR GCC) that talks to a
> DS1631 I2C temperature sensor (see attached).
> 
> Regards
> Ranjit

Can't send attachments to yahoo groups, they block it automatically.

Need to either paste it as text or upload it to the files area or put it
on your web site and include a link.

Alex

Re: i2c temperature sensor code

2007-04-12 by jeff_smith_8992

Peter Fleury has some example I2C code (I2C Master Interface)
available at his web site:

http://homepage.hispeed.ch/peterfleury/avr-software.html


--- In AVR-Chat@yahoogroups.com, "jasonparkerhendrix"
<hendrix.jason@...> wrote:
Show quoted textHide quoted text
>
>  Does anyone have example winavr code for working with temperature 
> sensors via i2c? 
> 
> Specifically I'm working with a TMP75AIDR 
> (http://focus.ti.com/lit/ds/symlink/tmp75.pdf) and an ATMEGA32 
> (http://www.atmel.com/dyn/resources/prod_documents/doc2503.pdf) 
> 
> However, any winavr code for any other i2c sensor and/or avr would be 
> very welcomed. 
> 
> Thanks!
>

Re: [AVR-Chat] i2c temperature sensor code

2007-04-12 by Ranjit Puri

Thanks Alex,

The files can also be had from
http://ranjit.puri.googlepages.com/I2C_AVR_sampleC.zip

Regards
Ranjit


On 12 Apr 2007 05:21:13 -0700, Alex Gibson <yahoo@alexthegeek.com> wrote:
>
>   Ranjit Puri wrote:
> > Hi,
> >
> > Heres some classic bit-banged I2C code (written for AVR GCC) that talks
> to a
> > DS1631 I2C temperature sensor (see attached).
> >
> > Regards
> > Ranjit
>
> Can't send attachments to yahoo groups, they block it automatically.
>
> Need to either paste it as text or upload it to the files area or put it
> on your web site and include a link.
>
> Alex
>  
>



-- 
Ranjit


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

Re: i2c temperature sensor code

2007-04-13 by jasonparkerhendrix

Thanks for this code example!

For some reason, the temperature is reported to be 255 C.  Obviously 
this means something isn't right.  Can you give me any hints to what 
I may have done incorrectly?

The only thing I changed in the code was to this:
#define DEV_ADDR 0x37

Because according to the datasheet
(http://focus.ti.com/lit/ds/symlink/tmp75.pdf) the address if all 3 
address pins are left "floating" is 0110111

Any suggestions would be greatly appreciated.

Thanks!

--- In AVR-Chat@yahoogroups.com, "Ranjit Puri" <ranjit.puri@...> 
wrote:
>
> Thanks Alex,
> 
> The files can also be had from
> http://ranjit.puri.googlepages.com/I2C_AVR_sampleC.zip
> 
> Regards
> Ranjit
> 
> 
> On 12 Apr 2007 05:21:13 -0700, Alex Gibson <yahoo@...> wrote:
> >
> >   Ranjit Puri wrote:
> > > Hi,
> > >
> > > Heres some classic bit-banged I2C code (written for AVR GCC) 
that talks
> > to a
> > > DS1631 I2C temperature sensor (see attached).
> > >
> > > Regards
> > > Ranjit
> >
> > Can't send attachments to yahoo groups, they block it 
automatically.
> >
> > Need to either paste it as text or upload it to the files area or 
put it
Show quoted textHide quoted text
> > on your web site and include a link.
> >
> > Alex
> >  
> >
> 
> 
> 
> -- 
> Ranjit
> 
> 
> [Non-text portions of this message have been removed]
>

Re: [AVR-Chat] Re: i2c temperature sensor code

2007-04-13 by Michael Ardai

The low bit of the address selects R/W.  That would make
0110 111x be 6E for write and 6F for read.  See figure
5 in the data sheet.

BTW, I can't remember if you are using a TMP75 or a
TMP175.  The TMP75 doesn't allow for floating addresses.

/mike

Re: i2c temperature sensor code

2007-04-13 by jasonparkerhendrix

Thanks for your help.  You helped me realize exactly what the problem 
was, and it's working great now.

Thanks!

--- In AVR-Chat@yahoogroups.com, Michael Ardai <n1ist@...> wrote:
Show quoted textHide quoted text
>
> The low bit of the address selects R/W.  That would make
> 0110 111x be 6E for write and 6F for read.  See figure
> 5 in the data sheet.
> 
> BTW, I can't remember if you are using a TMP75 or a
> TMP175.  The TMP75 doesn't allow for floating addresses.
> 
> /mike
>

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.