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.

20Z75 breakdown after I connect it with MSP430's SMbus

Other Parts Discussed in Thread: MSP430F2132, BQEVSW, BQ2000

Hi, guy :

  I'm trying to write code into MSP430f2132 using for communicating with 20Z75 . But 20Z75 breakdown after I connect it with SMBus ( SMDB, SMCK pull high with 10k resistors ,3.3V support from MSP430 uC ) and I send some command to 20Z75 also. Does anyone have the same experience ?

BR Stone

  • What do you mean by 'breakdown'?

    If it's in ROM mode, you may send sbs command 0x08 to get back to normal mode. Use TI's bqEVSW tool (downloadable from bq20z75 web folder) to communicate to this device when you are trying to revitalize it.

  • Dear SimonW :

    20Z75 breakdown means it cann't communication with PC via  this software. So, do you have any suggestion ?

  • Have you tried sending 0x08 command to the IC using bqEVSW PRO screen?

  • Hi, Simon W :

    Yes, I have tried sending 0x80 command, but  it can't be waked up.

    BR

    Stone

  • The IC memory might have been corrupted during the programming. You'll have to replace the IC I'm afraid. On the other hand, work on the MSP430 SMBus communication code, look at the waveforms with a scope to find if there's any incompatibility with SBS v1.1 protocol.

  • Dear SimonW :

      I've replaced a 20Z75, but it cannot communicate with PC. After I inspect "bq20Z75 Technical Reference Maunal.pdf" , I find 20Z75 is in Master mode SBS bus 1.1 . I suspect this is the main reason causing this chip breakdown ( I set MSP430F2132's SMbus to be Master also ). If you are kind to give me a example code or document I will appreciate it.

    BR

    Stone 

  • Hi Stone,

    the z75 is most of the time in slave mode, except once in a while it broadcast charging voltage and charging current to the SMBus line as a master. But this should not lead to loss of communications.

    From what I heard from you, your problem seems to be different. The best debug approach is to read the 'System Management Bus specification, revision 1.1', and take oscilloscope shots of our EV2300 interface and compare against your MSP430 bus waveform. It could be as simple as wrong address, timing, or it could be lack of padding on the ACK signals. I don't have sample code on SMbus with MSP430.

  • Hi Simon,

    I think you are the Simon Wen that will be on Brazilian tech day next September, isn't it?

    Well guy, i am Leonardo and a work in Samtronic and me and my associates want to use a Li-ion battery in our next project and we are using the bq20z75 and the bq2000 to form our charger.

    I can do the bq20z75 with BqEVSW works so well, but now i need to stabilish the communication to the microntroller and i couldn´t do that.

    I don't know what commands i have to write in my source code.

    What is the SBS commands, i have to write this commands in my source code???

    I'm using a ARM microcontroller to try to communicating with the BQ20z75 and i'm programming in language C.

    Thanks

    BR

    Leonardo

  • All SBS commands for communicating to the device are described in the Technical Reference manual. The device complies to SBS v1.1 standard and you could read voltage, current, temperature, RSOC, etc via these commands. 

  • Dear SW

    I'm trying to stabilish the communication (SMBus) between the bq20z75 and my microcontroller i ask: Should i have to write the SBS commands in my source code? For example: If i want to read the current value, should i write the 0x0a in my source code?

    Thanks for the attention

    BR

    Leonardo

  • Yes, you must specify the SBS command in your source code. Suppose you have implemented an SMBus function for reading a word, ReadSMBWord(cmd, address); in Visual Basic to read the current you can set cmd = &H0A, and address is &H16.

  • Dear SW,

    Thank you so much for help me with this development.

    I still have some problems to stabilish the communication between my microcontroller and the bq20z75, i would like to know if i could configure the bq20z75 to slave mode instead of master mode?

    One more question, what's the differences of the SMBus protocol and I2C protocol beyond the frequencies?

    Thanks for all attention.

    BR.

    Leonardo

  • Leonardo,

    I think most likely you have a timing issue.

    The best approach to me is to first thoroughly read the SMBus communication specification, which you could download from http://smbus.org/ 

    Then to establish confidence with your communication routine, you could use an oscilloscope to monitor the SMBus on the bq20z75 EVM, sending one simple command each time such as reading the voltage. You could compare your waveform against the one from EV2300 and find exactly what was causing the problem. 

    bq20z75 operates in Slave mode most of the time, and works in Master mode only momentarily when broadcasting safety alert or charging voltage and current. You could disable the master mode by: clearing the [BCAST] bit from Operation Cfg B.

    Difference between I2C and SMBus: Using an existing I2C engine to run SMBus usually work just fine.  Many modern I2C hardware ports on MCU’s can run at 400 KHz or 100 KHz.  Always use 100 KHz for SMBus.  Even then, sometimes the port will exceed 100 KHz.   Also make sure that there are no possibilities for the clock to be high more than 50 microseconds.

  • Dear SW,

    I have one more question: The bq20z75 could work just in slave mode? Can i have all the information from it even the bq20z75 being in slave mode?

    For my application it would be better if i can use the bq20z75 just in slave mode.

    Thanks

    Leonardo

  • By disabling broadcasting, the bq20z75 would work entirely in slave mode. You always have access to all standard SBS data using SMBus read command. 

  • SW,

    Thanks for the information, so does it means that i can just read the information from the bq20z75 using the SMBus read command, but i can't write any information in the Bq20z75?

    Thanks a lot for help me,

    Leonardo

  • Yes, you can. Setting the device to slave mode does not change the way bq20z75 is accessed, be it read or write. 

  • Dear ,

    Try to down  speed from 100Khz to 50Khz  for  reduce CPU whether can not handle the speed ?

  • Dear

    I could do the bq20z75 communicates with the microcontroller, now I have another doubt: I want to program the Bq20z75 Data Flash through the Smbus broadcast. I could read and could write the parameters from the bq20z75, do you have any document or suggest to access the Bq20z75 Data Flash using the microcontroller and the bq ?

    Thanks

    Leo

  • We do not have microcontroller code sample. However, you can refer to the bq20z75 Technical Reference (document # sluu265), Section C: Data Flash.

    It has information and example showing how to access the device's data flash.

    If you would like to read/write the entire data flash for production use, you can refer to app note: Data Flash Programing & Calibrating the bq20zxx Gas Gauges (slua 379).

  • Hi,

    I've looked at the bq20z75 technical reference, but I haven't understood well, because in this document, the example refers to the Data Flash Subclass and an offset, I've been trying to understand what's the correct sequence, it's a little doubtful. If you have any suggestion, it would be great.

    I don't like to read/ write the entire data flash for production use. I would like to do most of the things that the EVSW does in my source code, like read/ write the registers and read/ wirte the Data Flash. If this works my product would have it into the source code.

    Thanks a lot.

    Leo

     

  • All data flash parameters are identified by subclass and offset (see below)

    Class1

        |-> SubClass1

                 |-> Offset1: DF DataA

                 |-> Offset2: DF DataB

                     :

        |-> SubClass2

             |-> Offset1: DF DataF

             |-> Offset2: DF DataG

                  :

    Class2

        |-> SubClass3

              |-> Offset1: DF DataS

              |-> Offset2: DF DataT

                   :

    For example, to access DF DataA, you need to tell the device it's located at SubClass1, Offset1.

    You can find the full list of subclass, offset, data type information in the Tech Manual section C.14: DataFlash Value.

     

    All data accesses (either read/write) are done in page (i.e. 32byte)

    You will use DataFlashSubClassID command 0x77 to tell the device which subclass you are going to access.

    Use DataFlashSubClassPage1..8 (0x78..0x7F) to tell the device which page (where the offset is located) you are going to access.

     

    Follow the example given in Tech Manual section C.1.4. You can use the pro screen of EVSW and follow the example to grasp the read/write concept before implementing to code.

  • Hi,

    Thanks for your suggestion.

    I've looked at your foregoing message and at the tech manual C.1.4 too, but what it is not so clear for me is how I can access the offset's.

    For example, in the tech manual is mentioned that there are 8 pages of DataFlash which contains the offsets, but how is that done?

    In Tech Manual is mentioned that every single DataFlashSubClassPage1...8 has 32 bytes of size,  but when I have to access each one of them?

    Following the example given in Tech Manual section C.1.4 I've understood the first part (DataFlashSubClassID), but the second one I couldn't do it, please follow my comments on the example:

    To write the value of Term Voltage to a value of 8.7 V the following sequence is used.

    Read complete Gas Gauging-IT Cfg subclass (SubclassID = 80) into RAM:
    • Write Subclass ID
    – SMB Slave Address (0x16)
    – SMB CMD 0x77 with 0x0050 as data (=80 decimal)
    [Leo]: I could do it into my source code.OK

    Read Subclass (2 blocks are needed as its over 32 bytes long)
    – SMBSlave Address (0x16)
    – SMB CMD 0x78 receiving 32 bytes of data
    – SMB CMD 0x79 receiving 32 bytes of data

    [Leo] This part of the code I couldn't understand yet because of I can not see why the Subclasses 0x78 and 0x79 are accessed?


    Overwrite offset 45 of received data with 8.7 V:
    • Update offset 45 of second block with 0x21fc (=8700 decimal)

    [Leo]: I just need to know how to access the offset, in this example, why this subclasses (0x78 & 0x79) are mentioned?

    Thanks a lot for your help.

    Leo

     

  • 0x78 and 0x79 from section C.1.4 example are not referring to the subclass ID. Those are the SMB command to access the subclass page.

    Each subclass can have up to 8 pages, each page is 32 byte long. The C.1.4 example provides 2 ways to access the data.

    The example is to change the Term Voltage, which is located at subclass ID = 80 and offset = 45. The datatype is I2, meaning it's a 2-byte signed integer (see section C.14 Dataflash values). Since the offset = 45, and each page is 32-byte long, this mean Term Voltage is located at page2 of subclass 80.

    -Approach 1 in C.1.4 example-

    1. Point to the desired class (in the example, i.e subclass ID 80) using SMB cmd 0x77

    2. Read subclass data from page1 to page2 using SMB cmd 0x78 and 0x79 (you probably save the 64-byte data from both pages in an array)

    3. Update array data at index 45 and index 46 (because the offset = 45 and the Term Voltage is 2-byte long)

    4. Point to the desired class again using SMB cmd 0x77

    5. Write the updated array back to page1 (SMB cmd 0x78) and page2 (SMB cmd 0x79)

     

    -Approach 2 in C.1.4 example-

    1. Point to the desired class (in the example, i.e subclass ID 80) using SMB cmd 0x77

    2. Since offset = 45 mean the data is in page2, read subclass page 2 using SMB cmd 0x79 to an array

    3. Update value in index 13 (45-32) of the array.

    4. Point to the desired class again using SMB cmd 0x77

    5. Write the updated array back to page2 (SMB cmd 0x79)