Determining the current APB_CLK frequency
Posted: Mon Apr 17, 2017 12:54 pm
Hi,
Timers are clocked by APB_CLK, and the technical reference manual says that APB_CLK is derived by the CPU_CLK source, and gives a table about the relation. What is the proper way of determining the APB_CLK frequency on the fly? It looks like, though I am not sure, the APB_CLK is ticking with 40 MHz after deep sleep when the deep sleep stub is running, but than it is changing to 80 MHz. I would like to determine this on the fly in order to get reliable timing counts in seconds from the timers.
Best.
Timers are clocked by APB_CLK, and the technical reference manual says that APB_CLK is derived by the CPU_CLK source, and gives a table about the relation. What is the proper way of determining the APB_CLK frequency on the fly? It looks like, though I am not sure, the APB_CLK is ticking with 40 MHz after deep sleep when the deep sleep stub is running, but than it is changing to 80 MHz. I would like to determine this on the fly in order to get reliable timing counts in seconds from the timers.
Best.