Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

erase and program flash memory

Status
Not open for further replies.

electronicsman

Full Member level 5
Joined
May 4, 2012
Messages
291
Helped
11
Reputation
22
Reaction score
12
Trophy points
1,298
Activity points
3,737
For pic 16 bit micro controllers if i erase program flash memory what will be the data in flash? Because if i read the program memory after erasing it shows 0xFF. So if i write the data 0xFF in the program memory how does it distinguish if it is erased data or actual data?
 

Hi,

The answer surely is written in the datasheet. Read it.

But it's quite usual that there is 0xFF.

"How does it destinguish..?
What is it good for? Just consider 0xFF as empty.

A glass of beer is considered empty even if it is full of air ;-)

Or on a harddisk. If you "delete" a file, then just the entry in the index is modified. No file data is overwritten.

Klaus
 

if i write the data 0xFF in the program memory how does it distinguish if it is erased data or actual data?

It is not you who will write it ( because of its Harvard architecture ), but the programmer, and along with the binary code itself, the generated .Hex file has added on it several verification words which allows the programmer software to check if the recording process was made correctly or not.
 

In bootloader program i am actually wrting the data using flash routines.
 

Ok, anyway considering that you know what data must be stored there, why are you concerning on that ? If you want to load 0xFF and check it by reading 0xFF the data is supposed correct. There is not a 3rd state than 0 and 1 for the bits, so the only way you have to check if there is a 'problem' in a specific address location is to write/read different patterns (e.g 0x55 and 0xAA) just before writing the correct data to see if it accept all possible values at each bit of each byte.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top