Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

RE: [lpc2000] Re: LPC2146 IAP Erase & Write not working.

2005-12-08 by Joel Winarske

This code works:
http://groups.yahoo.com/group/lpc2000/files/EE_demo.zip
(code here modified from original)

unsigned int command_iap[5];
unsigned int result_iap[3];
unsigned char memmap;

__disable_interrupt();
memmap = MEMMAP;        // get current memory map
MEMMAP = MEMMAP_FLASH;  // map User Flash into low 64 bytes

command_iap[0]=50;      //prepare sectors for erase
command_iap[1]=EE_SEC_L;
command_iap[2]=EE_SEC_H;
iap_entry=(IAP) IAP_LOCATION;
iap_entry(command_iap,result_iap);

command_iap[0]=52;      //erase sectors
command_iap[1]=EE_SEC_L;
command_iap[2]=EE_SEC_H;
command_iap[3]=EE_CCLK;
iap_entry=(IAP) IAP_LOCATION;
iap_entry(command_iap,result_iap);

command_iap[0]=53;      //blankcheck sectors
command_iap[1]=EE_SEC_L;
command_iap[2]=EE_SEC_H;
iap_entry=(IAP) IAP_LOCATION;
iap_entry(command_iap,result_iap);

MEMMAP = memmap & 0x03; // restore the memory map
__enable_interrupt();


Joel

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.