Wiring Forum
http://wiring.org.co/cgi-bin/yabb/YaBB.pl
Programming Questions & Help >> Programs >> Connection with ATMEGA 1281 and Digit Temp TMP102
http://wiring.org.co/cgi-bin/yabb/YaBB.pl?num=1280410834

Message started by poiste on 07/29/10 at 13:40:34

Title: Connection with ATMEGA 1281 and Digit Temp TMP102
Post by poiste on 07/29/10 at 13:40:34
Hi,

I have a Wiring card with an ATMEGA 1281 and I try to connect with a "Digital Temperature Sensor Breakout - TMP102". And It isn't working...

I think the problem is in this 2 lines:

Wire.requestFrom(sensorAddress,2);
  if (2 <= Wire.available())  // if two bytes were received

What is the address for the variable "sensorAddress"?

I have connect the sensor on the Port0 (SCL/SDA) it's right?

Thank's

Title: Re: Connection with ATMEGA 1281 and Digit Temp TMP102
Post by barragan on 07/29/10 at 17:43:33
This is what you're looking for: http://wiring.org.co/learning/libraries/tmp102sparkfun.html
Let me know.

Title: Re: Connection with ATMEGA 1281 and Digit Temp TMP102
Post by poiste on 07/29/10 at 20:14:59
I have try with this example, but my soft go never in the "if"

if (2 <= Wire.available())  // if two bytes were received

But, I don't exactly with address I need use.


Title: Re: Connection with ATMEGA 1281 and Digit Temp TMP102
Post by barragan on 07/29/10 at 21:07:31
This is the address int sensorAddress = 0x91 >> 1;
the result of this operation is 0x90 >> 1 = 0x48
so you can use directly int sensorAddress = 0x48;
Also note 0x48 (hex) is 72 (decimal), so it is the same to do this:
int sensorAddress = 72;

Title: Re: Connection with ATMEGA 1281 and Digit Temp TMP102
Post by poiste on 07/29/10 at 21:11:42
I have try with 72 and it's never ok.

it's true, I need plug the sensor on SDA - SDA and SLC - SLC
(Sensor - Wiring Card Port0)

Title: Re: Connection with ATMEGA 1281 and Digit Temp TMP102
Post by barragan on 07/29/10 at 21:58:28
Yes the connection is SDA-SDA and SCL-SCL. Is it working now?

Title: Re: Connection with ATMEGA 1281 and Digit Temp TMP102
Post by poiste on 07/29/10 at 22:13:58
no... It's a possibility to check if the sensor work well?

Title: Re: Connection with ATMEGA 1281 and Digit Temp TMP102
Post by barragan on 07/29/10 at 22:47:30
let me see If I have one at hand. did you connect it to 3.3v right? it should respond immediately.

Title: Re: Connection with ATMEGA 1281 and Digit Temp TMP102
Post by poiste on 07/30/10 at 06:09:50
Yes I have connect to 3.3V and GND

Title: Re: Connection with ATMEGA 1281 and Digit Temp TMP102
Post by poiste on 07/30/10 at 20:22:33
It's true, I just need to connect SDA - SCL on port0, Plug the power.
Compile the soft (same as the exemple) with "wiring.exe".
And that's all?

Or I need to do a other thing? download something more?

Title: Re: Connection with ATMEGA 1281 and Digit Temp TMP102
Post by barragan on 07/30/10 at 20:48:02
The next step will be to upload the code into the board:check for steps 3, 4 and 5 from here http://wiring.org.co/learning/tutorials/installingsoftware/index.html
Choose the target microcontroller atmega1281 etc. (it won´t work if the selected microcontroller is not the one you have)
Then upload: check for step 3 here: http://wiring.org.co/learning/tutorials/uploadingcode/index.html

Title: Re: Connection with ATMEGA 1281 and Digit Temp TMP102
Post by poiste on 07/30/10 at 21:49:00
I have try that, I have play with the led and it's work.
When I compile the file, I have no error and he is upload well

But a don't know if I need to do something more for use the wire?
Like store my source file in a specific place, or .... I don't know...

Title: Re: Connection with ATMEGA 1281 and Digit Temp TMP102
Post by barragan on 08/07/10 at 23:26:01
I have one TMP102 on the way, so I'll let you know as soon as I get it.

Title: Re: Connection with ATMEGA 1281 and Digit Temp TMP102
Post by barragan on 09/22/10 at 05:19:22
Hi poiste, I've tested a brand new tmp102 breakout from sparkfun and it works perfectly fine with the example provided. I tested it using both: the Wiring atmega128 and the Wiring atmega1281 boards. It reads very fine. I think the problem must be in your sensor or connections. Let me know.

Wiring Forum » Powered by YaBB 2.5 AE!
YaBB Forum Software © 2000-2010. All Rights Reserved.