Yahoo Groups archive

Lpc2000

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

Message

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

2006-01-04 by Joel Winarske

I have example project for IAR.  It uses the code as listed below.

Joel


> Hi Joe,
> I got it work but as soon as I turn on any interrupt it hang.
> do you have some thing that works already?
> thanks
> 
> --- In lpc2000@yahoogroups.com, "Joel Winarske" <joelw@i...> wrote:
> >
> > 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
> >
> 
> 
> 
> 
> 
> 
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
>

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.