Other Parts Discussed in Thread: TM4C123GH6PM
Hello,
I need to optimize the speed for CCS for stellaris LM4F120H5QR. I set the CPU clock to 80 MHz but I get only 2.10MHz throughput for the following code but then I use keil compiler for the same code I get more throughput. Is there anyway to increase the speed of operation?
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
int main(void)
{
SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
while(1)
{
// Turn on the LED
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 4);
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 0);
}
}