# Counter frequency

**URL:** <https://community.solid-run.com/t/counter-frequency/699>\
**Category:** NXP LX2160\
**Created:** [August 10, 2023, 11:40am UTC](https://community.solid-run.com/t/counter-frequency/699 "2023-08-10T11:40:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![elahav](https://avatars.discourse-cdn.com/v4/letter/e/ecc23a/32.png) [@elahav](https://community.solid-run.com/u/elahav)\
**Post date:** [August 10, 2023, 11:40am UTC](https://community.solid-run.com/t/counter-frequency/699/1 "2023-08-10T11:40:15Z")

</div>

The counter frequency on the Honeycomb board is reported as 25MHz (25000050Hz to be exact).  
The LX2160A manual suggests that CNTFRQ can be programmed in secure mode, so is not something the OS can do. Is it possible to get a higher frequency counter?

Thanks,  
–Elad

---

<div class="post-metadata">

**Author:** ![jnettlet](https://dub1.discourse-cdn.com/flex005/user_avatar/community.solid-run.com/jnettlet/32/62_2.png) [@jnettlet](https://community.solid-run.com/u/jnettlet)\
**Post date:** [August 10, 2023, 12:21pm UTC](https://community.solid-run.com/t/counter-frequency/699/2 "2023-08-10T12:21:38Z")

</div>

The counter frequency for the Arm Generic Timer and Watchdog is programmable in secure mode, it needs to be programmed to match the clock that is driving it. In the LX2160a case it is 1/4 of Sysclk A or B both of which are 100MHz, which is why the timer is 25MHz. The frequency is programmable not so it can be increased or decreased, but so software can discover the value the system counter is running at.

---

<div class="post-metadata">

**Author:** ![elahav](https://avatars.discourse-cdn.com/v4/letter/e/ecc23a/32.png) [@elahav](https://community.solid-run.com/u/elahav)\
**Post date:** [August 10, 2023, 12:27pm UTC](https://community.solid-run.com/t/counter-frequency/699/3 "2023-08-10T12:27:29Z")

</div>

Thanks for the quick response.  
Is there another clock that can be read cheaply from EL0 or EL1 with a higher resolution? 25MHz is a bit coarse for some performance analysis.

–Elad

---

<div class="post-metadata">

**Author:** ![jnettlet](https://dub1.discourse-cdn.com/flex005/user_avatar/community.solid-run.com/jnettlet/32/62_2.png) [@jnettlet](https://community.solid-run.com/u/jnettlet)\
**Post date:** [August 10, 2023, 1:10pm UTC](https://community.solid-run.com/t/counter-frequency/699/4 "2023-08-10T13:10:25Z")

</div>

You want to use the PMU cycle counter that is the high resolution counter that runs at the CPU frequency speed. This is the counter that is used for profiling utilities like perf.

---

<div class="post-metadata">

**Author:** ![elahav](https://avatars.discourse-cdn.com/v4/letter/e/ecc23a/32.png) [@elahav](https://community.solid-run.com/u/elahav)\
**Post date:** [August 10, 2023, 1:11pm UTC](https://community.solid-run.com/t/counter-frequency/699/5 "2023-08-10T13:11:06Z")

</div>

D’oh, should have thought of that. Thanks.

–Elad
