Olimex Support Forum

DUINO => ARDUINO => Topic started by: rdc02271 on November 26, 2013, 04:33:38 PM

Title: MOD-TC-MK2-31855 and arduino due not working together
Post by: rdc02271 on November 26, 2013, 04:33:38 PM
Hello,
I have  bought two MOD-TC-MK2-31855 to work on a Arduino Due (See my test code below).

I am unable to get any data from the MOD-TC-MK2-31855.
I have reduced the I2c frequency to 80Khz, even to 40Khz, as suggested in another post here in this forum.

Nothing worked!

Using a cheap logic sniffer I can see that the MOD-TC-MK2-31855 sends a ACK for address 0x48 (nothing happens on address 0x23) but sends a NACK for single command I try to issue, be it a getID, getTEmperature,etc.

How can I solve this problem?

Thank you,
J.C.


//_-----------------------Test Code
#include <TC-MK2.h>


TC_MK2 BGATemperatureTopSensor(0x48);
//TC_MK2 tempSensorBottom(0x23);

void setup()
{
  // put your setup code here, to run once:
  Serial.begin(9600);

}

void loop()
{
   Serial.println(BGATemperatureTopSensor.getID());
   delay(2000);
}
Title: Re: MOD-TC-MK2-31855 and arduino due not working together
Post by: LubOlimex on November 27, 2013, 03:24:22 PM
Hey there,

Did you stumble upon this library: https://www.olimex.com/Products/Duino/AVR/OLIMEXINO-328/resources/OLIMEXINO-328+MOD_TC_MK2.zip (https://www.olimex.com/Products/Duino/AVR/OLIMEXINO-328/resources/OLIMEXINO-328+MOD_TC_MK2.zip)?

Best regards,
Lub/OLIMEX
Title: Re: MOD-TC-MK2-31855 and arduino due not working together
Post by: rdc02271 on November 28, 2013, 02:42:50 AM
Hello,

That is the library I am using; still not working.

JC
Title: Re: MOD-TC-MK2-31855 and arduino due not working together
Post by: selfbg on November 28, 2013, 10:35:37 AM
Hi,
try the following:


#include <Wire.h>

void setup()
{
   Serial.begin(9600);
}
void loop()
{
   Wire.beginTransmission(0x48);
   Wire.write(0x02);
   Wire.write(0xA0);
   Wire.write(0x21);
   Wire.endTransmission();

   Wire.requestFrom(0x48, 4);
   while(Wire.available() > 0){
   unsigned char a = Wire.read()
   Serial.println(a, HEX);
   }
}


If this work you most probably have firmware version 2.
In this case check out this:
https://www.olimex.com/Products/Modules/Sensors/MOD-TC-MK2-31855/resources/MOD-TC-MK2_firmware_OLinuXino_v2.zip