This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C123GH6PGE FREQUENCY PROBLEM

Hi , 

When I study to my project , I try to adjust my processor frequency 80 Mhz but it looks 5 Mhz . Some part of my project is below:

SysCtlClockSet (SYSCTL_XTAL_16MHZ | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_SYSDIV_2_5);

:

:

:

:

:

while(1)
{

GPIOPinWrite(SERIAL_DATA_OUT_BASE, GPIO_PIN_0, HIGH );

GPIOPinWrite(SERIAL_DATA_OUT_BASE, GPIO_PIN_0, LOW);

}

When I observe in oscilloscope , it looks like 5 Mhz.

Could someone helps me , please ?

  • Hello Ethern,

    The GPIO Pin toggle function requires code execution time and hence it works as if the clock is getting divided. On the other hand if you were to use a timer or PWM with divide by 100 set then you would see the exact frequency of the system with divide by 100 on the corresponding PWM/timer pin.

    Regards
    Amit
  • Yes Ok then how can I execute a command at 80 Mhz.
  • Hello Ethern,

    The commands are executing at 80MHz. For example in the following pseudo sequence

    mov r0, #0x5000
    ldr r0, [r0]
    bx r0

    each instruction is being executed at system clock speed. However a function is made up by multiple instructions and hence the execution of the function seems to be running slower.

    Regards
    Amit
  • One wonders why such emphasis is placed on raw execution speed - tens of thousands of products have been designed/built/sold - which executed at sub 80MHz rates.

    Note the contrast between poster's code (employing code simplification) and Amit's use of ARM Assembler. That simple code method can never hope to achieve full MCU speed.

    Poster's (apparent) quest for "full-speed code execution" and "fast/simple coding" may not be obtainable in the real world...

    As always - posters' fail to justify their "quest for performance" - which erodes interest & support...