• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

CMakeLists.txtD18-Mar-2025437 1712

README.mdD18-Mar-20251.6 KiB6347

main.cD18-Mar-20258.3 KiB20893

prj.confD18-Mar-202542 32

sample.yamlD18-Mar-20251.2 KiB4443

README.md

1# TIMER counter {#timer_counter}
2
3The sample demonstrates a basic functionality of the nrfx_timer driver in Timer and Counter modes.
4
5## Requirements
6
7The sample supports the following development kits:
8
9| **Board**           | **Support** |
10|---------------------|:-----------:|
11| nrf52dk_nrf52832    |     Yes     |
12| nrf52833dk_nrf52833 |     Yes     |
13| nrf52840dk_nrf52840 |     Yes     |
14| nrf5340dk_nrf5340   |     Yes     |
15| nrf9160dk_nrf9160   |     Yes     |
16
17## Overview
18
19Application initializes the nrfx_timer driver.
20The @p timer_handler() is executed in the following situations:
21* Regularly after a specified time (@p TIME_TO_WAIT_MS).
22* When the counter value is equal to @p COUNTER_MAX_VAL.
23
24> For more information, see **TIMER driver - nrfx documentation**.
25
26## Wiring
27
28To run this sample, no special configuration is needed.
29You should monitor the output from the board to check if it is as expected.
30
31## Building and running
32
33To run this sample, build it for the appropriate board and then flash it as per instructions in [Building and running](@ref building_and_running) section.
34
35## Sample output
36
37You should see the following output:
38
39```
40- "Starting nrfx_timer basic counter example."
41- "Time between timer ticks: 1000 ms"
42- "Timer status: enabled"
43- "Counter status: enabled"
44- "Timer: 1"
45- "Timer: 2"
46- "Timer: 3"
47- "Counter: 1 / 3"
48- "Timer: 1"
49- "Timer: 2"
50- "Timer: 3"
51- "Counter: 2 / 3"
52- "Timer: 1"
53- "Timer: 2"
54- "Timer: 3"
55- "Counter finished"
56- "Counter: 3 / 3"
57- "Timer status: disabled"
58- "Counter status: disabled"
59```
60
61[//]: #
62[Building and running]: <../../../README.md#building-and-running>
63