diff options
-rw-r--r-- | .gitignore | 35 | ||||
-rw-r--r-- | Software/pinlock.asm | 29 | ||||
-rw-r--r-- | Software/pinlock.cof | 0 | ||||
-rw-r--r-- | Software/pinlock.eep.hex | 1 | ||||
-rw-r--r-- | Software/pinlock.hex | 14 | ||||
-rw-r--r-- | Software/pinlock.obj | bin | 914 -> 0 bytes |
6 files changed, 59 insertions, 20 deletions
@@ -1,6 +1,35 @@ -# Created by https://www.toptal.com/developers/gitignore/api/kicad,linux,windows,macos,vim -# Edit at https://www.toptal.com/developers/gitignore?templates=kicad,linux,windows,macos,vim +# Created by https://www.toptal.com/developers/gitignore/api/vim,kicad,linux,macos,windows,assembler,atmelstudio +# Edit at https://www.toptal.com/developers/gitignore?templates=vim,kicad,linux,macos,windows,assembler,atmelstudio + +### Assembler ### +*.exe +*.o +*.obj +*.bc + +### AtmelStudio ### +## Ignore Atmel Studio temporary files and build results +# https://www.microchip.com/mplab/avr-support/atmel-studio-7 + +# Atmel Studio is powered by an older version of Visual Studio, +# so most of the project and solution files are the same as VS files, +# only prefixed by an `at`. + +#Build Directories +[Dd]ebug/ +[Rr]elease/ + +#Build Results +*.d +*.eep +*.elf +*.hex +*.map +*.srec + +#User Specific Files +*.atsuo ### KiCad ### # For PCBs designed using KiCad: http://www.kicad-pcb.org/ @@ -127,6 +156,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk -# End of https://www.toptal.com/developers/gitignore/api/kicad,linux,windows,macos,vim +# End of https://www.toptal.com/developers/gitignore/api/vim,kicad,linux,macos,windows,assembler,atmelstudio /Hardware/fabrication/ diff --git a/Software/pinlock.asm b/Software/pinlock.asm index ee80741..ba12dc9 100644 --- a/Software/pinlock.asm +++ b/Software/pinlock.asm @@ -5,6 +5,8 @@ .def cnt = r19 .def tmp1 = r20 .def tmp2 = r21 +.def ret0 = r22 +.def ret1 = r23 init: ldi tmp0, HIGH(RAMEND) @@ -18,7 +20,7 @@ init: out DDRA, tmp0 ldi tmp0, 0b11111111 out DDRB, tmp0 - ldi tmp0, 0b11000000 + ldi tmp0, 0b11101100 out DDRD, tmp0 ldi tmp0, 0b00000000 out PORTD, tmp0 @@ -39,6 +41,7 @@ init: main: ldi par0, 0b11111111 rcall status + rjmp [tmp0] wait: mov tmp0, par0 @@ -52,7 +55,10 @@ wait: ret ; Output the status +; Parameters: ; par0 = Status bits +; Returns: +; None status: ldi tmp0, 1 status_loop: @@ -77,9 +83,12 @@ status_end: brne status_loop ret -; Display the digit on a given display +; Display the digit on a given display. +; Parameters: ; par0 = Display number ; par1 = Digit +; Returns: +; None display: mov tmp0, par1 andi tmp0, 0x0F @@ -124,3 +133,19 @@ display_3: or tmp1, tmp0 out PORTB, tmp1 ret + +; Read the input buttons. +; Parameters: +; None +; Returns: +; ret0 = 123A456B +; ret1 = 789C*0#D +input: + ; Write selection rows + ldi tmp0, 1 + ldi tmp1, 1 +input_loop: + mov tmp2, tmp0 + and tmp2, tmp1 + cp tmp1, tmp2 + breq input_set diff --git a/Software/pinlock.cof b/Software/pinlock.cof deleted file mode 100644 index e69de29..0000000 --- a/Software/pinlock.cof +++ /dev/null diff --git a/Software/pinlock.eep.hex b/Software/pinlock.eep.hex deleted file mode 100644 index 1996e8f..0000000 --- a/Software/pinlock.eep.hex +++ /dev/null @@ -1 +0,0 @@ -:00000001FF
diff --git a/Software/pinlock.hex b/Software/pinlock.hex deleted file mode 100644 index 222b940..0000000 --- a/Software/pinlock.hex +++ /dev/null @@ -1,14 +0,0 @@ -:020000020000FC
-:1000000004E00EBF0FE51FEF2FEF17D00DBF0FEF6E
-:100010000ABB0FEF07BB00EC01BB00E002BB10E026
-:1000200020E027D011E021E024D012E022E021D00E
-:1000300013E023E01ED01FEF09D0012F1A95000016
-:10004000E1F7102F2A950000C1F7089501E0412F34
-:100050004023041729F04FE342BB4FEB42BB05C0DE
-:100060004FE742BB4FEF42BB00C0000F003079F7B3
-:100070000895022F0F70103039F0113051F0123006
-:1000800069F01330A1F008954BB3407F402B4BBB78
-:10009000089548B3407F402B48BB08954BB34F7041
-:1000A000000F000F000F000F402B4BBB089548B30B
-:1000B0004F70000F000F000F000F402B48BB08953A
-:00000001FF
diff --git a/Software/pinlock.obj b/Software/pinlock.obj Binary files differdeleted file mode 100644 index 7c4452f..0000000 --- a/Software/pinlock.obj +++ /dev/null |