Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
1babb6d0
Commit
1babb6d0
authored
10 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
docs: Update timer tutorial to reflect new behaviour of timer.
parent
5d323def
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/tutorial/timer.rst
+6
-4
6 additions, 4 deletions
docs/tutorial/timer.rst
with
6 additions
and
4 deletions
docs/tutorial/timer.rst
+
6
−
4
View file @
1babb6d0
...
@@ -26,12 +26,14 @@ it's not yet initialised. So let's initialise it to trigger at 10 Hz
...
@@ -26,12 +26,14 @@ it's not yet initialised. So let's initialise it to trigger at 10 Hz
Now that it's initialised, we can see some information about the timer::
Now that it's initialised, we can see some information about the timer::
>>> tim
>>> tim
Timer(4, prescaler=
255
, period=
32811
, mode=
0
, div=
0
)
Timer(4, prescaler=
624
, period=
13439
, mode=
UP
, div=
1
)
The information means that this timer is set to run at the peripheral
The information means that this timer is set to run at the peripheral
clock speed divided by 255, and it will count up to 32811, at which point
clock speed divided by 624+1, and it will count from 0 up to 13439, at which
it triggers an interrupt, and then starts counting again from 0. These
point it triggers an interrupt, and then starts counting again from 0. These
numbers are set to make the timer trigger at 10 Hz.
numbers are set to make the timer trigger at 10 Hz: the source frequency
of the timer is 84MHz (found by running ``tim.source_freq()``) so we
get 84MHz / 625 / 13440 = 10Hz.
Timer counter
Timer counter
-------------
-------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment