MCU slow in operations

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

MCU slow in operations

485 Views
Nadia
Contributor III

Hello everyone, I have a small problem, the system clock is set to 172.9 MHz, and so far so good, I have created a task and when it comes to put simple operations, the clock slows down a lot. I have to do a lot of counting and this means that the task takes about 5 kHz, that's a long time.

I don't know if this has happened to anyone and if you have a solution.
Thank you very much.
Best regards.

0 Kudos
2 Replies

466 Views
frank_m
Senior Contributor III

I agree, the description is not very helpful.

> ...the system clock is set to 172.9 MHz ...

This is just a variable, and by no means proof of the actual core clock frequency. Setting up the external clock source might have failed, and thus the default clock is still active.

When I came across such instances, I configured the SysTick timer to a nice round ratio, and toggled a GPIO pin in the hander routine. The measured frequency must correspond to the configured core clock.

The SysTick timer/code is CMSIS functionality.

 

/* one interrupt every millisecond */
if (SysTick_Config(SystemCoreClock / 1000) != 0)
{
    // whatever error handling
}

 

 

0 Kudos

476 Views
carstengroen
Senior Contributor II

Someone might have a solution, but that would require them to know what you are talking about...

It does not make much sense what you write, is the "system clock of 172.9 MHz" slowing down when you do "simple operations" ? Does not make any sense at all. And "the task takes about 5 KHz, thats a long time" ? Something does "not take 5 KHz", it might take 200 uSec ? But if that is fast or slow depends on what exactly "the task" is doing. If it is adding 2+2, yes, then its a long time. If it calculates the cure for cancer, then it is very fast.....

You need to give much, much more info about your problem, what CPU, what you are trying to do etc.....

 

0 Kudos