3 ; Copyright 2007 Matthew F. Coates (mattjackets+openinterval at gmail.com)
5 ; This program is free software: you can redistribute it and/or modify
6 ; it under the terms of the GNU General Public License as published by
7 ; the Free Software Foundation, either version 3 of the License, or
8 ; (at your option) any later version.
10 ; This program is distributed in the hope that it will be useful,
11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ; GNU General Public License for more details.
15 ; You should have received a copy of the GNU General Public License
16 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
18 .
include "include/tn12def.inc"
19 .
EQU buttonPin
= 1 ; button
20 .
EQU syncPin
= 3 ; sync LED port
21 .
EQU irPort
= PORTB
; ir LED port
22 .
EQU irPin
= 4 ; ir LED pin
23 .
equ FREQ
= 0 ; start out with no interval
35 rjmp init
; Reset handler
36 rjmp INT0_hand
; INT0 handler
37 reti
; Pin change handler
38 rjmp TIM0_OVF
; Timer0 overflow handler
39 reti
; EEPROM Ready handler
40 reti
; Analog Comparator handler
42 ;camera include file goes here
43 .
include "cameras/Nikon_OML-L3.inc"
46 ; enable sleep mode and INT0 on falling edge
47 ldi temp
, (1 << SE
) |
(1 << ISC01
) & (0 << ISC00
)
58 ; set timer prescaler 1024
59 ldi temp
, (1 << CS02
) |
(1 << CS00
)
62 ; enable timer overflow
63 ldi temp
, (1 << TOIE0
)
66 ; enable INT0 interrupt
76 sbi PORTB
,buttonPin
; set b4 config. to enable internal pull-up.
82 sbi irPort
,irPin
; LED off
90 TIM0_OVF: ; -- handle timer0 overflow, trigger shutter
99 mov tcounter
, DelayReg
157 ldi mode
,1 ; timing mode
162 mov tcounter
,DelayReg
163 mov tcounter2
,DelayReg2
164 ldi mode
,2 ; running mode