Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TMP006 Temperature Sensor
10-07-2016, 07:26 PM,
#11
RE: TMP006 Temperature Sensor
I forgot :
once the sketch is uploaded and your terminal (Putty?) opened type a key (enter for instance) to start. Then a second key is requested.
André
11-07-2016, 11:20 AM,
#12
RE: TMP006 Temperature Sensor
Demat,

I compiled and uploaded i2cscannerP32.pde succesfully. Indeed, Putty tells me that there is one device found at the adress 0x40. This is right.
So, the device TMP006 is well detected. Enclosed the result in Putty.
But, I still can't compile sensor_tmp006_test.pde..


Attached Files Thumbnail(s)
   

.pde   sensor_tmp006_test.pde (Size: 924 bytes / Downloads: 0)
11-07-2016, 02:48 PM,
#13
RE: TMP006 Temperature Sensor
Demat
Here are new elements.
In the examples\06.Sensors I created TMP006 subdirectory in which I put :
TMP006.pde
TMP006.c and .h
In P32\include\pinguino\core add
i2cmaster.c

So I can compile TMP006.pde but I don't know if it works because I have no TMP006 device. Try it.

I continue my tests with the i2c devices I own (PCF8574 and PCF8593). I often meet difficulties with the CDC driver so I lost a lot of time.

André


Attached Files
.c   i2cmaster.c (Size: 12.45 KB / Downloads: 1)
.pde   TMP_006.pde (Size: 911 bytes / Downloads: 1)
.c   TMP006.c (Size: 4.56 KB / Downloads: 1)
.h   TMP006.h (Size: 1.95 KB / Downloads: 2)
11-07-2016, 03:35 PM,
#14
RE: TMP006 Temperature Sensor
I did all you said and it compiled correctly.
Then, I uploaded the program on the board and I opened Putty.
Unfortunately, on Putty, I just can see TMP006 Example. I didn't have the values of the sensor.
I think I should modify something in the function "void loop()" to get back data from the sensor ?


I just modify that but I didn't work : CDC.printf("Object Temperature: %f6.2 *C\r\n",object_temp);
                                                    CDC.printf("Sensor Temperature: %f6.2 *C\r\n",sensor_temp);


Enclosed the result in Putty.


Attached Files Thumbnail(s)
   
11-07-2016, 05:44 PM,
#15
RE: TMP006 Temperature Sensor
I am on a good track because now my PCF8593 works.
Consequently I have to modify i2cmaster.c and TMP006.c.
As soon as possible I shall send the modified files.
See you soon
André
12-07-2016, 09:40 AM,
#16
RE: TMP006 Temperature Sensor
Demat !
Here are new elements :
i2cmaster.c
TMP006.c
TMP_006.pde
If it did not work I would do a simplified version without i2cmaster.c.
With the Arduino method (wire.cpp and wire.h) data go thru in and out buffers.
One can do simpler without these buffers.
See you soon
André


Attached Files
.pde   TMP_006.pde (Size: 911 bytes / Downloads: 2)
.c   TMP006.c (Size: 4.53 KB / Downloads: 1)
.c   i2cmaster.c (Size: 12.55 KB / Downloads: 2)
12-07-2016, 10:35 AM, (This post was last modified: 12-07-2016, 10:46 AM by gtcbreizh.)
#17
RE: TMP006 Temperature Sensor
Would you modify lines 164-165 of TMP006.c ?
  I2C_inBuffer((uint8_t)(d>>8));  // write data

  I2C_inBuffer((uint8_t)d);  // write data
So it will be safer as the parameter for I2C_inBuffer is a uint8_t and not uint16_t.

Furthermore I have forgotten to add object_temp and sensor_temp in the CDC.printf
12-07-2016, 10:52 AM,
#18
RE: TMP006 Temperature Sensor
Here are a simplified version of TMP006.c and the associated sketch. Would you try them ?
See you soon
André


Attached Files
.c   TMP006no_buf.c (Size: 4.45 KB / Downloads: 1)
.pde   TMP_006no_buf.pde (Size: 857 bytes / Downloads: 1)
12-07-2016, 11:15 AM, (This post was last modified: 12-07-2016, 11:38 AM by walk_porto.)
#19
RE: TMP006 Temperature Sensor
Demat,

I tried with the 2 versions you gave me this morning. Both can compile and can be uploaded on the board but data are not correct.
Indeed, it's always the same temperature. I think the data acquisition doesn't work.
But you did a very good work André, you help me a lot.
Enclosed results in Putty.


Attached Files Thumbnail(s)
   
12-07-2016, 11:51 AM,
#20
RE: TMP006 Temperature Sensor
I just verified the use of %f with PIC32 and it is not ok when it is OK in P8.
I investigate for a correct solution.
See you soon.


Forum Jump:


Users browsing this thread: 2 Guest(s)