This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ79654-Q1: BQ79654-Q1 no response after UART

Part Number: BQ79654-Q1

Tool/software:

Hello, I would like to ask about how to set up the BQ79654-Q1 chip for UART communication. I'm using just one chip and I don't have a connection through COMHP, COMHN, so I have set this chip as [STACK_DEV] = 1 and [TOP_STACK] = 1 if I understood it correctly. Further, I'm enabling TX responses from the chip. I perform auto-addressing to address 0. After all this, I'm unable to get a response from the chip on the TX pin. I have no problem with waking up the chip. I'm using my own hardware design for the board. I'm using an Arduino Leonardo as the MCU. Where am I making a mistake?

#include <Arduino.h>

String data = "";

byte messageCLEAN_REG1[] = { 0xD0, 0x05, 0x10, 0x00, 0x25, 0x25 };  // Clear ECC_DATA register for auto-addressing.
byte messageCLEAN_REG2[] = { 0xD0, 0x05, 0x11, 0x00, 0x24, 0xB5 };
byte messageCLEAN_REG3[] = { 0xD0, 0x05, 0x12, 0x00, 0x24, 0x45 };

byte messageCLEAN_REG4[] = { 0xD0, 0x05, 0x13, 0x00, 0x25, 0xD5 };
byte messageCLEAN_REG5[] = { 0xD0, 0x05, 0x14, 0x00, 0x27, 0xE5 };
byte messageCLEAN_REG6[] = { 0xD0, 0x05, 0x15, 0x00, 0x26, 0x75 };

byte messageCLEAN_REG7[] = { 0xD0, 0x05, 0x16, 0x00, 0x26, 0x85 };
byte messageCLEAN_REG8[] = { 0xD0, 0x05, 0x17, 0x00, 0x27, 0x15 };
byte messageCLEAN_REG9[] = { 0xD0, 0x05, 0x18, 0x00, 0x22, 0xE5 };

byte messageCLEAN_REG11[] = { 0xD0, 0x03, 0x43, 0x00, 0xF9, 0xD4 };
byte messageCLEAN_REG12[] = { 0xD0, 0x03, 0x44, 0x00, 0xFB, 0xE4 };
byte messageCLEAN_REG13[] = { 0xD0, 0x03, 0x45, 0x00, 0xFA, 0x74 };

byte messageCLEAN_REG14[] = { 0xD0, 0x03, 0x46, 0x00, 0xFA, 0x84 };
byte messageCLEAN_REG15[] = { 0xD0, 0x03, 0x47, 0x00, 0xFB, 0x14 };
byte messageCLEAN_REG16[] = { 0xD0, 0x03, 0x48, 0x00, 0xFE, 0xE4 };

byte messageCLEAN_REG17[] = { 0xD0, 0x03, 0x49, 0x00, 0xFF, 0x74 };
byte messageCLEAN_REG18[] = { 0xD0, 0x03, 0x4A, 0x00, 0xFF, 0x84 };
byte messageCLEAN_REG19[] = { 0xD0, 0x03, 0x4B, 0x00, 0xFE, 0x14 };

byte messageTX_EN[] = { 0x90,0x00, 0x07, 0x01, 0x04, 0x55, 0x8F };
byte messageAUTOADRES_EN[] = { 0xD0, 0x03, 0x09, 0x01, 0x0F, 0x74 };  // Enable auto-addressing configuration
byte messageCONFADR[] = { 0xD0, 0x00, 0x00, 0x00, 0x38, 0xE4 };       // Set address 0
byte message_CONF_KOM[] = { 0xD0, 0x03, 0x08, 0x03, 0x8F, 0x25 };     // Set device as both start and end of chain
byte message_ACTIVE_CELL[] = { 0xD0, 0x00, 0x03, 0x08, 0x39, 0xD2 };  // Set active cells
byte messageTX_HOLD_OFF[] = { 0xD0, 0x00, 0x1A, 0xAA, 0xB3, 0xFB };
byte messageV14[] = { 0x80, 0x00, 0x05, 0x6C, 0x1F, 0x59, 0x17 };  // Chip address 0
byte messageTSREF_EN[] = { 0x90, 0x00, 0x03, 0x0A, 0x01, 0xD3, 0x7D };  // Activate TSREF for NTC Chip address 0
byte messageDEV_CONF[] = { 0xD0, 0x00, 0x02, 0x74, 0x39, 0xA3 };

