Skip to content

Noob. Timers -- systimer vs timg0? #1757

Answered by bjoernQ
n8henrie asked this question in Q&A
Discussion options

You must be logged in to vote

Nothing much to add to Jesse's explanation.

TIMG0 is used in the examples especially because it's available on all targets.

Every target contains TIMG0 with at least one timer/counter. Most chips have TIMG1 (not ESP32-C2). Many chips (ESP32, S2, S3) have two counters for the TIMGs.

All chips except ESP32 contain SYSTIMER with three counters/alarms. Other than TIMG, SYSTIMER counts at a fixed frequency (80MHz on S2, 16MHz on others).

If you only use one executor you would only need one timer/counter and even if you are using more you can opt-in to using ""embassy-time/generic-queue-X".

If all this sounds a bit confusing .... no worries just use TIMG until you run into issues 😄

The timers b…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@n8henrie
Comment options

@n8henrie
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by n8henrie
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants