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/tn13def.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
36 rjmp init
; Reset handler
37 rjmp INT0_hand
; INT0 handler
38 reti
; Pin change handler
39 rjmp TIM0_OVF
; Timer overflow handler
40 reti
; EEPROM Ready handler
41 reti
; Analog Comparator handler
42 reti
; Timer/Counter Compare Match A handler
43 reti
; Timer/Counter Compare Match B handler
44 reti
; Watchdog Time-out handler
45 reti
; ADC Conversion Complete handler
48 ;camera include file goes here
49 .
include "cameras/Nikon_OML-L3.inc"
54 ; enable sleep mode and INT0 on falling edge
55 ldi mode
, (1 << SE
) |
(1 << ISC01
)
66 ; set timer prescaler 1024
67 ldi mode
, (1 << CS02
) |
(1 << CS00
)
74 ; enable INT0 interrupt
79 sbi PORTB
,buttonPin
; set b4 config. to enable internal pull-up.
86 sbi irPort
,irPin
; LED off
121 mov tcounter2
, Idelay2
176 ; enable timer overflow
177 ldi tcounter
, (1 << TOIE0
)