void setup() {
  pinMode(1, OUTPUT);

  digitalWrite(1, HIGH);
  delay(60);
  digitalWrite(1, LOW);
  delay(2);
  digitalWrite(1, HIGH);
  delay(2);

  Serial.begin(1000000);
  Serial1.begin(1000000);  // Set to specified chip speed

  Serial.println("Initialization of communication with bq75614-Q1");

  delay(1);
  Serial1.write(messageTX_EN, sizeof(messageTX_EN));
  delay(1);
  Serial1.write(messageCLEAN_REG1, sizeof(messageCLEAN_REG1));
  delay(1);
  Serial1.write(messageCLEAN_REG2, sizeof(messageCLEAN_REG2));
  delay(1);
  Serial1.write(messageCLEAN_REG3, sizeof(messageCLEAN_REG3));
  delay(1);
  Serial1.write(messageCLEAN_REG4, sizeof(messageCLEAN_REG4));
  delay(1);
  Serial1.write(messageCLEAN_REG5, sizeof(messageCLEAN_REG5));
  delay(1);
  Serial1.write(messageCLEAN_REG6, sizeof(messageCLEAN_REG6));
  delay(1);
  Serial1.write(messageCLEAN_REG7, sizeof(messageCLEAN_REG7));
  delay(1);
  Serial1.write(messageCLEAN_REG8, sizeof(messageCLEAN_REG8));
  delay(1);
  Serial1.write(messageCLEAN_REG9, sizeof(messageCLEAN_REG9));
  delay(1);
  Serial1.write(messageCLEAN_REG11, sizeof(messageCLEAN_REG11));
  delay(1);
  Serial1.write(messageCLEAN_REG12, sizeof(messageCLEAN_REG12));
  delay(1);
  Serial1.write(messageCLEAN_REG13, sizeof(messageCLEAN_REG13));
  delay(1);
  Serial1.write(messageCLEAN_REG14, sizeof(messageCLEAN_REG14));
  delay(1);
  Serial1.write(messageCLEAN_REG15, sizeof(messageCLEAN_REG15));
  delay(1);
  Serial1.write(messageCLEAN_REG16, sizeof(messageCLEAN_REG16));
  delay(1);
  Serial1.write(messageCLEAN_REG17, sizeof(messageCLEAN_REG17));
  delay(1);
  Serial1.write(messageCLEAN_REG18, sizeof(messageCLEAN_REG18));
  delay(1);
  Serial1.write(messageCLEAN_REG19, sizeof(messageCLEAN_REG19));
  delay(1);

  Serial1.write(messageAUTOADRES_EN, sizeof(messageAUTOADRES_EN));
  delay(10);
  Serial1.write(messageCONFADR, sizeof(messageCONFADR));
  delay(10);
  Serial1.write(message_CONF_KOM, sizeof(message_CONF_KOM));
  delay(10);

  Serial1.write(messageDEV_CONF, sizeof(messageDEV_CONF));
  Serial1.write(messageTX_HOLD_OFF, sizeof(messageTX_HOLD_OFF));
  Serial1.write(message_ACTIVE_CELL, sizeof(message_ACTIVE_CELL));

  // Initialization of auto-addressing and communication settings
  //Serial1.write(messageInit, sizeof(messageInit));
  delay(10);
}

