-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
542 additions
and
43 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
const unsigned short rom[0x80]= | ||
{ | ||
0xC000, //00000000 | ||
0xE000, //00000001 | ||
0xBD04, //00000002 | ||
0xE005, //00000003 | ||
0xBD05, //00000004 | ||
0xE001, //00000005 | ||
0xB904, //00000006 | ||
0xE010, //00000007 | ||
0xE041, //00000008 | ||
0xEF20, //00000009 | ||
0xB516, //0000000A | ||
0x3010, //0000000B | ||
0xF7E9, //0000000C | ||
0xB516, //0000000D | ||
0x3010, //0000000E | ||
0xF3E9, //0000000F | ||
0x9523, //00000010 | ||
0x3020, //00000011 | ||
0xF7B9, //00000012 | ||
0x2704, //00000013 | ||
0xB905, //00000014 | ||
0xCFF3, //00000015 | ||
}; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.device ATmega168 | ||
.equ DDRB = 0x04 | ||
.equ PORTB = 0x05 | ||
|
||
.org 0x0000 | ||
rjmp RESET | ||
|
||
RESET: | ||
ldi R16,0x01 | ||
out DDRB,R16 | ||
|
||
ldi R18,0x00 | ||
ldi R17,0x00 | ||
ldi R20,0x01 | ||
Loop: | ||
|
||
ldi R19,0xE8 | ||
aloop: | ||
inc R17 | ||
cpi R17,0x00 | ||
brne aloop | ||
|
||
inc R18 | ||
cpi R18,0x00 | ||
brne aloop | ||
|
||
inc R19 | ||
cpi R19,0x00 | ||
brne aloop | ||
|
||
eor R16,R20 | ||
out PORTB, R16 | ||
rjmp Loop | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
.device ATmega168 | ||
|
||
.equ DDRB = 0x04 | ||
.equ PORTB = 0x05 | ||
.equ TCCR0A = 0x24 | ||
.equ TCCR0B = 0x25 | ||
.equ TCNT0 = 0x26 | ||
|
||
;.equ CLKPR = 0x61 | ||
|
||
.org 0x0000 | ||
rjmp RESET | ||
|
||
RESET: | ||
|
||
; ldi r16,0x80 | ||
; ldi r17,0x00 | ||
; sts CLKPR,r16 | ||
; sts CLKPR,r17 | ||
|
||
|
||
ldi R16,0x00 | ||
out TCCR0A,R16 | ||
ldi R16,0x05 | ||
out TCCR0B,R16 | ||
|
||
ldi R16,0x01 | ||
out DDRB,R16 | ||
|
||
ldi R17,0x00 | ||
ldi R20,0x01 | ||
Loop: | ||
|
||
|
||
ldi R18,0xF0 ;; change this to change the blink rate | ||
aloop: | ||
in R17,TCNT0 | ||
cpi R17,0x00 | ||
brne aloop | ||
|
||
bloop: | ||
in R17,TCNT0 | ||
cpi R17,0x00 | ||
breq bloop | ||
|
||
inc R18 | ||
cpi R18,0x00 | ||
brne aloop | ||
|
||
eor R16,R20 | ||
out PORTB, R16 | ||
rjmp Loop |
Oops, something went wrong.