Post Go back to editing

DC486B (LTC1760) I2C/SMBUS (MCU - STM32F4) Communication problem .

Category: Hardware

Hi there..

I have problem communicating DC486B development board over I2C, I'm only receiving is "0XFF" .

Here is my setup:

-JP2 : "Normal" 

-JP4: "ON"

-JP3: "ON"

-No battery connected.

-Only try to communicate with the LTC1760 unit.

-I2C clock speed 250K.

-With address. 0x14 and command: 0x01.

I'll appreciate for any help!

With regards

Jitu

  

  

Parents
  • Hi there..

    Anyway solved the issue!

    As the HAL driver for the I2C (STM32F4) has many variants and one works for the SMBUS related devices is

    "Interrupt/Polling mode IO MEM operation". And the I2C in SMBUS configuration is still not working (FW V27.1) (many issues with internal state handling!).

  • Hi,

    I am trying to communicate with the LTC1760 (integrated in the 486B Demo board) by using Arduino, but it seems not to work. Can you give me some suggestions? I attach the code I used.

    -----------------------------------------------------------------------

    #include <Wire.h>

    void setup()
    {
       Wire.begin();
       Serial.begin(9600);
    }

    uint8_t address = 0x0A; // 0x14, but Wire i2c adressing uses the high 7 bits so shift right
    uint8_t reg = 0x04; // BatterySystemInfo() register
    uint8_t numBtyes = 2;

    void loop()
    {
       Wire.beginTransmission(address);
       Wire.write(byte(reg)); // sets register pointer
       Wire.endTransmission(false); // repeated start

       Wire.requestFrom(address, numBtyes); // request 2 bytes from slave device #112

       int reading = 0;
       if (Wire.available() >= numBtyes)
       {
          reading = Wire.read(); // receive low byte
          reading |= Wire.read() << 8; // receive high byte
          printHex(reading, 4);
       }

       else // nothing was received
       {
          Serial.println("Nothing Received");
       }

       delay(1000);
    }

    void printHex(int num, int precision)

    {
       char tmp[16];
       char format[128];

       sprintf(format, "0x%%.%dX", precision);

       sprintf(tmp, format, num);
       Serial.println(tmp);
    }

    -----------------------------------------------------------------------

Reply
  • Hi,

    I am trying to communicate with the LTC1760 (integrated in the 486B Demo board) by using Arduino, but it seems not to work. Can you give me some suggestions? I attach the code I used.

    -----------------------------------------------------------------------

    #include <Wire.h>

    void setup()
    {
       Wire.begin();
       Serial.begin(9600);
    }

    uint8_t address = 0x0A; // 0x14, but Wire i2c adressing uses the high 7 bits so shift right
    uint8_t reg = 0x04; // BatterySystemInfo() register
    uint8_t numBtyes = 2;

    void loop()
    {
       Wire.beginTransmission(address);
       Wire.write(byte(reg)); // sets register pointer
       Wire.endTransmission(false); // repeated start

       Wire.requestFrom(address, numBtyes); // request 2 bytes from slave device #112

       int reading = 0;
       if (Wire.available() >= numBtyes)
       {
          reading = Wire.read(); // receive low byte
          reading |= Wire.read() << 8; // receive high byte
          printHex(reading, 4);
       }

       else // nothing was received
       {
          Serial.println("Nothing Received");
       }

       delay(1000);
    }

    void printHex(int num, int precision)

    {
       char tmp[16];
       char format[128];

       sprintf(format, "0x%%.%dX", precision);

       sprintf(tmp, format, num);
       Serial.println(tmp);
    }

    -----------------------------------------------------------------------

Children
No Data