1 ; Infrared remote control for Nikon D70 with Atmel 8bit MCU
3 ; Copyright (C) 2005, 2006 Michele Bighignoli - Laives (BZ) - ITALY # www.bigmike.it/ircontrol
5 ; Version 2.0.0-OI - 12/2007
6 ; Modified by Matt Coates (mattjackets+openinterval at gmail.com)
7 ; for use as an include file for the OpenInterval project
8 ; (http://repo.or.cz/w/OpenInterval.git)
10 ; This program is free software; you can redistribute it and/or modify
11 ; it under the terms of the GNU General Public License as published by
12 ; the Free Software Foundation; either version 2 of the License, or
13 ; (at your option) any later version.
15 ; This program is distributed in the hope that it will be useful,
16 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ; GNU General Public License for more details.
20 ; You should have received a copy of the GNU General Public License
21 ; along with this program; if not, write to the Free Software
22 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 ; Implementation note:
26 ; ---------------------------
27 ; IR led is controlled by PD0 (with NPN transistor).
28 ; Led is "on" when PD0 is high.
30 ; This code has tested with ATTiny2313 and ATMEGA8535 with 8.0 MHz Xtal
32 ; Should work with every Atmel 8bit MCU
37 ; Gerhard Schmidt (DG4FAC) - http://www.avr-asm-tutorial.net/index.html
38 ; Brian Hammill - http://www.ipass.net/~hammill
41 ; WaveForm data (03/2006 version):
43 ; Infrared period = 26us (~38.4kHz)
45 ; Strart pulse: 2000us
63 ; This is a 13.0 uS delay (104 cycles @ 8MHz)
84 ; Code executed at startup
87 ldi MainLoopC,2 ; Send a complete waveform 2 times
91 ; Send start pulse (2000 uS)
92 ldi Counter,77 ; (13 uS * 2 ) * 77 = 2002 uS
94 sbi irport,irpin ; LED on
95 rcall delay130_led_on ; Wait 13.0 uS
96 cbi irport,irpin ; LED off
97 rcall delay130_led_off ; wait 13.0 uS
116 rcall delay130_led_off
118 ; Send first pulse (390 uS)
121 sbi irport,irpin ; LED on
122 rcall delay130_led_on
123 cbi irport,irpin ; LED off
124 rcall delay130_led_off
141 ; Send 2nd pulse (410 uS)
143 ; NOTE: with Counter=16 the pulse width is 416 uS (counting the last "led off" time)
144 ; using Counter=15 and an additional "led on", it's possible to add the last 7 uS (led off) to the pause 2
146 ; Counter=15 = 390 uS +
153 sbi irport,irpin ; LED on
154 rcall delay130_led_on
155 cbi irport,irpin ; LED off
156 rcall delay130_led_off
160 sbi irport,irpin ; LED on
161 rcall delay130_led_on
162 cbi irport,irpin ; LED off
164 ; Pause (3580 uS + 7 uS from pulse2 = 3587 uS)
172 ; Send 3th pulse (400 uS) - (in real world = 403 uS)
175 sbi irport,irpin ; LED on
176 rcall delay130_led_on
177 cbi irport,irpin ; LED off
178 rcall delay130_led_off
182 sbi irport,irpin ; LED on
183 rcall delay130_led_on
184 cbi irport,irpin ; LED off
187 ; No long pause before sleep
188 breq returnfromshutterrelease
203 ; At moment : 63126 uS + 3 uS from pulse3 = 63129 uS
211 ; At moment 63193 uS + 3 uS from pulse3 = 63196 uS
213 ldi Counter,10 ; 3,75 uS
220 returnfromshutterrelease: