the ultimate yak shave
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
avr
teensy3
tests
.gitignore
COPYING
Makefile
avr_emulation.h
board.c
board.h
layout.h
layout_common.h
layout_qwerty.h
orestes.c
orestes.fs
orestes.h
readme.org

readme.org

Orestes

I need to implement a Forth so I can write firmware for my keyboard so I can write actual code.

Teensy 3

This is currently in the middle of a port from the AVR Teensy 2 to the ARM Teensy 3, and it’s not exactly functional yet.

Caveats

This Forth dialect is a bit weird for two reasons: 0) it was originally designed to run on a chip that has 32kb of flash for storage of C programs but only 2.5kb of RAM for Forth programs and data combined. Because of this, it is less self-hosting than is traditional. 1) It’s also implemented by someone who has barely used Forth and doesn’t really know C.

We use malloc rather than managing our own heap. This gives us a bit more flexibility, but it also means things like allot can’t just assume a contiguous section of dictionary space, so it works more like a varying-width variable than traditional allot. There are probably other weird idiosyncrasies, but I’m not familiar enough with Forth to spot them.

Pinout

rows: 14, 15, 20, 21

cols: 0-8, 11, 12

open pins:

  • 9,10: PWM, serial
  • 13: LED
  • 16-19: analog, I2C, touch
  • 22, 23: analog, PWM, touch

debouncing notes

  • for each row
    • delay
    • read columns for the current row
    • check to see if this row has changed since the last read
      • if so, set debounce for this row to cols; reset debounce counter
    • if debounce counter
      • decrement debounce counter
      • if decremented to zero
        • set the current matrix row to the last read value