lpcware

GPIO too slow with CMSIS compiled with CodeRed

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by yoko on Tue Mar 15 19:16:24 MST 2011
Hi,

   I have been doing a test with GPIO.  Test is very simple.  Just an endless while loop toggling an I/O pin. Like bellow

while(1) {
     LPC_GPIO1->FIOSET = (1 << 31);
     LPC_GPIO1->FIOCLR = (1 << 31);
};


This code compile using mBed online compiler, I can achieve ~24MHz.  Meseaured with a scope on the pin.  Same code compiled with CodeRed CMSIS, with modified clock setting for 120MHz CPU.  I get only <11MHz.  With default CodeRed CMSIS settings, I only get about 2MHz.  The tests ran on same board of course.

Can any one explain why and how performance can be improved ?  There must be some kind of settings that are missing.

Outcomes