The fastest speed of GPIO

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

The fastest speed of GPIO

1,635 次查看
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

标签 (1)
5 回复数

1,413 次查看
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;
}

1,413 次查看
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 项奖励
回复

1,413 次查看
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 项奖励
回复

1,413 次查看
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 项奖励
回复

1,413 次查看
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 项奖励
回复