I've been using ARM microcontrollers from NXP in commercial products with great success for the last 2 years.
In most of my projects I don't use the PLL to increase the oscillator frequency because I never found it was needed (never felt that clock frequency was an issue), and because the PLL slightly increases power consumption.
However I don't know how can I measure what clock frequency is enough to power my code. I'm stuck with this question in my head because as you may know the faster the clock you use, the more power you end up consuming. Since these days portable equipment with limited batteries are common this is an important topic.
The main question here is how can I know if the current clock frequency is enough for my code?
In this question I state "stopping or delays" because I assume that if my clock frequency isn't enough the first symptom that will happen is a slow response time from time consuming routines.
I use in almost my projects a state machine system that has an
OnIdle() function that is called when the system doesn't have any events to process, so it can put the MCU in a low power mode. I was thinking about measuring how much time the system stays in this function and record min and max watermarks of this measure to have real numbers about if the current system clock is or isn't enough.
Does anyone have suggestions for this?