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.

BQ76PL455EVM: Communicating between the BQ board and an Arduino Mega module

Part Number: BQ76PL455EVM

Hello,

I am planning on using an Arduino Mega as a microcontroller for the BQ76PL455EVM evaluation board (which is connected to a 13-cell series string). Has this been done before?

I can install an Arduino USB-A host shield to connect the BQ board to the Arduino, and then use the Arduino's USB-B port to connect it to my laptop. But after this I am not quite sure how to communicate between the Arduino and the BQ board.

The goal is to be able to send string information (voltage of each of the 13 cells, temperature in the form of voltage from the 8 thermistors connected to the BQ board) to the Arduino and then to the laptop.

Any advice would be great!

Best Regards,

Krishna

  • Hi Muthu,

    As long as your MCU has a UART peripheral that can match one of our baud rate options (125k, 250k, 500k, or 1M). You also need two GPIOs for wakeup and nFault.

    Under the technical documentation tab of the pl455, you will find example software for our TMS570 and a software design reference. The UART protocol to communicate to our part is also detailed in the datasheet.
  • Hi David,

    Thanks for your response. I am new to this aspect of battery management so it's taking me some time to understand it. I will return to this thread later. For now, I am having some issues just sending hex commands using the GUI. I will start a new thread regarding this.

    Best Regards,

    Muthu

  • Hi Muthu,

    I definitely recommend reading through the above documentation, as well as the UART protocol portion of the datasheet. This will help you understand how to create the correct HEX packets.

    If you have any specific commands you would like as an example, i can help with that.

  • Hi David,

    I have a good understanding of Hex commands now and I can communicate effectively with the board using the GUI. Now I'm trying to do the same with an Arduino Mega. I have connected the 5V, GND, TX1, RX1 pins to the correct pins on the EVM. The EVM is connected to a string of 13 li-ion cells in series.

    The Hex message I want to send is: 81 00 22 20 28 84 , which according to the SLVA617A document is a request for the voltage and temp aux measurements.

    I put together a simple Arduino code (attached) but I'm getting no response on the serial monitor.

    1) When using a microcontroller, you are basically sending a request to the EVM and displaying the response from the EVM board. Do you have to send a WAKEUP signal on the WAKE pin first?

    2) Is there further documentation about the example code? The SLVA635 document only mentions how to open the code on CCS. I have done this, but how do I get started with this? I cannot find an intro guide or any explanation in any of the folders of the example code on CCS.

    Best Regards,

    Krishna

    ti message code.txt
    byte message[] = {0x81, 0x00, 0x22, 0x20, 0x28, 0x84};
    
    void setup() {
      Serial.begin(9600);            // to the laptop
      Serial1.begin(250000);     // to the EVM board   
    }
    
    void loop() {
     
      Serial1.write(message,sizeof(message));        // send message to  EVM board
           while(Serial1.available() > 0){                            // if there's a response from the EVM board.....
           Serial.print(Serial1.read());                                // ......display it on the arduino serial monitor
        }
      delay(5000);
    }
    




  • Hi David,

    I now understand how to turn the EVM board on using the Arduino Mega. I have the WAKEUP, nFault, TX, RX, 5V and GND pins of the EVM board connected to the relevant pins on the Arduino. When I read from the EVM using Serial1.read() on the Arduino, I receive the response "-1" or "FFFFFFFF" if I type Serial1.read(), HEX.

    Even if I send any HEX commands to the board, and then read from the board, I get the same response. Do I need to import the libraries from the CCS example code into my Arduino shell? I have not been able to find a clear introductory documentation to the example code.

    My main objective here is to be able to sample cell voltages and temperatures when I input the request. Otherwise, I want the board to tell me if there is a UV, OV or high TEMP fault, so that the Arduino can then act to cut out the connection to the charger or load.

    Best Regards,

    Krishna

  • Hi Krishna,

    I suggest putting a logic analyzer on the TX/RX pins to see what is happening.

    I also think you may have misread the line - register 0x22 is reserved. Try changing this to 0x02, to write to the COMMAND register (which controls the ADC).

    Make sure you do a "sample and store" value first, otherwise you will read invalid data (probably 0's from empty registers, i would guess).
  • Hi David,

    Thank you for your help. I have a better understanding of the system now. I can send messages from the Arduino Mega to the board and receive a response.

    I can send the message:

    94 00 03 1F FF FF 00 E7 DD ...(select 13 cells and 8 AUX temp sensors)

    ...81 00 02 20 28 84 (request cell and AUX values)

    to receive a string of HEX values for the voltages of my 13 cells and the 8 temperature sensors. I have my TX/RX ports connected to the Serial comms (RX3/TX3 respectively) on my Arduino Mega. The WAKEUP and nFAULT pins are connected to two different digital pins on the Mega.

    How do I read error messages? Is the nFAULT pin supposed to turn HIGH when a fault is detected? I am sending the following message:

    92 00 90 66 66 12 7A               (setting the OVERVOLTAGE fault to 2 V as a test)

    All my cells are currently at 3 V. But nFAULT is not turning HIGH and the BQ's TX pin is not transmitting a OV fault message (how would this look like as a HEX string?)

    Best Regards,

    Krishna 

  • Hi David,

    Could I please get some help regarding error messages (detailed in my previous message)? 

    This is the last thing I need to configure. Then I can use the Arduino to turn various switches off to prevent overcharge/overdischarge.

    Regards,

    Krishna

  • Hi Muthu,

    Fault_N is an active low signal. Think of it like this:

    Fault_N (no fault) is true, pin output is a logical 1 or 5V

    Fault_N (no fault) is false, pin output is a logical 0 or 0V.

    The Fault_N pin is a microcontroller interrupt to signal that the pl455 has detected a fault. It is the MCU's responsibility to go and read the fault registers.
  • Both your examples in the last message show (no fault). Can you clarify this?

    Do you mean:

    Fault_N (no fault) is true, pin output is a logical 1 or 5V

    Fault_N (fault detected) is false, pin output is a logical 0 or 0V. 

  • Hi Muthu,

    You are correct. 

    The (no Fault) was meant  to  just be a clarification for what the Fault_N pin represents. I apologize for  the poor wording.

    You're interpretation is correct, though.

  • Hi David,

    Thank you for your patience so far, I think I'm almost there. I am still not able to get the right response from the nFAULT pin. This is the message I'm sending:

    {0x91, 0x00, 0x3D, 0x00, 0x3C, 0x6C,                     //  2.2.1   Configure the initial sampling delay

     0x91, 0x00, 0x3E, 0xBC, 0x3D, 0x2D,                    //  2.2.2   Configure voltage and internal sample period

     0x91, 0x00, 0x07, 0x00, 0x2E, 0xCC,                     //  2.2.3   Configure oversampling rate

     0x91, 0x00, 0x51, 0x38, 0x10, 0xBE,                      //  2.2.4   Clear and check faults - system status register fault flags

     0x92, 0x00, 0x52, 0xFF, 0xC0, 0x59, 0xAC,              //          Clear and check faults - summary flags

     0x94, 0x00, 0x03, 0x1F, 0xFF, 0xFF, 0x00, 0xE7, 0xDD,  //  2.2.5   Select number of cells and channels on a single module

     0x92, 0x00, 0x90, 0x66, 0x66, 0x12, 0x7A};                       //  2.2.6   Set OV to 2 V

     0x81, 0x00, 0x02, 0x20, 0x28, 0x84};                   //          Request voltage and aux temp data

    I set the OV limit to 2 V as a test. All my cells are at 3.5 V.

    According to our previous conversation, the nFAULT pin should be HIGH by default. But after I send this message, nFAULT should turn LOW as there is an OV fault.

    However, nFAULT is on LOW the whole time. This seems to be the default setting. What am I missing?

    Regards,

    Krishna


                    

  • yes, you are correct