Content originally posted in LPCWare by mc on Sat Mar 08 18:43:00 MST 2014
Hi Charchar,
In your below code you have used PIn P2_7, which is an ISP pin. In your code this pin is configured as an output pin. When Core Reset is applied LPC4300 Microcontroller resets itself. After that LPC4300 samples this ISP pin. As you have used this pin in your software, pin may be low at power on and device can go into ISP mode. To avoid this situation, my recommendation is to add an external pull up resistor at this pin.
Quote:
int main(void)
{
volatile uint32_t d;
// set led muxes
scu_pinmux(0x4, 2, (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC1);
scu_pinmux(0x2, 7, (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC1);
scu_pinmux(0x2, 10, (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC1);
// flash led 3 times
LPC_SCT->CTRL_U |= 1<<2;
for (d=0; d<1000000; d++);
LPC_SCT->OUTPUT = 0x7;
for (d=0; d<1000000; d++);
LPC_SCT->OUTPUT = 0x0;
LPC_SCT->CTRL_U |= 1<<2;
for (d=0; d<1000000; d++);
LPC_SCT->OUTPUT = 0x7;
for (d=0; d<1000000; d++);
LPC_SCT->OUTPUT = 0x0;
LPC_SCT->CTRL_U |= 1<<2;
for (d=0; d<1000000; d++);
LPC_SCT->OUTPUT = 0x7;
for (d=0; d<1000000; d++);
LPC_SCT->OUTPUT = 0x0;
handleReset();
while(1);
}