Thanks Ricardo for your reply.
Your code above doesn't seem to be working for both LPC11U68 development board and my board in which there is a LPC11U68 chip. I checked whether it appeared as a Mass Storage Class (MSC) device or not.
See an example picture below which shows I could go into the ISP mode by pressing the switch(PIO0_1 pin) and by applying power to the board (Resetting the board). The idea is that my PC application would access CRP DISABLD (E:) drive and replace it with a newer firmware. This way, we could update the firmware in the field. Our product won't have any button, that's why I would like to go into the ISP mode at the runtime when I get a command from the PC application.

Do you have any other suggestion for the field firmware update?
Can you update the firmware by using Tera Term or Flash Magic?
When I ran your code, it appeared as follows instead of the picture above.

My code below seems to be working if I comment out the line, LPC_IOCON->PIO0[3] &= (1 << 0);.
However, with LPC11U68 development board it seems to be working no matter that I comment out that line or not.
#include <board.h>
#define POWER_CON_SYSOSC (1<<5) /*register value to enable the power to system oscillator*/
#define BYPASS 1 /*register value to set Bypass system oscillator*/
#define FREQRANGE (1<<1) /*register value to determin frequency range for low-power oscillator*/
#define PLL_CTRL_CONFIG 0x23 /*register value to configure the PLL*/
#define PLL_ON ~(1<<7) /*register value to enable the PLL*/
#define PLL_LOCK 0x01 /*register value to lock the PLL*/
#define CLK_SEL_PLLOUT 3 /*register value to set the main system clock to the output of the pll*/
#define GPIO_CLK_EN (1<<6) /*register value to enable the clock signal to GPIO block*/
#define IOCON_CLK_EN (1<<16) /*register value to enable the clock signal to IOCON block*/
#define TIMERS_CLK_EN (0xF<<7) /*register value to enable the clock signal to all timers*/
#define UART_CLK_EN (1<<12) /*register value to enable the clock signal to UART block*/
#define PINT_CLK_EN (1<<19) /*register value to enable the clock signal to pin interrupt block*/
#define SSP0_CLK_EN (1<<11) /*register value to enable the clock signal to SSP0 block*/
#define SSP1_CLK_EN (1<<18) /*register value to enable the clock signal to SSP1 block*/
#define ADC_CLK_EN (1<<13) /*register value to enable the clock signal to ADC block*/
#define USB_CLK_EN (1<<14) /*register value to enable the clock signal to USB block*/
#define PIO0_17_D5_LED (1<<17) /*register value for the control bit for PIO0_17 pin*/
#define CLR_PIN_CONFIG 0x00000000 /*value to clear a pin's IOCON register*/
#define PULL_UP_EN (0x02<<3) /*register value used to set a GPIO pin to have an internal pull up resistor*/
#define USB_VBUS (1<<0) /*register value to configure pin as USB VBUS*/
#define PULL_UP_PULL_DOWN_INACTIVE ~(3<<3) /*register value to configure pin so that the internal pull-up/pull-down resistors are not active*/
int main(void) {
// System clock settings
LPC_SYSCTL->PDRUNCFG &= ~(POWER_CON_SYSOSC); ///Power-up System Osc
LPC_SYSCTL->PDRUNCFG &= ~(1<<4); /*ADC powered*/
LPC_SYSCTL->SYSOSCCTRL &= ~(BYPASS); /*system oscillator control register: Oscillator is not bypassed, frequency range is 1 - 20 MHz*/
LPC_SYSCTL->SYSOSCCTRL &= ~(FREQRANGE);
/*configure pll to give 48MHz clock output*/
LPC_SYSCTL->SYSPLLCTRL = PLL_CTRL_CONFIG;
LPC_SYSCTL->PDRUNCFG &= PLL_ON;
/*wait for pll lock*/
while(!(LPC_SYSCTL->SYSPLLSTAT & PLL_LOCK))
{
/*do nothing*/
}
/*connect main clock to pll output*/
LPC_SYSCTL->MAINCLKSEL |= CLK_SEL_PLLOUT;
LPC_SYSCTL->MAINCLKUEN = FALSE; /*Toggle enable for setting to take effect*/
LPC_SYSCTL->MAINCLKUEN = TRUE;
/*enable clock to required peripherals*/
g_systemControl->SYSAHBCLKCTRL |= IOCON_CLK_EN ///enable clock to IOCON
| USB_CLK_EN ///enable clock to USB
| GPIO_CLK_EN ///enable clock to GPIO
| TIMERS_CLK_EN ///enable clock to timers
| PINT_CLK_EN ///enable clock to pin interrupts
| SSP0_CLK_EN ///enable clock to SSP0
| ADC_CLK_EN; ///enable clock to ADC
//GPIO settings
LPC_IOCON->PIO0[1] &= 0;
LPC_IOCON->PIO0[1] |= (0x02<<3); /*internal pull up resistor*/
/// USB_VBUS config
LPC_IOCON->PIO0[3] |= (1 << 0); /// Set up of PIO0_3 register to USB_VBUS
LPC_IOCON->PIO0[3] &= (1 << 0); /// and inactive pull-up/pull-down resistors
LPC_GPIO->DIR[0] |= PIO0_17_D5_LED; /// Port 0 - pin 17 LED
while(1) {
LPC_GPIO->SET[0] |= PIO0_17_D5_LED; /*Pin high initially so LEDs are On*/
for (int j = 0; j < 1000000; j++)
{
}
LPC_GPIO->CLR[0] |= PIO0_17_D5_LED; /*Pin low so LEDs are off*/
for (int j = 0; j < 1000000; j++)
{
}
Chip_IAP_ReinvokeISP();
}
}
Thanks for your help.
David