3 ; author: hackbard@hackdaworld.dyndns.org
9 ; vcc card --- atmel vcc
11 ; rst cam --- atmel int0 (pd2)
12 ; rst card --- atmel (pb4)
16 ; gnd card --- gnd cam --- atmel gnd
17 ; i/o card --- atmel icp (pd6)
18 ; i/o cam --- atmel int1 (pd3)
20 .include "../include/2313def.inc"
24 ; stupid mode only by now. just see what cam/card do and redirect
27 ; next implementation:
29 ; try to read one byte of card/cam communication and output via uart.
30 ; output time information in some way.
34 ; buffer/parse whole strings and decide whether to send to card or not.
49 ; timer/counter capt 1
52 ; timer/counter compare
55 ; timer/counter overflow 1
58 ; timer/counter overflow 0
64 ; uart data register empty
90 ; enable interrupts int0,int1
91 ldi r16,((1<<INT0)|(1<<INT1))
94 ldi r16,((1<<ISC01)|(1<<ISC00)|(1<<ISC10)|(1<<ISC11))
104 ; enable t/c overflow interrupt
108 ldi r16,((1<<CS12)|(1<<CS11)|(1<<CS10))
111 ; init bitcounter and overflow counter
112 ldi r20,0 ; bitcounter
113 ldi r21,0 ; register for constructing the byte
114 ldi r22,0 ; overflow counter
120 ; enable interrupts (global)
129 ; int0 -> input, int1 -> output
140 ; output high on port to cam
153 ; output low on port to cam
170 ; int1 -> input, int0 -> output
181 ; output high on port to card
194 ; output low on port to card
206 ; t1_overflow routine
211 add r22,r1 ; inc counter overflow register