Skip to content

Frequency counter for Attiny3226 #991

Answered by hmeijdam
elektroboard asked this question in Q&A
Discussion options

You must be logged in to vote

Then just work from the raw "timer_capture" value and create your own logic from there.
The demo I made uses integers and divisions, so is rounding anything down to whole numbers. Especially the calculation of "period" is losing a factor 20 of resolution.

Look at the "Timer capture" value when you slightly change your frequency and you will see it changing with much higher resolution than the frequency number.

Replies: 4 comments 15 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
14 replies
@elektroboard
Comment options

@hmeijdam
Comment options

@elektroboard
Comment options

@hmeijdam
Comment options

Answer selected by elektroboard
@hmeijdam
Comment options

@elektroboard
Comment options

@hmeijdam
Comment options

@elektroboard
Comment options

Comment options

You must be logged in to vote
1 reply
@elektroboard
Comment options

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