Skip to content

Instantly share code, notes, and snippets.

@TGNThump
Created February 23, 2016 13:34
Show Gist options
  • Save TGNThump/ca9351d7b03c87828aca to your computer and use it in GitHub Desktop.
Save TGNThump/ca9351d7b03c87828aca to your computer and use it in GitHub Desktop.
movw %1010110
movwr trisc
symbol locked = b0
symbol digit = b1
symbol col1 = b2
symbol col2 = b3
symbol col3 = b4
table 0x00, (%00000001, %00000010, %00000011)
table 0x10, (%10000000, %11000000, %10100000)
do
inc digit
; READ MATRIX KEYPAD VALUES
movw 0x20
movwr portc
movrw portc
andw 0xDE
movwr col1
movw 0x80
movwr portc
movrw portc
andw %01111110
movwr col2
movw %00001000
movwr portc
movrw portc
andw %11110110
movwr col3
; DETECT RESET BUTTON
if col1 = 0x10 then
let digit = 0x00
movw 0x01
movwr portc
endif
; DEBUG
debug
loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment