Content originally posted in LPCWare by nxp21346 on Mon Feb 11 15:48:27 MST 2013
The LPC4357 can toggle I/O lines in software at rates up to 102 MHz.
I used the following code running from SRAM to toggle PD_10 on the Keil MCB4300 board with the LPC4357 running at 204 MHz. Scope trace attached.
volatile uint32_t *gpset,*gpclr;
uint32_t gpmask;
scu_pinmux(0xD, 10, MD_EHS, FUNC4);
LPC_GPIO_PORT->DIR[6] |= 1<<24;
gpset = &LPC_GPIO_PORT->SET[6];
gpclr = &LPC_GPIO_PORT->CLR[6];
gpmask = 1<<24;
while (1)
{
*gpset = gpmask;
*gpclr = gpmask;
*gpset = gpmask;
*gpclr = gpmask;
*gpset = gpmask;
*gpclr = gpmask;
*gpset = gpmask;
*gpclr = gpmask;
*gpset = gpmask;
*gpclr = gpmask;
*gpset = gpmask;
*gpclr = gpmask;
*gpset = gpmask;
*gpclr = gpmask;
*gpset = gpmask;
*gpclr = gpmask;
}