In LPC1759, I entered ISP through "reinvoke ISP" with the following steps
- Disable PLL
- Reset timer 1
- Re-map interrupt vectors
- Set watch dog timeout
- Reinvoke ISP
After entering into ISP, What exactly happens in the controller? How to check if it is in ISP Mode? After entering ISP, How to get out?
void init(void){
Chip_Clock_DisablePLL(SYSCTL_MAIN_PLL, SYSCTL_PLL_CONNECT);
Chip_TIMER_Reset(LPC_TIMER1);
Chip_SYSCTL_Map(REMAP_BOOT_LOADER_MODE);
}
int main(void)
{
uint32_t wdtFreq;
wdtFreq = Chip_Clock_GetPeripheralClockRate(SYSCTL_PCLK_WDT) / 4;
init();
Chip_WWDT_Init(LPC_WWDT);
Chip_WWDT_SetTimeOut(LPC_WWDT, wdtFreq / 10);
Chip_IAP_ReinvokeISP();
DEBUGSTR("HELLO\n\r");
return 0;
}