I'm developing code on LPC23xx, previously on LPC2378 which I then
swapped out for an LPC2387 (Nice that the MCB2300 has pads for both
packages)
I recently started playing with in application programming of the
flash memory. I must say it has disappointed me somewhat, the IAP
documentation in the user manual is not very good.
What disappoints me the most is the extremely slow speed I'm getting,
the following routine that burns 16kB of data into a 32kB page takes a
good 400ms to execute, that's almost a half second during which I
cannot access any part of the flash at all. I'm running at 72MHz. The
erase operation seems to be the slowest part but I haven't checked if
different values of data in RAM (non FF) make the burn process even
slower.
#define CLOCK_KHZ 72000
IAP iap_entry=(IAP) IAP_LOCATION;
command[0] = IAP_PREPARE;
command[1] = 13 + page;
command[2] = 13 + page;
FIO2SET = 0x02;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_ERASE;
command[1] = 13 + page;
command[2] = 13 + page;
command[3] = CLOCK_KHZ;
FIO2SET = 0x04;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_PREPARE;
command[1] = 13 + page;
command[2] = 13 + page;
FIO2SET = 0x08;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_COPY;
command[1] = &page0data;
command[2] = scratchspace;
command[3] = 4096;
command[4] = CLOCK_KHZ;
FIO2SET = 0x10;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_PREPARE;
command[1] = 13 + page;
command[2] = 13 + page;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_COPY;
command[1] = (uint32_t)&page0data + 0x1000;
command[2] = (uint32_t)scratchspace + 0x1000;
command[3] = 4096;
command[4] = CLOCK_KHZ;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_PREPARE;
command[1] = 13 + page;
command[2] = 13 + page;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_COPY;
command[1] = (uint32_t)&page0data + 0x2000;
command[2] = (uint32_t)scratchspace + 0x2000;
command[3] = 4096;
command[4] = CLOCK_KHZ;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_PREPARE;
command[1] = 13 + page;
command[2] = 13 + page;
while(rcode = iap_entry(command, result) == 11) { }
command[0] = IAP_COPY;
command[1] = (uint32_t)&page0data + 0x3000;
command[2] = (uint32_t)scratchspace + 0x3000;
command[3] = 4096;
command[4] = CLOCK_KHZ;
while(rcode = iap_entry(command, result) == 11) { }
Is there any way to speed this up? I'm very disappointed that I have
found zero information about what kind of time I should expect these
operations to take. 400ms is an enormous amount of time to halt
execution for. I should still be able to execute interrupts if I just
put interrupt handlers and all of the code and data associated with
them into RAM, right? I can't fit everything needed by my interrupts
into RAM but I have some core functionality that I absolutely cannot
afford to lose for a half second, 100ms would be ok.
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )
hello,
I am new to lpc group and using lpc board 2387 for the first time.
We have the evaluation board MCB2300, with cpu - lpc2387.
I am not able to test anything with this. The realview, ide which comes along with the cd
of evaluation board is not working, we are trying with some simple sample - blinky , using
winarm, we are using flash magic to download the hex file to the board using serial port.
Please help with the sample and the procedure to download the same and test it.
The blinky code is as below:
#include "LPC23xx.h"
void wait (void) { /* wait function */
int d;
for (d = 0; d < 1000000; d++); /* only to delay for LED flashes */
}
int main (void) {
unsigned int i; /* LED var */
IODIR1 = 0x00FF0000; /* P1.16..23 defined as Outputs */
while (1) { /* Loop forever */
for (i = 1<<16; i < 1<<23; i <<= 1) { /* Blink LED 0,1,2,3,4,5,6 */
IOSET1 = i; /* Turn on LED */
wait (); /* call wait function */
IOCLR1 = i; /* Turn off LED */
}
for (i = 1<<23; i > 1<<16; i >>=1 ) { /* Blink LED 7,6,5,4,3,2,1 */
IOSET1 = i; /* Turn on LED */
wait (); /* call wait function */
IOCLR1 = i; /* Turn off LED */
}
}
}
Thanks in advance
Thanks and regards
Preethi Sreenath
[Non-text portions of this message have been removed]
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )