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.

UCD90160: Clear Data Flash command not written

Part Number: UCD90160


When trying to clear data flash, I run the following commands:

BlockWrite,0x35,0xE2,0x0400000104
BlockWrite,0x35,0xE3,0x00008820
BlockWrite,0x35,0xE2,0x0414000104
BlockWrite,0x35,0xE3,0x00000100
Pause,250,Pausing 250 ms
BlockRead,0x35,0xE3

However, often the BlockRead of 0xE3 at the end returns 0x00000900 or 0x00000000. Worse yet, sometimes the data flash is not always cleared.

Am I missing something in the write command? How can I ensure the clear data flash command is being run correctly?

  • Hi

    You can use those commands to erase the flash once per reset. Device ignore the 2nd erase.

    I assume that you have the byte account added.

    If you read 0x00000900 back, the flash is unavailable for actions. you may check it to ensure bit 11 is 0 before issue 00000100 to erase it.

    Regards

    Yihe 

  • Thank you Yihe, I must have been running this command a second time within a reset.

    Could I set the RESET_COUNT or initiate a SOFT_RESET with one of the following commands before clearing to guarantee the erase command executes?

    WriteByte,0x35,0xDB,0x01  // SOFT_RESET

    or 

    WriteByte,0x35,0xDC,0x00 // RESET_COUNT

  • Otherwise, you mentioned I could check to ensure bit 11 is 0 before issuing 0x00000100 to erase.

    Could I do the following?

    BlockWrite,0x35,0xE3,0x00000000 // Ensure bit 11 is 0

    BlockWrite,0x35,0xE3,0x00000100 // Erase

  • Hi

    For the reset, please use 0xDB. RESET_COUNTER does not trigger device reset.

    You have to read to ensure bit 11 is 0 before issuing 0x00000100. You can not write bit 11 since it is a status bit.

    Regards

    Yihe