Program doesn't run after power cycle (LPC2368, IAR)

Colleagues,

I have a custom board with LPC2368 and an LCD, which allows me to see of the program is running or not. LPC uses internal oscillator with PLL as CPU clock. Program is written in IAR Embedded Workbench 5.11, downloaded with yellow J-Link.

I want my program to start and to run without J-Link, but the actual results are slightly different:

  1. Download the program (Flash Release) into LPC using J-Link. OK

  2. In the EWARM click “Go”. OK. Life signs show on the LCD.

  3. In the EWARM click “Stop debugging”. OK. Life signs stay on the LCD.

  4. Unplug J-Link. OK. Life signs stay on the LCD.

  5. Turn off the power. Wait 30 sec. Turn on the power. On power-up the life signs don’t appear on the LCD.

What could be causing the program not to start by itself on power-up?

At least one of the problems is that PLL doesn’t lock, and the progran gets stuck waiting for the PLL to lock:

  // Enable PLL
  PLLCON_bit.PLLE = 1;
  PLLFEED = 0xAA;
  PLLFEED = 0x55;

  // Wait for the PLL to achieve lock
  while(!PLLSTAT_bit.PLOCK); // stuck here

What could be causing the PLL to lock with J-Link, but not to lock without it?

  • Nick