MOD-TC-MK2-31855 and arduino due not working together

Started by rdc02271, November 26, 2013, 04:33:38 PM

Previous topic - Next topic

rdc02271

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);
}

LubOlimex

Technical support and documentation manager at Olimex

rdc02271

Hello,

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

JC

selfbg

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