rtel wrote on Tuesday, January 31, 2012:
A few comments:
1) 125KHz is an extremely slow frequency at which to run a fully active system. 125KHz is, I imagine, ideal for use while in a power saving mode. If you system is fully active (performing is primary function, rather than doing background tasks while saving power) then using such a slow clock will make things like interrupt take a long time to execute - so you would be right to lower the tick frequency. Most applications would reduce the tick frequency as 1KHz is not optimal for most applications. Just keep in mind that you are running the system at a very small fraction of its maximum clock rate, so things will be much much slower to execute.
2) Have you told the FreeRTOS scheduler that the clock is so much slower? On the RX200 there are two settings, configCPU_CLOCK_HZ and configPERIPHERAL_CLOCK_HZ, these are both in FreeRTOSConfig.h and, by default, map to the ICLK_FREQUENCY and PCLK_FREQUENCY settings in rskrx210def.h. It is likely that the timer used to generate the tick interrupt is using the configPERIPHERAL_CLOCK_HZ setting (it is by default), so if that value is wrong then everything will be wrong.
3) The side effect of having a slower tick frequency is lower timing resolution. Ticks are used to measure time. If you use a slower tick frequency then you cannot measure time with the same accuracy. If that matters or not depends on your application.
I recommend that you check your system configuration by measuring to tick frequency to ensure it is as you expect it to be. This can be done by defining a tick hook function that toggles and output, and then measuring the toggle frequency on the output.