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.

EM1402EVM: Power management forum

Part Number: EM1402EVM
Other Parts Discussed in Thread: TMS570LS0714, HALCOGEN, BQ76PL455A-Q1, BQ79606A-Q1

Hi,

I am performing active cell balancing for TMS570LS0714. we are using SPI2 for DAC OUT and MIBSPI1 for switch matrix operation. 

In our design we have 2 EMB1428 chips. we are using CS1 AND CS2, and changed its functionality to GPIO in HALCOGEN. 

while debugging the code is getting struck in while(1) of embstop command and g_ui32EMB1428Status is showing 0x80 status, which means "CS falling edge while the EMB1428 is still waiting for a transition 1000 no

on DONE (rising or falling edge)". 

i am attaching code here. 

please check and let us know if any changes we have to make.

23-7-LCU-SPI.zipThanks,

Gargi 

  • Hi Gargi,

    We are currently aware of bugs that exist in the sample code provided, and it will therefore soon be deprecated.

    This unfortunately means that support for the software on this device is currently limited.

    With that said, I have reviewed the code and would suggest ensuring the delays around the spiTransferByte (line 303) are sufficient for the spiTransfer to correctly occur. If not, you may interrupt the transfer by setting CS2 high too early, or by not fully receiving the byte. I would additionally recommend that you use a logic analyzer on the SPI lines to ensure that the byte is being fully received.

    Let me know if you have any additional questions!

    Regards,

    Vince Toledo

    [If I was able to assist you with your issue, please press This resolved my issue. Thanks!]

  • Hi Vince,

    Thanks for your response.

    After providing 12 volts floating supply, I am able to perform discharging in TMS570LS0714. We checked gate pulses and EMB1499 response, it is coming proper.

    while performing charging, SPI commands are proper but ENABLE and  DIRECTION pin are not giving any response which in result not generating any gate pulses and there is no current for charging.

    we are not using 12 volts auxiliary battery for charging and discharging activity. instead, we are using 48 volts(12 cells) cell stack to be connected to forward converter. 

    can you please help in providing some solution for this situation that why we are not able to perform it.

    Regards,

    Gargi Pancholi 

     

  • Hi Gargi,

    VINF/PVINF of the EMB1499 (where you were previously supplying the 12V floating supply) has an abs max of 15V, and is recommended to be 12V. If you are instead using the 48V stack and trying to power this, then the device may get damaged.

    Please let me know if this is what you are attempting to do. If not, then the issue may lie with the sample code as I mentioned previously.

    The next thing I would check is to make sure that the communications that are reaching the 1499 are correct (use a logic analyzer and ensure the commands reaching the device are still correct).

    Finally, I would ensure that all supplies are at the correct/expected levels. If one of the supplies is incorrect, please let me know so we can further debug this issue.

    Thanks!

    Vince

  • Hi Vince,

    Thanks for your continuous support.

    On the 12V floating power supply, we are giving 12V supply, that is not the issue.

    Instead of using 12V lead acid battery for exchanging charges between the cells, we are using stack(48V) for exchanging charges between the stack and the particular cell.

    Means for charging or discharging, on the non-inductor  side we are connecting stack of 48 volts. 

    In this case for  discharging it is working properly. but for charging, we are not able to provide current for the cell(need to be balance) from the stack.

    The SPI commands that we are sending to EMB1428 for charging and discharging are proper.But the handshaking between EMB1428 and EMB1499 is not happening properly.

    In discharging mode, we are getting ENABLE  and DONE signals while probing. but during charging mode, there is no ENABLE and DONE signals are present. 

    please help in rectify the issue.

    Thanks and Regards,

    Gargi

  • Hi Gargi,

    As the handshake seems to be having issues, I would recommend that you go into debug mode in Code Composer Studio, and do a line-by-line step through in the code (using F5 to F7 on the keyboard once it has been loaded in debug mode). Check if the microcontroller is returning properly from each function call, or if it is skipping to the end of the program during the "charging" portion of the code.

    The reason I recommend this check is because this sounds like there might be a stack overflow happening, in which the microcontroller is running out of stack space and is jumping past the point where it completes the handshake, or restarting the program before the handshake even happens.

    The way to ensure that this is fixed is to avoid large arrays being declared within sub-functions. It is best to declare arrays/variables at the beginning of the program, and re-use them for as many functions as possible (not dynamically re-allocating memory with every function call). 

    Unfortunately, we are unable to assist directly with this device software (the software will be "not recommended for new designs" very soon), so other than high-level support, I cannot dig into the issue too much further. I apologize for this inconvenience. If possible, I would look into the newer BQ76PL455A-Q1 or BQ79606A-Q1, if they fit your design needs.

    I apologize again for the inconvenience.

    Regards,

    Vince

  • Thanks Vince for your suggestions.

    we checked code line by line and there are two things happening.

    1. while charging, our code is getting struck in stop command and we are getting g_ui32EMB1428Status = 0x00000010/0x00000050. for every command the same thing is happening.

    2. while discharging, code is not strucking and we are facing some different issue. while debugging we are not getting the correct g_ui32EMB1428Status but when we simply probe the clock pin of SPI we are getting correct status and cells are also discharging properly .we are not getting this issue.

    i am attaching code also for your reference.

    5707.23-7-LCU-SPI.zip

    Thanks and Regards,

    Gargi

  • Hi Gargi,

    I am thinking that you may actually only be receiving info from the stop command once, and the register that you are storing the data in is not being updated.

    What I would do to check if this is actually updating every time is go to emb1428.c->EMB_Stop()->add "g_ui32EMB1428Status = 0;" right before the spiTransferByte(spiREG1,0); line (line 303). This will 0 out the variable before you read so that you get fresh data every time. If it is 0 after the first time, then something is going wrong with the transfer, which likely means you ran out of room on the stack for the transfer.

    Could you go ahead and add this bit of code and see if that is the issue?

    If it is, then please move all your variable definitions outside of the functions. So basically move all of the "int EMB_COMMAND" and any arrays outside of the functions (declare them at the beginning of the code, possibly in the header file or top of the .c file. This will prevent stack overflows from happening by making sure we aren't adding large amounts of data to the stack every time a function is called.

    Let me know if this helps!

    Regards,

    Vince

  • Hi Vince,

    I tried  what you have suggested, still facing the same issue. 

    what i noticed is while debugging for bottom stack the code is getting struck and gives error code as  g_ui32EMB1428Status  = 0x000000b0 ( CS falling edge while bg_good is low and the current command is not 4’h0 (open all switches). can you please help in figure out what is this error and and how to resolve that.

    And when i am performing for top Stack the status i am getting is g_ui32EMB1428Status  = 0x00000010 (not given in fault description)

    Thanks for your continuous support. 

    Regards,

    Gargi 

  • Hi Gargi,

    Thank you for doing that test, that is what I was looking to see. It looks like the g_ui32EMB1428Status is not updating, or is updating incorrectly.

    Do you have access to a logic analyzer device? If you do, could you post screenshots of the communications during this command?

    I want to see if either (1) the device is never sending the 1428 status byte or (2) the microcontroller is receiving it but unable to store it into a variable.

    Regards,

    Vince

  • Hi Vince,

    As suggested, I captured waveform with the help of picoscope.

    waveform during charging command, discharging command and command sending to one of the cell is attached below:

    charging command:

    Discharging command:

    Command sent to cell 6:

    kindly go through it.

    one more thing i want to ask as follows:

    We have our customized board TMS570LS0714 for the Active Cell Balancing.  In customized board,we are able to perform discharging from cell to battery pack.But, we unable to perform charging (i.e., power flow from pack to cell).While charging the cell, the code is getting struck at following loop in EMB_Stop():

    if((g_ui32EMB1428Status &(0xF0)) != 0xA0)
    {
    while (1);

    }

     

    We also get the following error:

    Value of the g_ui32EMB1428Status variable is 0x00000010 or 0x000000B0.

    Can we know what does this error indicate? Can you please suggest us a few solutions to resolve this problem?

    I am attaching  schematics. If you need any other information please let us know. 

    Schematics_New (1).pdf

    Thanks and Regards,

    Gargi Pancholi

  • Hi Gargi,

    Thank you for doing this, it is just what I suspected! As you can see during the discharging command, the SPI is correctly transmitting 0b1110 0000.

    However, the  VARIABLE g_ui32EMB1428Status is showing 0x00000000. This means that there is indeed a stack overflow happening, and the microcontroller is not properly reading back the data (because it ran out of stack room and can't store the variable anymore).

    Please follow the steps I outlined previously (move all variable/array declarations to the header file) in order to prevent this. Please follow microcontroller software development best practices as well, in order to reduce the amount of stack usage during any function call.

    Please let me know if you need clarification on what this means!

    Regards,

    Vince Toledo