The fastest speed of GPIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The fastest speed of GPIO

1,146 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lgeorge123 on Sat Feb 09 02:42:46 MST 2013
  I modified the code from Gpio_LedBlinky try to get max speed rate , CGU_BASE_PERIPH is set to 204MHz , only 6.5MHz is obtained , what's wrong with my code ?

Original Attachment has been moved to: Fast_Gpio_LedBlinky.rar

Labels (1)
5 Replies

924 Views
lpcware
NXP Employee
NXP Employee
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;
}

924 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lgeorge123 on Sun Feb 10 08:16:56 MST 2013
If bit banding can be used as set output value , can it also be used as input value as variables ???
0 Kudos

924 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Sat Feb 09 06:03:00 MST 2013
Bit banding is a special machine in the cortex Mx cores... a read-modify-write machine for single bits.

Read the data sheet!
The peripherial alias region is 0x42000000-0x44000000.

Bit banding is explained at:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0439b/Behcjiic.html
0 Kudos

924 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lgeorge123 on Sat Feb 09 04:21:05 MST 2013
Sorry , I am new to lpc4357 can you explain to me more ??
0 Kudos

924 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Sat Feb 09 04:08:39 MST 2013
Don't use the library for GPIO calls.

Use bit banding!
0 Kudos