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.

Will this code clear the memory block in the flash memory?

Status
Not open for further replies.

london

Member level 4
Joined
Jun 30, 2006
Messages
79
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,945
following program i wrote
{
while(FCTL3 & BUSY);
FCTL2 = FWKEY + FSSEL1 + FN0; // SMCLK/2 = ~500kHz
FCTL3 = FWKEY; // Clear LOCK
FCTL1 = FWKEY + ERASE; // Enable segment erase
*(unsigned int *)0x1000 = 0; // Dummy write, erase info B

while(FCTL3 & BUSY);
FCTL1 = FWKEY + WRT; // Enable write
Lock_f=Lock;

while(FCTL3 & BUSY);
FCTL1 = FWKEY; // Done. Clear WRT
FCTL3 = FWKEY + LOCK;
}

conform me when prog execute the bolded line will be clear the memoey block or only the 0x1000 memory segment in the flash memory?
 

flash memory

Hi,

It will clear when your program has execute that line.
that is thw value of 0x1000 is 0;

the function of your line same as below

int *p;
p= (unsigned int*)0x1000;
*p=0;

by

arsamy
 

    london

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top