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:
e108908
)
work on season_junior.asm
author
hackbard
<hackbard>
Wed, 10 Dec 2003 03:12:23 +0000
(
03:12
+0000)
committer
hackbard
<hackbard>
Wed, 10 Dec 2003 03:12:23 +0000
(
03:12
+0000)
beginners/season_junior.asm
patch
|
blob
|
history
diff --git
a/beginners/season_junior.asm
b/beginners/season_junior.asm
index
b955152
..
94ba21c
100644
(file)
--- a/
beginners/season_junior.asm
+++ b/
beginners/season_junior.asm
@@
-3,44
+3,55
@@
; author: hackbard@hackdaworld.dyndns.org
;
; author: hackbard@hackdaworld.dyndns.org
;
+
+; at90s2313
+; setup:
+; vcc card --- vcc cam
+; rst card --- rst cam --- atmel t0 (pd4)
+; clk card --- clk cam --- atmel t1 (pd5)
+; gnd card --- gnd cam --- atmel gnd
+; i/o card --- atmel int0 (pd2)
+; i/o cam --- atmel int1 (pd3)
+
include "../include/2313def.inc"
include "../include/2313def.inc"
+
;
; interrupt vectors:
;
; reset
;
; interrupt vectors:
;
; reset
-rjmp INIT
; init routine
+rjmp INIT
-; int
0
-rjmp REC_
FROM_CARD ; smartcard sends data, we listen
+; int0
+rjmp REC_
CARD
-; int
1
-rjmp REC_
FROM_CAM ; cam sends data, we listen
+; int1
+rjmp REC_
CAM
; timer/counter capt 1
; timer/counter capt 1
-reti
; we just count the smartcard clocks
+reti
; timer/counter compare
; timer/counter compare
-reti
; not in use
+reti
; timer/counter overflow 1
; timer/counter overflow 1
-r
eti ; not in use
+r
jmp T1_OVERFLOW
; timer/counter overflow 0
; timer/counter overflow 0
-reti
; not in use
+reti
; uart rx complete
; uart rx complete
-reti
; maybe we need it later
+reti
; uart data register empty
; uart data register empty
-reti
; maybe we need it later
+reti
; uart tx complete
; uart tx complete
-reti
; maybe we need it later
+reti
; analog comparator
; analog comparator
-reti
; not in use
+reti
;
; init routine
;
; init routine
@@
-52,8
+63,31
@@
INIT:
ldi r16,low(RAMEND)
out SPL,r16
ldi r16,low(RAMEND)
out SPL,r16
+; enable interrupts int0,int1
+ldi r16,((1<<INT0)|(1<<INT1))
+out GIMSK,r16
+; int0/1 setup
+ldi r16,((1<<ISC01)|(1<<ISC00)|(1<<ISC11)|(1<<ISC10))
+out MCUCR,r16
+sbis PORTD,PORTD2
+cbi MCUCR,ISC00
+sbis PORTD,PORTD3
+cbi MCUCR,ISC10
+
+; enable t/c overflow interrupt
+sbi TIMSK,TOIE1
+; setup t/c
+ldi r16,((1<<CS12)|(1<<CS11)|(1<<CS10))
+out TCCR1B,r16
+
; enable interrupts (global)
; enable interrupts (global)
-ldi r16,(1<<7)
-out SREG,r16
+sei
+
+;
+; rec_card routine
+;
+REC_CARD:
+; get port status
+in .... continue here .. :)