Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumProgramming Questions & HelpPrograms › Connection with ATMEGA 1281 and Digit Temp TMP102

Page Index Toggle Pages: 1
Connection with ATMEGA 1281 and Digit Temp TMP102 (Read 10975 times)
07/29/10 at 13:40:34

poiste   Offline
YaBB Newbies

Posts: 7
*
 
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
 
IP Logged
 
Reply #1 - 07/29/10 at 17:43:33

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
This is what you're looking for: http://wiring.org.co/learning/libraries/tmp102sparkfun.html
Let me know.
 
IP Logged
 
Reply #2 - 07/29/10 at 20:14:59

poiste   Offline
YaBB Newbies

Posts: 7
*
 
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.

 
IP Logged
 
Reply #3 - 07/29/10 at 21:07:31

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
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;
 
IP Logged
 
Reply #4 - 07/29/10 at 21:11:42

poiste   Offline
YaBB Newbies

Posts: 7
*
 
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)
 
IP Logged
 
Reply #5 - 07/29/10 at 21:58:28

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
Yes the connection is SDA-SDA and SCL-SCL. Is it working now?
 
IP Logged
 
Reply #6 - 07/29/10 at 22:13:58

poiste   Offline
YaBB Newbies

Posts: 7
*
 
no... It's a possibility to check if the sensor work well?
 
IP Logged
 
Reply #7 - 07/29/10 at 22:47:30

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
let me see If I have one at hand. did you connect it to 3.3v right? it should respond immediately.
 
IP Logged
 
Reply #8 - 07/30/10 at 06:09:50

poiste   Offline
YaBB Newbies

Posts: 7
*
 
Yes I have connect to 3.3V and GND
 
IP Logged
 
Reply #9 - 07/30/10 at 20:22:33

poiste   Offline
YaBB Newbies

Posts: 7
*
 
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?
 
IP Logged
 
Reply #10 - 07/30/10 at 20:48:02

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
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
 
IP Logged
 
Reply #11 - 07/30/10 at 21:49:00

poiste   Offline
YaBB Newbies

Posts: 7
*
 
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...
 
IP Logged
 
Reply #12 - 08/07/10 at 23:26:01

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
I have one TMP102 on the way, so I'll let you know as soon as I get it.
 
IP Logged
 
Reply #13 - 09/22/10 at 05:19:22

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
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.
 
IP Logged
 
Page Index Toggle Pages: 1