I posted this to the LPC2000 list a while ago - thought it may be useful to people here as well :
There are some omissions from the NXP UM (LPC2136/01) regarding the 'Reinvoke ISP' command in IAP (this is used to get into the bootloader where the P0.14 pin is not easily accessible)
Before making the call to start the bootloader, you need to set SCS to 0 to disable fast IO, and set U0FDR to 0 to disable the fractional baudrate divider. I suspect the same issues apply to all parts with FIO and fractional baudrate divider.
This code (IAR) works :
__arm void startboot(void)
{
__disable_interrupt();
PLLCON=0;
PLLFEED = 0xAA;
PLLFEED = 0x55;
SCS=0; // disable fast IO
U0FDR=0; // no FDR - causes wrong baudrate if <>0
asm("mov r0,#0x40000000");
asm("mov r1,r0"); // even though no return expected, R1 MUST be initialised!
asm("mov r2,#0x39");
asm("str r2,[r0]");
asm("mov r2,#0x7ffffff1");
asm("bx r2");
}
There are some omissions from the NXP UM (LPC2136/01) regarding the 'Reinvoke ISP' command in IAP (this is used to get into the bootloader where the P0.14 pin is not easily accessible)
Before making the call to start the bootloader, you need to set SCS to 0 to disable fast IO, and set U0FDR to 0 to disable the fractional baudrate divider. I suspect the same issues apply to all parts with FIO and fractional baudrate divider.
This code (IAR) works :
__arm void startboot(void)
{
__disable_interrupt();
PLLCON=0;
PLLFEED = 0xAA;
PLLFEED = 0x55;
SCS=0; // disable fast IO
U0FDR=0; // no FDR - causes wrong baudrate if <>0
asm("mov r0,#0x40000000");
asm("mov r1,r0"); // even though no return expected, R1 MUST be initialised!
asm("mov r2,#0x39");
asm("str r2,[r0]");
asm("mov r2,#0x7ffffff1");
asm("bx r2");
}