Reply by Jeroen January 23, 20052005-01-23
"Thomas" <thomas@tho-bai.de> wrote in message
news:41f4284f$0$17610$9b4e6d93@newsread4.arcor-online.net...
> Hi there, > > I've got a little question. Im using the BM29F400 Flash Memory EEPROM by > BRIGHT Microelectronics Inc with a C164CI microcontroller (Infineon). > After the command sequence for erasing a sector the following code is > executed: > > check_erase: > MOV R3,[R2] > AND R3,#0080H > CMP R3,#0080H > JMPR CC_NZ,check_erase > JMPR CC_UC,read_mode_enable > > The register R2 contains the start adress of the erased sector. > > I guess that means that the first Byte of the erased sector must contain > 10000000B. Is that right? Does only the first Byte contain this data when > the sector is erased or does every Byte contain 80H? And if this is true, > why is it? I thought that in an erased state every bit is high (or low). > But this doesn't really make sense to me. So please correct me if I'm > wrong, because I'm just beginning handling that stuff. > > Thanks for your help. > > Thomas
This piece of code detects when the Flash device has finished erasing the sector. Erasure takes a few milliseconds. Some flash devices have a dedicated RDY/BSY line for this purpose, but to save on I/O, there's the other method used here. Every time you read a location, the flash chip toggles DQ7 or stays high, and when it stops toggeling or becomes low you know the erase operation has completed. This kind of information is in the datasheet of the particular Flash device used. Jeroen
Reply by Thomas January 23, 20052005-01-23
Hi there,

I've got a little question. Im using the BM29F400 Flash Memory EEPROM by
BRIGHT Microelectronics Inc with a C164CI microcontroller (Infineon).
After the command sequence for erasing a sector the following code is
executed:

check_erase:
                MOV     R3,[R2]
                AND     R3,#0080H
                CMP     R3,#0080H
                JMPR    CC_NZ,check_erase
                JMPR    CC_UC,read_mode_enable

The register R2 contains the start adress of the erased sector.

I guess that means that the first Byte of the erased sector must contain
10000000B. Is that right? Does only the first Byte contain this data when
the sector is erased or does every Byte contain 80H? And if this is true,
why is it? I thought that in an erased state every bit is high (or low).
But this doesn't really make sense to me. So please correct me if I'm
wrong, because I'm just beginning handling that stuff.

Thanks for your help.

Thomas