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.

BQ76952: OTP programming

Part Number: BQ76952

Hello E2E,

Good day. 

What is the recommended way to ensure OTP is fully programmed? Is there another register that can be polled to wait for OTP programming to finish?
If not, is it sufficient to delay for (n/5 + 1) ms with n being the number of bytes programmed before Exit_Config_Update_Mode? The technical reference mentions an approx. time of 200 us per byte. What happens if Exit_Config_Update_Mode is issued before all bytes are written to OTP?

Regards,
Carlo

  • Hi Carlo,

    When the OTP_WRITE command is sent, the firmware needs to analyze which registers need to change (the OTP only stores the bit differences from the default values), then it writes the OTP and rechecks. So it will actually take much longer than the 200 us per byte. I think it may take several ms to complete, but I have seen other users wait 100 ms to be safe with plenty of margin. Here is the recommended sequence below (I plan to update the OTP programming guide with this sequence). Some of these steps can be skipped if you are not planning to seal the device or if you know the device OTP has never been written.

    1. Check if OTP is already programmed: check one of the target programmed registers like REG12 Config to check is OTP programming has been done already.
    2. If OTP programming is required, read the Battery Status Register to check if SEC1-SEC0 is 01 (in FULLACCESS mode). 
    3. If in FULLACCESS mode, enter CONFIG_UPDATE mode, read Battery Status Register to check in CONFIG_UPDATE mode.
    4. Configure Data Memory based on requests.
    5. Exit CONFIG_UPDATE mode, read Battery Status Register to check out of CONFIG_UPDATE mode.
    6. Read the Data Memory value to check if above writing Data Memory process succeed.
    7. If writing Data Memory was successful, enter CONFIG_UPDATE mode, read Battery Status Register to check in CONFIG_UPDATE mode.
    8. Check if OTP is allowed (Battery Status Register -> OTPB is clear).
    9. Read 0x00A0 (OTP_WR_CHECK) to check if OTP programming is ok (return 0x80).
    10. If 0x00A0 returns 0x80, send 0x00A1 command (0x3E = 0xA1, 0x3F = 0x00).
    11. Wait 100ms, read 0x40 to check if OTP programming succeeded (0x80 indicates success).
    12. Exit CONFIG_UPDATE mode, read Battery Status Register to check out of CONFIG_UPDATE mode.

    Best regards,

    Matt