# dynamic frequency change

**URL:** <https://forums.freertos.org/t/dynamic-frequency-change/5538>\
**Category:** Kernel\
**Created:** [November 27, 2009, 12:24am UTC](https://forums.freertos.org/t/dynamic-frequency-change/5538 "2009-11-27T00:24:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 27, 2009, 12:24am UTC](https://forums.freertos.org/t/dynamic-frequency-change/5538/1 "2009-11-27T00:24:10Z")

</div>

**[allanon74](https://sourceforge.net/u/allanon74/)** wrote on [Friday, November 27, 2009](https://sourceforge.net/p/freertos/discussion/382005/thread/f5f0e22b/#c8cd):

Hi all,  
in a cortexM3 (stm32) project i am using FreeRTOS and i need to change dynamically core frequency (min being 8Mhz and max 72Mhz, default 16Mhz).

in an old post Richard Barry suggested the following:  
\*In Source\portable\MPLAB\PIC32MX\port.c you will see the function vPortIncrementTick(). This calls vTaskIncrementTick() just once. If you have the frequency, change this so vTaskIncrementTick is called twice. If you quarter the frequency, change this so it is called 4 times. Etc.\*

i was wondering if i can instead change the systick interrupt config when i change core freq.

Thanks  
Beppe

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [November 27, 2009, 10:09am UTC](https://forums.freertos.org/t/dynamic-frequency-change/5538/2 "2009-11-27T10:09:06Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Friday, November 27, 2009](https://sourceforge.net/p/freertos/discussion/382005/thread/f5f0e22b/#7ffd):

Not sure exactly what you are asking - but you have to ensure that time moves at the same speed for the kernel.&nbsp; If you slow down the core speed by 2, then assuming this causes the tick interrupt occurs at half the frequency, you will have to call vTaskIncrementTick() twice in each tick interrupt.

Regards.

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [November 27, 2009, 2:51pm UTC](https://forums.freertos.org/t/dynamic-frequency-change/5538/3 "2009-11-27T14:51:26Z")

</div>

**[richard\_damon](https://sourceforge.net/u/richard_damon/)** wrote on [Friday, November 27, 2009](https://sourceforge.net/p/freertos/discussion/382005/thread/f5f0e22b/#d35a):

Richard, I believe that he is asking if you cut the clock speed in half, and also cut the clock cycles per tic interrupt in half (so the tics still happen at the same rate) with that work, and I think it should. It will increase the overhead by the tic interrupt, but that is sort of to be expected.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [November 27, 2009, 6:46pm UTC](https://forums.freertos.org/t/dynamic-frequency-change/5538/4 "2009-11-27T18:46:21Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Friday, November 27, 2009](https://sourceforge.net/p/freertos/discussion/382005/thread/f5f0e22b/#46e4):

Richard\_damon, I agree with you.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 28, 2009, 7:01am UTC](https://forums.freertos.org/t/dynamic-frequency-change/5538/5 "2009-11-28T07:01:27Z")

</div>

**[allanon74](https://sourceforge.net/u/allanon74/)** wrote on [Saturday, November 28, 2009](https://sourceforge.net/p/freertos/discussion/382005/thread/f5f0e22b/#222b):

exactly what was i looking for 🙂  
Thanks!
