projects
/
my-code
/
atmel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b9abd3f
)
added led stuff
author
hackbard
<hackbard>
Sun, 25 Jan 2004 18:13:23 +0000
(18:13 +0000)
committer
hackbard
<hackbard>
Sun, 25 Jan 2004 18:13:23 +0000
(18:13 +0000)
beginners/season_junior.asm
patch
|
blob
|
history
diff --git
a/beginners/season_junior.asm
b/beginners/season_junior.asm
index
35d51d1
..
ec5d3c1
100644
(file)
--- a/
beginners/season_junior.asm
+++ b/
beginners/season_junior.asm
@@
-68,6
+68,12
@@
.equ GODLIKE_F = 4
.equ INCREDIBLE_HACK = (1<<4) ; destroy all your hardware
.equ INCREDIBLE_HACK_F = 5
.equ GODLIKE_F = 4
.equ INCREDIBLE_HACK = (1<<4) ; destroy all your hardware
.equ INCREDIBLE_HACK_F = 5
+; leds
+.equ LED_CARD = PB0
+.equ LED_CAM = PB1
+.equ LED_FWD_TO_CAM = PB2
+.equ LED_FWD_TO_CARD = PB3
+.equ LED_OVERFLOW = PB4
; but there is only stupid and cool mode right now %)
; but there is only stupid and cool mode right now %)
@@
-149,6
+155,11
@@
sbi UCR,TXEN
; enable pullups on int0, int1, clk, icp io ports
ldi tmp,((1<<PD2)|(1<<PD3)|(1<<PD5)|(1<<PD6))
; enable pullups on int0, int1, clk, icp io ports
ldi tmp,((1<<PD2)|(1<<PD3)|(1<<PD5)|(1<<PD6))
+; pb 0-4 output high
+ldi tmp,((1<<PB0)|(1<<PB1)|(1<<PB2)|(1<<PB3)|(1<<PB4))
+out DDRB,tmp
+out PORTB,tmp
+
; init registers
ldi bitcount,0
ldi byte,0
; init registers
ldi bitcount,0
ldi byte,0
@@
-192,6
+203,10
@@
REC_CARD:
cbi DDRD,DDD6
sbi PORTD,PD6
cbi DDRD,DDD6
sbi PORTD,PD6
+; activate led
+sbi PORTB,LED_CAM
+cbi PORTB,LED_CARD
+
; toggle state
eor state,state_m
; toggle state
eor state,state_m
@@
-254,6
+269,10
@@
ret
FWD_TO_CAM:
FWD_TO_CAM:
+; activate led
+sbi PORTB,LED_FWD_TO_CARD
+cbi PORTB,LED_FWD_TO_CAM
+
; disable external interrupt 1 while toggling edge
in tmp,GIMSK
cbr tmp,INT1
; disable external interrupt 1 while toggling edge
in tmp,GIMSK
cbr tmp,INT1
@@
-306,6
+325,10
@@
REC_CAM:
cbi DDRD,DDD3
sbi DDRD,PD3
cbi DDRD,DDD3
sbi DDRD,PD3
+; activate led
+sbi PORTB,LED_CARD
+cbi PORTB,LED_CAM
+
; toggle state
eor state,state_m
; toggle state
eor state,state_m
@@
-344,6
+367,10
@@
ret
FWD_TO_CARD:
FWD_TO_CARD:
+; activate led
+sbi PORTB,LED_FWD_TO_CAM
+cbi PORTB,LED_FWD_TO_CARD
+
; disable icp interrupt while toggling edge
in tmp,TIMSK
cbr tmp,TICIE
; disable icp interrupt while toggling edge
in tmp,TIMSK
cbr tmp,TICIE
@@
-375,6
+402,13
@@
T1_OVERFLOW:
; increment counter overflow
add overflow_counter,one
; increment counter overflow
add overflow_counter,one
+; toggle led status
+mov tmp,overflow_counter
+and tmp,one
+sbi PORTB,LED_OVERFLOW
+sbrs tmp,1
+cbi PORTB,LED_OVERFLOW
+
; return
reti
; return
reti