aboutsummaryrefslogtreecommitdiff
path: root/forth/elegoo.fs
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-09-21 22:00:43 +0200
committerDimitri Sokolyuk <demon@dim13.org>2018-09-21 22:00:43 +0200
commitd00a92eb232b03cc5e19a33c407c0f0efd50b784 (patch)
tree6fc72e166e4912a054dc6ae2799c7e4795804c16 /forth/elegoo.fs
parent2f83a0bea9da444e3d70569eba3d6847ca02be03 (diff)
...
Diffstat (limited to 'forth/elegoo.fs')
-rw-r--r--forth/elegoo.fs23
1 files changed, 23 insertions, 0 deletions
diff --git a/forth/elegoo.fs b/forth/elegoo.fs
new file mode 100644
index 0000000..f6d5391
--- /dev/null
+++ b/forth/elegoo.fs
@@ -0,0 +1,23 @@
+-pwm
+marker -pwm
+
+$2a constant ddrd
+$44 constant tccr0a
+$45 constant tccr0b
+$47 constant ocr0a
+$48 constant ocr0b
+
+: timer0init
+ #01100000 ddrd mset \ output PD6 PD5
+ #10100011 tccr0a c! \ mode3: non-inverted pwm A and B
+ #00000101 tccr0b c! \ prescale/1024
+;
+
+: setA ocr0a c! ;
+: setB ocr0b c! ;
+
+: go
+ timer0init
+ $1f setA
+ $3f setB
+;