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
= 0 ; ir LED pin
35 rjmp init
; Reset handler
36 rjmp INT0_hand
; INT0 handler
37 reti
; Pin change handler
38 rjmp TIM0_OVF
; Timer overflow handler
39 reti
; EEPROM Ready handler
40 reti
; Analog Comparator handler
41 reti
; Timer/Counter Compare Match A handler
42 reti
; Timer/Counter Compare Match B handler
43 reti
; Watchdog Time-out handler
44 reti
; ADC Conversion Complete handler
47 ;camera include file goes here
48 .
include "cameras/Nikon_OML-L3.inc"
53 ; enable sleep mode and INT0 on falling edge
54 ldi mode
, (1 << SE
) |
(1 << ISC01
)
61 ; set timer prescaler 1024
62 ; ldi mode, (1 << CS02) | (1 << CS00)
69 ; enable INT0 interrupt
74 sbi PORTB
,buttonPin
; set b4 config. to enable internal pull-up.
81 sbi irPort
,irPin
; LED off
116 mov tcounter2
, Idelay2
133 out GIFR
,mode
; clear interrupt flags
182 ; set timer prescaler 1024, turn on timer
183 ldi mode
, (1 << CS02
) |
(1 << CS00
)
186 ; enable timer overflow
187 ldi mode
, (1 << TOIE0
)
190 ldi mode
,1 ; set timing mode
195 ldi mode
,2 ; set running mode
201 out TCCR0B
, mode
; turn off timer0