void loop() {

  Serial1.write(messageV14, sizeof(messageV14));

  // Reading response from device
  delay(100);
  while (Serial1.available()) {

    data += String(Serial1.read(), HEX);
  }
  Serial.println(data);

  delay(1000);  // Repeat every second, adjust as necessary
}

  • Hey Tomáš,

    I will get back with you shortly. 

    Best regards,

    Abdel

  • Hey Tomas,

    The only thing I would think of is that the device needs to be configured as a base device so remove  [TOP_STACK] = 1 and [STACK_DEV] = 1. This could be what is causing the communication issue.

    Best regards,

    Abdel

  • Hey,

    Unfortunately, after removing TOP_STACK] = 1 and [STACK_DEV] = 1, i.e. not writing any value to address 0x0308, the chip still does not send values. Before that I reset the device using HW_RESET ping in active state here I'm not sure if there is still need to add write to some address before reset.
    I decided to write a precise description of what I'm sending to the chip so that it's not necessary to look for it in the attached code:

    I power up the device using a 2ms LOW signal on the RX pin of the device then perform a HW_RESET ping and then wake the device up again using a 2ms LOW signal on the RX pin of the device

    I turn on serial communication to the arduino and start sending data.
    Auto-Addressing:
    The first step, according to the datasheet, is to clear the registers from ECC_DATA1 to ECC_DATA8 using a broadcast write value of 0x00.

    If I understand correctly I am writing to address 0x0510 to 0x0518 and 0x0343 to 0x034A using broadcast write value 0x00.

    0xD0, 0x05, 0x10, 0x00, 0x25, 0x25
    0xD0, 0x05, 0x11, 0x00, 0x24, 0xB5
    0xD0, 0x05, 0x12, 0x00, 0x24, 0x45
    0xD0, 0x05, 0x13, 0x00, 0x25, 0xD5
    0xD0, 0x05, 0x14, 0x00, 0x27, 0xE5
    0xD0, 0x05, 0x15, 0x00, 0x26, 0x75
    0xD0, 0x05, 0x16, 0x00, 0x26, 0x85
    0xD0, 0x05, 0x17, 0x00, 0x27, 0x15
    0xD0, 0x05, 0x18, 0x00, 0x22, 0xE5
    0xD0, 0x03, 0x43, 0x00, 0xF9, 0xD4
    0xD0, 0x03, 0x44, 0x00, 0xFB, 0xE4
    0xD0, 0x03, 0x45, 0x00, 0xFA, 0x74
    0xD0, 0x03, 0x46, 0x00, 0xFA, 0x84
    0xD0, 0x03, 0x47, 0x00, 0xFB, 0x14
    0xD0, 0x03, 0x48, 0x00, 0xFE, 0xE4
    0xD0, 0x03, 0x49, 0x00, 0xFF, 0x74
    0xD0, 0x03, 0x4A, 0x00, 0xFF, 0x84
    0xD0, 0x03, 0x4B, 0x00, 0xFE, 0x14
    In the next step, using broadcast write to register address 0x0309 (CONTROL1), the values
    DIR_SEL = 0
    SEND_SHUTDOWN = 0
    SEND_WAKE = 0
    SEND_SLPTOACT = 0
    GOTO_SHUTDOWN = 0
    GOTO_SLEEP = 0
    SOFT_RESET = 0
    ADDR_WR = 1
    this means 0xD0, 0x03, 0x09, 0x01, 0x0F, 0x74
    In the next step, using broadcast write to register address 0x0000 (DIR0_ADDR_OTP), the values
    zero to all bit 
    this means 0xD0, 0x00, 0x00, 0x00, 0x38, 0xE4
    I then initially wrote the values to register address 0x0308 using broadcast write
    RSVD = all zero
    STACK_DEV = 1  possible error here ( STACK_DEV = Defines device as a base or stack device in daisy chain configuration. 0 = Base device 1 = Stack device)[ from datasheet ]
    TOP_STACK = 1
    this means 0xD0, 0x03, 0x08, 0x03, 0x8F, 0x25
    I take Auto-Addressing as finished and continue writing:
    In the next step, using broadcast write to register address 0x0002 (DEV_CONF), the values
    RSVD = 0
    NO_ADJ_CB = 1
    MULTIDROP_EN = 1
    FCOMM_EN = 1
    TWO_STOP_EN = 0
    NFAULT_EN = 1
    FTONE_EN = 0
    HB_EN = 0
    this means 0xD0, 0x00, 0x02, 0x74, 0x39, 0xA3
     
    Next, I set the value of TX_HOLD_OFF to 170 using broadcast write to register address 0x001A.
    this means 0xD0, 0x00, 0x1A, 0xAA, 0xB3, 0xFB
    In the next step, using broadcast write to register address 0x0003 (ACTIVE_CELL), the values
    SPARE = all zero
    NUM_CELL = 14S (0x08)
    this means 0xD0, 0x00, 0x03, 0x08, 0x39, 0xD2
    The last configuration write is to enable TX on chip, register address 0x0701 using Single Write to device address 0
    UART_BAUD = 0
    UART_MIRROR_EN = 0
    UART_TX_EN = 1
    USER_UART_EN = 0
    USER_DAISY_EN = 0
    this means 0x90,0x00, 0x07, 0x01, 0x04, 0x55, 0x8F

    After that, I just send a request to read the voltage of cell 14 once per second using Single read at device address 0 and register address 0x056C value 0x1F. 

    this means 0x80, 0x00, 0x05, 0x6C, 0x1F, 0x59, 0x17

    and wait for a response

    Am I making a mistake in the programming itself? For example, I don't enter OTP programming at all and I don't know if I even have one. Or I'm reading the data in the wrong way.
    What would really help me would be a procedure on how to write what to write so that the chip starts sending replies to messages.

    Thank you for any suggestions

  • Hey Tomas,

    If you need an example to look at you can obtain access through this link: https://www.ti.com/secureresources/BQ7X61X-Q1-DEVELOPMENT

    There is a sample code over there that could help you with your issue.

    Best regards,

    Abdel