From d00a92eb232b03cc5e19a33c407c0f0efd50b784 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 21 Sep 2018 22:00:43 +0200 Subject: ... --- forth/elegoo.fs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 forth/elegoo.fs (limited to 'forth/elegoo.fs') 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 +; -- cgit v1.2.3