lpc802 write problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lpc802 write problem

775 Views
99286547
Contributor I

 IAP: write lpc802 the same page 10000 times without erase ,can be writed successful ?

         or is there another method to erase and write the same page within 3ms?

         write one time will be powerdown,and there is no time to erase before.

Labels (1)
Tags (1)
0 Kudos
6 Replies

607 Views
converse
Senior Contributor V

Initialially (after an erase) all bits in flash are set to 1. The *only* thing you can do when writing to flash is to change a bit from 1 to 0. It is impossible to change a bit from 0 to 1, unless you erase the whole page (and thus change every bit in the page to 1). So, it depends entirely on what you want to store in your flash. If you can get away with only changing bits from 1 to 0 (unlikely, but it may suit your need), then it may be possible to write without erase, but if you are storing values, then, you will need to erase a page before writing to it.

0 Kudos

607 Views
99286547
Contributor I

tks so much for your reply.

i see ,if the chip is truely flash,the erase operation is must.

but the lpc802 is real flash or eeprom?

have you tried to write the data 0x55 and then write the data 0xAA without erase successfully?

0 Kudos

607 Views
converse
Senior Contributor V

It is real flash.

Writing 0xAA to a cell containing 0x55 will end up with a value of 0x00 as you can only change he value of he '1' bits.

0 Kudos

607 Views
99286547
Contributor I

i have test the lpc802 as follows.

Writing 0xAA to a cell containing 0x55 will end up with a value of 0xAA without erase.

and i can write any data to a cell  containing 0x00 without erase successfully.

So pls check my questions again,and you must do some test and then reply my questions seriously.

1. IAP: write lpc802 the same page 10000 times without erase ,can be writed successful ?

2. if the chip is truely flash,the erase operation is must. but the lpc802 is real flash or eeprom?

13.1 Flash memory (EEPROM based)
[1] Number of program/erase cycles.
[2] Programming times are given for writing 64 bytes to the flash. Tamb <= +85 刟C. Flash programming with IAP
calls (see LPC802 user manual).

void writeflash(unsigned int DATA_E2_ADDR) // DATA_E2_ADDR=0x2800
{
unsigned short i;
for(i=0;i<0x40;i++)
{
backup[i]=*((volatile uint8_t *)(DATA_E2_ADDR+i));
}
//FLASH_ErasePage(DATA_E2_ADDR+(page&0xC0)); //mask the erase

FLASH_WritePage(DATA_E2_ADDR,backup);
}

0 Kudos

607 Views
converse
Senior Contributor V

I read the LPC802 manual in greater detail. It appears to work in a different way to other LPC parts that I have used.specifically you can write 16 times before requiring an erase, so sorry for misleading you. See the bold section below

From lpc802 User manual section 4.5.7 Copy RAM to flash
When writing to the flash, the following limitations apply:
The smallest amount of data that can be written to flash by the copy RAM to flash command is 64 byte (equal to one page).
One page consists of 16 flash words (lines), and the smallest amount that can be modified per flash write is one flash word (one line). This limitation exists because ECC is applied during the flash write operation, see Section 4.3.3.
To avoid write disturbance (a mechanism intrinsic to flash memories), an erase should be performed after 16 consecutive writes inside the same page. Note that the erase operation then erases the entire sector.
Remark: Once a page has been written to 16 times, it is still possible to write to other pages within the same sector without performing a sector erase (assuming that those pages have been erased previously).

0 Kudos

607 Views
99286547
Contributor I

1. IAP: write lpc802 the same page 10000 times without erase ,can be writed successful ?

i have  writen lpc802 the same address (0x2800) 256 times without erase successfully.

and so far i have wirten the chip without erase successfully.

so i want to know if i can wirte the chip without erase forever?

so if the lpc802 is real eeprom,i will be sure to do that disregard the datasheet .

i  persist in you have to do some test.

if you do not sure about it,pls ask for original designer.

tks so much.

0 Kudos