Created
September 21, 2018 15:11
-
-
Save redvers/7ae140ca5cc4ce60f433eed2b6b62cbd to your computer and use it in GitHub Desktop.
One Board
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CON | |
_clkmode = xtal1 + pll16x | |
_xinfreq = 6_250_000 | |
VAR | |
long r0 | |
PUB main | |
cognew(@entrypoint, @r0) | |
DAT | |
org 0 | |
entrypoint or DIRA, DISPLAYPINS | |
:outside test LOADMSK, INA WZ | |
IF_Z jmpret WIGGLERET, #:wiggle | |
test CLKMSK, INA WZ | |
IF_Z jmpret READBITRET, #:readbit | |
jmp #:outside | |
:readbit waitpeq CLKMSK, CLKMSK | |
test DATAMSK, INA WZ | |
IF_NZ add INBUFFR, #1 | |
shl INBUFFR, #1 | |
jmp READBITRET | |
:wiggle or OUTA, DEBUGMSK | |
waitpeq LOADMSK, LOADMSK | |
andn OUTA, DEBUGMSK | |
mov OUTA, INBUFFR | |
jmp WIGGLERET | |
WIGGLERET long 0 | |
READBITRET long 0 | |
DEBUGMSK long %00000000_00000000_00000000_00000001 'P0 | |
DATAMSK long %00001000_00000000_00000000_00000000 'P27 | |
CLKMSK long %00000100_00000000_00000000_00000000 'P26 | |
LOADMSK long %00000010_00000000_00000000_00000000 'P25 | |
INBUFFR long %00000000_00000000_00000000_00000000 | |
DISPLAYPINS long %00000001_11111111_11111111_11111111 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment