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.

LP8860-Q1 Initializing the EEPROM always fails.

When I set breakpoints in this routine, the EEPROM programs correctly.  When this routine is allowed to run without interference, the EEPROM fails to program.  Please tell me where and how I can improve on this to make it work.

/* Enable the LED driver and wait for ready */
IO_SetOutputLevel(PCR_LED_ENABLE, IO_OUTPUT_LEVEL_HIGH);
while ( IsLedEepromReady() == 0)
{
/* just wait a bit */
}

/* make ready with the unlock */
spiMsg
= (UNS16)((LP_EEPROM_UNLOCK_ADDR + 1) << 8) | LOCK1;
(
void) SPI1_Send2Bytes( &spiMsg);
spiMsg
= (UNS16)((LP_EEPROM_UNLOCK_ADDR + 1) << 8) | LOCK2;
(
void) SPI1_Send2Bytes( &spiMsg);
spiMsg
= (UNS16)((LP_EEPROM_UNLOCK_ADDR + 1) << 8) | LOCK3;
(
void) SPI1_Send2Bytes( &spiMsg);
/* blaze in the 25 byte configs */
for (idx = 0; idx < eeSize; idx++ )
{
spiMsg
= (UNS16)((((LP_EEPROM_START + idx)<<1) + 1)<<8) | LEDDRV_EE.LedDriverEepromDef[idx];
(
void) SPI1_Send2Bytes( &spiMsg);

}
/* burn the EEPROM */
spiMsg
= (UNS16)((LP_EEPROM_CONTROL_ADDR + 1)<<8) | 0x02; /* start the burn */
spiReply
= SPI1_Send2Bytes( &spiMsg);
while ( IsLedEepromReady() == 0)
{
/* just wait a bit */
}
spiMsg
= (UNS16)((LP_EEPROM_CONTROL_ADDR + 1)<<8) | 0x00; /* stop the burn */
spiReply
= SPI1_Send2Bytes( &spiMsg);
spiMsg
= (UNS16)((LP_EEPROM_UNLOCK_ADDR + 1)<<8) | 0x00; /* lock the door */
spiReply
= SPI1_Send2Bytes( &spiMsg);

This routine starts by setting the VDDIO/EN pin high and then polling the EEPROM_CONTROL_REG to see when the READY_BIT gets set.  Next the process unlocks the EEPROM..  The FOR loop controls writing all 25 bytes with the required values. We then write the bit to do the EEPROM burn.  While the burn is happening we are polling the CONTROL register for the READY_BIT once again. The next step turns off the burn bit and locks the EEPROM.

The Send2Bytes sub writes two bytes into the SPI registers and waits for the returning two bytes.  So there is no overrun possible in the SPI.

  • Hi James,

    On our production ATE hardware where we do the initial EEPROM program we are not polling the EEPROM ready bit but have fixed delays like this:

    - EEPROM Unlock (0x1A=0x08, 0x1A=0xBA, 0x1A=0xEF)

    - Wait 5ms

    - Program Registers

    - Burn EEPROM (0x19=0x02)

    - Wait 250ms

    - End Burn (0x19 0x00)

    Since it is working on our tester with fixed delays and on your set-up when you add break points, it sounds like the issue is with the timing of when the EEPROM ready is asserted.  Can you add 5ms fixed delay between the "make ready with the unlock" and "blaze in the 25 byte configs " and a 250ms delay between the "burn the EEPROM " and "stop the burn"?

    I expect the likely culprit is the time between starting and ending the burn.  But if you were to read back the register values after the "blaze in the 25 byte configs" it would tell us if the issue is with EEPROM unlock timing or EEPROM burn timing.  If registers are correct after the "blaze in the 25 byte configs" then it would confirm that the unlock executed correctly.

    Thanks,

    Jeremy