Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rp2040-ring-pio
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
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Quentin Bolsee
rp2040-ring-pio
Commits
a5153ef1
Commit
a5153ef1
authored
1 year ago
by
Quentin Bolsee
Browse files
Options
Downloads
Patches
Plain Diff
Update file ring.RP2040PIO_NO_SYNC.py
parent
439aa92c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
py/ring.RP2040PIO_NO_SYNC.py
+39
-0
39 additions, 0 deletions
py/ring.RP2040PIO_NO_SYNC.py
with
39 additions
and
0 deletions
py/ring.RP2040PIO_NO_SYNC.py
0 → 100644
+
39
−
0
View file @
a5153ef1
#
# ring.RP2040PIO_NO_SYNC.py
# RP2040 ring oscillator with PIO + bypass synchronizer
# connect P1 and P2
#
# Quentin Bolsee 2024-03-25
#
# This work may be reproduced, modified, distributed,
# performed, and displayed for any purpose, but must
# acknowledge this project. Copyright is retained and
# must be preserved. The work is provided as is; no
# warranty is provided, and users accept all liability.
#
from
machine
import
Pin
,
freq
,
mem32
import
rp2
@rp2.asm_pio
(
out_init
=
rp2
.
PIO
.
OUT_LOW
)
def
ring
():
mov
(
pins
,
invert
(
pins
))
# clock speed
# freq(133000000)
freq
(
250000000
)
# IO pins
pin_in
=
Pin
(
1
,
Pin
.
IN
)
pin_out
=
Pin
(
2
,
Pin
.
OUT
)
# bypass PIO input synchronizer on pin 1
PIO0
=
const
(
0x50200000
)
INPUT_SYNC_BYPASS
=
const
(
0x038
)
mem32
[
PIO0
+
INPUT_SYNC_BYPASS
]
|=
1
<<
1
# create and launch state machine
sm
=
rp2
.
StateMachine
(
0
,
ring
,
in_base
=
pin_in
,
out_base
=
pin_out
)
sm
.
active
(
1
)
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