Pfad: Home =>
AVR-Übersicht =>
IR-Steuerung =>
IR-Transmitter => Assembler Quellcode
Assembler-Quellcode für IR-Fernsteuersender ATtiny45
;
; **********************************************
; * IR-Fernsteuerung mit ATtiny45 *
; * Version 2 ohne Timer-Interrupts *
; * (C)2010 by http://www.avr-asm-tutorial.net *
; **********************************************
;
; Include-Datei fuer den AVR ATtiny45
.NOLIST
.INCLUDE "tn45def.inc" ; Headerdatei fuer ATTINY45
.LIST
;
; ============================================
; D E B U G - O P T I O N E N
; ============================================
;
; debug = 0: kein Debug
; debug = 1: schalte Taste 1 ein
.equ debug = 0
.if debug == 1
.equ debugkey = 10 ; 0..9: key, 10:key=star, 11:key=nmbr
.endif
;
; ============================================
; H A R D W A R E I N F O R M A T I O N E N
; ============================================
;
; Quarzoszillator 2,457600 MHz fuer Prozessortakt
; ADC1 fuer Tasteninput
; PB0 fuer IR-LED-Ansteuerung
; _________
; 1 / |8
; Reset o--| |--o Vcc
; | AT |
; Xtal1 o--| |--o ADC1
; | tiny |
; Xtal2 o--| |--o PB1 - Red LED
; | 45 |
; GND o--| |--o PB0 - IR-LED
; |__________|
;
;
;
; ============================================
; P O R T S U N D P I N S
; ============================================
;
.equ pLedO = PORTB ; IR-LED
.equ pbLedO = PORTB0
.equ pLedD = DDRB
.equ pbLedD = DDB0
.equ pRedD = DDRB ; rote LED
.equ pRedO = PORTB
.equ pbRedD = DDB1
.equ pbRedO = PORTB1
;
; =======================================================
; F E S T E + A B G E L E I T E T E K O N S T A N T E N
; =======================================================
;
.equ clock = 2457600 ; Taktfrequenz in Hz
.equ cLedFreq = 38400 ; Modulationsfrequenz der LED
.equ cPause = (10000*250000)/clock ; delay
;
; ============================================
; R E G I S T E R D E F I N I T I O N E N
; ============================================
;
; R0 frei
.def rHL = R1 ; Speicher fuer High-Dauer
.def rHH = R2
.def rLL = R3 ; Speicher fuer Low-Dauer
.def rLH = R4
.def rRpt = R5 ; Speicher fuer Repeat
; frei: R5..R15
.def rmp = R16 ; Vielzweckregister ausserhalb Ints
.def rimp = R17 ; Vielzweckregister innerhalb Ints
.def rAdc = R18 ; ADC Ergebnisregister
.def rLastKey = R19 ; letzte gedruckte Taste
.def rKeyCnt = R20 ; Zaehler fuer Tastendruck
.def rCS = R21 ; Kurzzaehler
; frei R22..R23
.def rCL = R24 ; 16-Bit-Zaehler, LSB
.def rCH = R25 ; dto., MSB
; X verwendet fuer High-Pulse
; Y verwendet fuer Low-Pulse
; Z
;
; ============================================
; S R A M D E F I N I T I O N E N
; ============================================
;
.DSEG
.ORG 0X0060
;
; ==============================================
; R E S E T U N D I N T V E K T O R E N
; ==============================================
;
.CSEG
.ORG $0000
rjmp Main ; Reset-Vektor
reti ; Int0 Vektor
reti ; PcInt0 Vektor
reti ; TC1CompA Int Vektor
reti ; TC1Ovf Int Vektor
reti ; TC0Ovf Int Vektor
reti ; EE RDY Int Vektor
reti ; ANA COMP Int Vektor
rjmp AdcInt ; ADC Int Vektor
reti ; TC1CompB Int Vektor
reti ; TC0CompA Int Vektor
reti ; TC0CompB Int Vektor
reti ; WDT Int Vektor
reti ; USIStart Int Vektor
reti ; USIOvrflw Int Vektor
;
; ==========================================
; I N T E R R U P T S E R V I C E
; ==========================================
;
AdcInt:
in rAdc,ADCH ; lese ADC-Ergebnis
sbi ADCSRA,ADSC ; start conversion
set ; set T flag
reti
;
; ============================================
; H A U P T P R O G R A M M I N I T
; ============================================
;
Main:
; Initiiere Stapel
ldi rmp,HIGH(RAMEND) ; Initiiere MSB Stapel
out SPH,rmp
ldi rmp, LOW(RAMEND) ; Initiiere LSB Stapel
out SPL,rmp
; Init Port B
sbi pLedD,pbLedD ; IR-LED Richtung Port B
sbi pRedD,pbRedD ; rote LED
rcall Wait
; Init ADC
.if debug == 1 ; simuliere Taste 1
ldi ZH,HIGH(2*DbgKeyCode+debugkey)
ldi ZL,LOW(2*DbgKeyCode+debugkey)
lpm rAdc,Z ; Taste in Adc-Result laden
set ; Flagge setzen
rjmp DebugLbl
DbgKeyCode: ; 0,1,2,3,4,5,6,7,8,9,Star,Nmbr
.db 84,62,161,235,45,137,221,32,110,206,18,185
.else
ldi rmp,(1<<ADLAR)|(1<<MUX0)
out ADMUX,rmp
ldi rmp,(1<<ADEN)|(1<<ADSC)|(1<<ADIE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)
out ADCSRA,rmp
ldi rmp,1<<SE ; Enable sleep
out MCUCR,rmp
sei
.endif
;
; ============================================
; P R O G R A M M - S C H L E I F E
; ============================================
;
Loop:
sleep ; Schlafen legen
nop ; Dummy fuer Aufwecken
sbi pRedO,pbRedO ; rote Lampe aus
brtc Loop ; kein ADC int
.if debug == 1
DebugLbl:
.else
clt
.endif
cpi rAdc,10 ; kein Key gedruckt?
brcc Loop1 ; gedrueckt
clr rLastKey ; gedrueckte Taste auf Null
clr rKeyCnt ; Zaehler auf Null
rjmp Loop
Loop1: ; Taste gedrueckt
rcall GetKey ; identifiziere Key
ldi rmp,(1<<ADEN)|(1<<ADSC)|(1<<ADIE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)
out ADCSRA,rmp
rjmp loop ; Zurueck nach Loop
;
; Identifiziere gedrueckte Taste
;
GetKey:
ldi ZH,HIGH(2*KeyTab) ; Tastentabelle
ldi ZL,LOW(2*KeyTab)
GetKeyNext:
lpm rmp,Z+ ; lese tabellenwert
cp rAdc,rmp ; vergleiche mit Tabellenwert
brcc GetKeyNext ; nachster Tabellenwert
sbci ZL,LOW(2*KeyTab)
sbci ZH,HIGH(2*KeyTab)
cp ZL,rLastKey
breq GetKeyEqual
mov rLastKey,ZL ; Taste speichern
clr rKeyCnt ; Zaehler auf Null
ret
GetKeyEqual:
inc rKeyCnt ; Zahler erhoehen
cpi rKeyCnt,10 ; 10 Tastenwerte gleich
breq GetKeyExe
ret
GetKeyExe:
cbi ADCSRA,ADIE
nop
nop
nop
WaitAdcRdy:
sbic ADCSRA,ADSC
rjmp WaitAdcRdy
lsl ZL
mov rmp,ZL
ldi ZH,HIGH(2*PTab)
ldi ZL,LOW(2*PTab)
add ZL,rmp
ldi rmp,0
adc ZH,rmp
lpm XL,Z+
lpm XH,Z+
mov ZH,XH
mov ZL,XL
lsl ZL
rol ZH
cbi pRedO,pbRedO ; Lampe An
Sequ: ; Sende Sequenz
lpm rmp,Z+ ; 3 (S=3), lese Byte 1
tst rmp ; 1 (S=4), = zero?
brne Sequ1 ; 1/2
Wait:
ldi rCH,HIGH(cPause)
ldi rCL,LOW(cPause)
SequWaitEnd:
sbiw rCL,1
brne SequWaitEnd
sbi pRedO,pbRedO
ret
Sequ1: ; (S=6)
mov XL,rmp ; 1
cbr XL,(1<<bHgh)|(1<<bDbl) ; 1, isoliere Wiederholung
mov rRpt,XL ; 1
sbrc rmp,7 ; 1/2, Einzelbyte?
rjmp Sequ2 ; 2, Zwei Byte
lpm rHL,Z+ ; 3, lese High byte
clr rHH ; 1
lpm rLL,Z+ ; 3, lese Low byte
clr rLH ; 1
nop ; 1
nop ; 1
nop ; 1
rjmp SequRptH ; 2 (S=24)
Sequ2: ; (S=12), Zwei Byte
lpm rHL,Z+ ; 3
lpm rHH,Z+ ; 3
lpm rLL,Z+ ; 3
lpm rLH,Z+ ; 3
SequRptH: ; (S=24), High-Sequenz
mov rCH,rHH ; 1
mov rCL,rHL ; 1
SequH: ; (S=26, off=30), sende high-sequenz
sbrs rmp,bHgh ; 1/2, LED nicht an?
rjmp SequHOff ; 2 (S=29)
; ------------------ switch on --------------------
sbi pLedO,pbLedO ; 2 (S=30, on=2), LED an
rjmp SequHLoop ; 2 (6, S=32, on=4)
SequHOff: ; (S=29)
nop ; 1 (S=30)
nop ; 1 (S=31)
nop ; 1 (S=32)
SequHLoop: ; (S=32, on=4)
; nT = 4+3*(cShortHH-1)+3 = 4+3*cShortHH-3+3 = 3*cShortHH+4
; cShortHH = (nT-4)/3 = (32-4)/3 = 9 MOD 1
.equ cShortHH = 9
ldi rCs,cShortHH ; 1 (S=33, on=5)
SequHS: ; (S=33, on=5)
dec rCs ; 1
brne SequHS ; 1/2
; nT = 3*9 + 4 = 31
nop ; 1 (S=64, on = 32)
; ------------------ switch off -------------------
cbi pLedO,pbLedO ; 2 (off=2)
sbiw rCL,1 ; 2 (S=24, off=4)
breq SequLE ; end of signal
; (off=5)
; nT = 3* (cShortLL-1) + 2 = 3*cShortLL-1
; cShortLL = (nT+1)/3 = ((30-2-6)+1)/3 = 7 MOD 2
.equ cShortLL = 7
ldi rCs,cShortLL ; 1 (off=6)
SequLS:
dec rCs ; 1
brne SequLS ; 1/2
; nt = 6*3+2 = 20, off = 26
nop ; 1 (off=27)
nop ; 1 (off=28)
rjmp SequH ; 1/2 1: 2:(S=26, off=30)
; ------------------- end switch off --------------
SequLE: ; (off=6), Uebergang vom Short Low zum Long Low
; cShortLE = (nT+1)/3 = (30-7+1)/3 = 8 MOD 0
.equ cShortLE = 8
ldi rCs,cShortLE ; 1 (Off=7)
SequLELoop:
dec rCs
brne SequLELoop
; nT = 7*3+2 = 23
; (Off=30)
; -------------------- begin long low -------------
; (off=30, sl1=0), signal sended, send long low
mov rCH,rLH ; 1 (off=31), kopiere Low-Dauer
mov rCL,rLL ; 1 (off=32)
SequLLDel: ; (sl1=0)
sbiw rCL,1 ; 2 (sl1=2), next long loop
breq SequLLEnd ; 1/2, end of long loop
; (sl1=3)
; cLongL = (nT+1)/3 = (64-2-3-1+1)/3 = 19 MOD 2
.equ cLongL = 19
ldi rCs,cLongL ; 1 (sl1=4)
SequLLLoop: ; Long Low Loop
dec rCs ; 1
brne SequLLLoop ; 1/2
; nT = 3*18+2 = 56
; (sl1=60)
nop ; 1 (sl1=61)
nop ; 1 (sl1=62)
rjmp SequLLDel ; 2 (S=, sl1=64)
; --------------------- end long low --------------
SequLLEnd: ; (sl1=4, end of long loop
dec rRpt ; 1 (sl1=5)
breq SequRpt ; 1/2 (sl1=6/7)
; (sl1=6)
; nT = 60-2-1-6 = 51
; cLLE = (51+1)/3 = 17 MOD 1
.equ cLLE = 17
ldi rCs,cLLE ; 1 (sl1=7)
SequLLEndLoop:
dec rCs
brne SequLLEndLoop
; nT = 3*16+2 = 50
; (sl1=57)
nop ; 1 (sl1=58)
rjmp SequRptH ; 2 (sl1=64-4=60), next high sequence
SequRpt: ; (sl1=9), next repeat
; nT = 36-9-2-1 = 24
; cSRpt = (nt+1)/3 = 25/3 = 8 MOD 1
.equ cSRpt = 8
ldi rCs,cSRpt ; 1 (sl1=10)
SequRptLoop:
dec rCs ; 1
brne SequRptLoop ; 2
; nT = 3*7+2 = 23
nop ; 1 (sl1=34)
rjmp Sequ ; 2 (sl1=64-28=36) ; next sequence
;
; keytable
KeyTab:
.db 26,38,53,71,96,124,149,173,196,215,226,243,255,255
;
; Ablauftabelle
;
PTab:
.dw pStar,p7,p4,p1,p0,p8,p5,p2,pNmbr,p9,p6,p3
;
; Tabelle mit Signalablaeufen
; Byte 1:
; 7: 0: Counter 1-Byte, < 6630 �s
; 1: Counter 2-byte, > 6630 �s
; 6: 0: Nur low cycles
; 1: High+Low cycles
; 5..0: Repeat counter, 0..63
; 0 = Ende
.equ bDbl = 7
.equ nDbl = 1<<bDbl
.equ bHgh = 6
.equ nHgh = 1<<bHgh
.equ cH = nHgh
.equ nDblHgh = nDbl+nHgh
.equ cHW = nDblHgh
.equ cW = nDbl
;
pStar:
.db 0,0 ; unused
pNmbr:
.db 0,0 ; unused
p0: ; switch TV/SAT/HDR/Beamer/Amplifier off
; Beamer and Amplifier off, phase I
.db 1+cHW,low(325),high(325),low(161),high(161),4+cH,21,21
.db 4+cH,21,60,1+cH,21,161,1+cH,21,21,1+cH,21,60
.db 4+cH,21,21,1+cH,21,60,1+cH,21,21,1+cHW,low(21),high(21),low(1085),high(1085)
.db 1+cHW,low(325),high(325),low(161),high(161),4+cH,21,21
.db 4+cH,21,60,1+cH,21,161,1+cH,21,21,1+cH,21,60
.db 4+cH,21,21,1+cH,21,60,1+cH,21,21,1+cHW,low(21),high(21),low(1085),high(1085)
.db 1+cHW,low(325),high(325),low(161),high(161),4+cH,21,21
.db 4+cH,21,60,1+cH,21,161,1+cH,21,21,1+cH,21,60
.db 4+cH,21,21,1+cH,21,60,1+cH,21,21,1+cHW,low(21),high(21),low(1085),high(1085)
.db 1+cHW,low(325),high(325),low(161),high(161),4+cH,21,21
.db 4+cH,21,60,1+cH,21,161,1+cH,21,21,1+cH,21,60
.db 4+cH,21,21,1+cH,21,60,1+cH,21,21,1+cHW,low(21),high(21),low(1085),high(1085)
; switch TV off
.db 2+cH,38,30,1+cH,69,30,5+cH,38,30,1+cH,38,69
.db 1+cH,38,30,1+cH,69,30,1+cHW,low(38),high(38),low(3473),high(3473),2+cH,38,30
.db 1+cH,69,30,5+cH,38,30,1+cH,38,69,1+cH,38,30
.db 1+cH,69,30,1+cHW,low(38),high(38),low(3473),high(3473)
.db 2+cH,38,30,1+cH,69,30,5+cH,38,30,1+cH,38,69
.db 1+cH,38,30,1+cH,69,30,1+cHW,low(38),high(38),low(3473),high(3473),2+cH,38,30
.db 1+cH,69,30,5+cH,38,30,1+cH,38,69,1+cH,38,30
.db 1+cH,69,30,1+cHW,low(38),high(38),low(3473),high(3473)
.db 2+cH,38,30,1+cH,69,30,5+cH,38,30,1+cH,38,69
.db 1+cH,38,30,1+cH,69,30,1+cHW,low(38),high(38),low(3473),high(3473),2+cH,38,30
.db 1+cH,69,30,5+cH,38,30,1+cH,38,69,1+cH,38,30
.db 1+cH,69,30,1+cHW,low(38),high(38),low(3473),high(3473)
; switch SAT off
.db 1+cHW,low(349),high(349),low(172),high(172),1+cH,22,64
.db 7+cH,22,22,1+cH,22,64,1+cH,22,22,6+cH,22,64
.db 2+cH,22,22,3+cH,22,64,1+cH,22,22,4+cH,22,64
.db 3+cH,22,22,1+cH,22,64,2+cH,22,22,1+cHW,low(22),high(22),low(1539),high(1539)
.db 1+cHW,low(349),high(349),low(86),high(86),1+cHW,low(22),high(22),low(3708),high(3708)
.db 1+cHW,low(349),high(349),low(86),high(86),1+cHW,low(22),high(22),low(3708),high(3708)
.db 1+cHW,low(349),high(349),low(86),high(86),1+cHW,low(22),high(22),low(3708),high(3708)
.db 10,255,255,10,255,255
; switch HDR off
.db 1+cH,172,172,5+cH,23,16,1+cH,23,55,10+cH,23,16
.db 1+cH,23,172,4+cH,23,16,1+cH,23,55,3+cH,23,16
.db 1+cH,23,55,2+cH,23,16,1+cH,23,55,1+cH,23,16
.db 3+cH,23,55,1+cH,23,16,2+cH,23,55,1+cH,23,16
.db 1+cHW,low(23),high(23),low(2287),high(2287),1+cH,172,172
.db 5+cH,23,16,1+cH,23,55,10+cH,23,16,1+cH,23,172
.db 4+cH,23,16,1+cH,23,55,3+cH,23,16,1+cH,23,55
.db 2+cH,23,16,1+cH,23,55,1+cH,23,16,3+cH,23,55
.db 1+cH,23,16,2+cH,23,55,1+cH,23,16,1+cHW,low(23),high(23),low(2287),high(2287)
.db 1+cH,172,172,5+cH,23,16,1+cH,23,55,10+cH,23,16
.db 1+cH,23,172,4+cH,23,16,1+cH,23,55,3+cH,23,16
.db 1+cH,23,55,2+cH,23,16,1+cH,23,55,1+cH,23,16
.db 3+cH,23,55,1+cH,23,16,2+cH,23,55,1+cH,23,16
.db 1+cHW,low(23),high(23),low(2287),high(2287),1+cH,172,172
.db 5+cH,23,16,1+cH,23,55,10+cH,23,16,1+cH,23,172
.db 4+cH,23,16,1+cH,23,55,3+cH,23,16,1+cH,23,55
.db 2+cH,23,16,1+cH,23,55,1+cH,23,16,3+cH,23,55
.db 1+cH,23,16,2+cH,23,55,1+cH,23,16,1+cHW,low(23),high(23),low(2287),high(2287)
.db 1+cH,172,172,5+cH,23,16,1+cH,23,55,10+cH,23,16
.db 1+cH,23,172,4+cH,23,16,1+cH,23,55,3+cH,23,16
.db 1+cH,23,55,2+cH,23,16,1+cH,23,55,1+cH,23,16
.db 3+cH,23,55,1+cH,23,16,2+cH,23,55,1+cH,23,16
.db 1+cHW,low(23),high(23),low(2287),high(2287),1+cH,172,172
.db 5+cH,23,16,1+cH,23,55,10+cH,23,16,1+cH,23,172
.db 4+cH,23,16,1+cH,23,55,3+cH,23,16,1+cH,23,55
.db 2+cH,23,16,1+cH,23,55,1+cH,23,16,3+cH,23,55
.db 1+cH,23,16,2+cH,23,55,1+cH,23,16,1+cHW,low(23),high(23),low(2287),high(2287)
.db 1+cH,172,172,5+cH,23,16,1+cH,23,55,10+cH,23,16
.db 1+cH,23,172,4+cH,23,16,1+cH,23,55,3+cH,23,16
.db 1+cH,23,55,2+cH,23,16,1+cH,23,55,1+cH,23,16
.db 3+cH,23,55,1+cH,23,16,2+cH,23,55,1+cH,23,16
.db 1+cHW,low(23),high(23),low(2287),high(2287),63,255,255
; Beamer off, phase II
.db 1+cHW,low(325),high(325),low(161),high(161),4+cH,21,21
.db 4+cH,21,60,1+cH,21,161,1+cH,21,21,1+cH,21,60
.db 4+cH,21,21,1+cH,21,60,1+cH,21,21,1+cHW,low(21),high(21),low(1085),high(1085)
.db 1+cHW,low(325),high(325),low(161),high(161),4+cH,21,21
.db 4+cH,21,60,1+cH,21,161,1+cH,21,21,1+cH,21,60
.db 4+cH,21,21,1+cH,21,60,1+cH,21,21,1+cHW,low(21),high(21),low(1085),high(1085)
.db 1+cHW,low(325),high(325),low(161),high(161),4+cH,21,21
.db 4+cH,21,60,1+cH,21,161,1+cH,21,21,1+cH,21,60
.db 4+cH,21,21,1+cH,21,60,1+cH,21,21,1+cHW,low(21),high(21),low(1085),high(1085)
.db 1+cHW,low(325),high(325),low(161),high(161),4+cH,21,21
.db 4+cH,21,60,1+cH,21,161,1+cH,21,21,1+cH,21,60
.db 4+cH,21,21,1+cH,21,60,1+cH,21,21,1+cHW,low(21),high(21),low(1085),high(1085)
; end of commands
.db 0,0
p1: ; switch TV/SAT/HDR on
; TV channel four
.db 1+cH,35,35,1+cH,68,35,7+cH,35,35,1+cH,35,68
.db 1+cH,68,35,1+cHW,low(35),high(35),low(3472),high(3472)
.db 1+cH,35,35,1+cH,68,35,7+cH,35,35,1+cH,35,68
.db 1+cH,68,35,1+cHW,low(35),high(35),low(3472),high(3472)
.db 1+cH,35,35,1+cH,68,35,7+cH,35,35,1+cH,35,68
.db 1+cH,68,35,1+cHW,low(35),high(35),low(3472),high(3472)
.db 1+cH,35,35,1+cH,68,35,7+cH,35,35,1+cH,35,68
.db 1+cH,68,35,1+cHW,low(35),high(35),low(3472),high(3472)
.db 1+cH,35,35,1+cH,68,35,7+cH,35,35,1+cH,35,68
.db 1+cH,68,35,1+cHW,low(35),high(35),low(3472),high(3472)
.db 1+cH,35,35,1+cH,68,35,7+cH,35,35,1+cH,35,68
.db 1+cH,68,35,1+cHW,low(35),high(35),low(3472),high(3472)
.db 10,255,255,10,255,255
; SAT on
.db 1+cHW,low(349),high(349),low(172),high(172),1+cH,22,64
.db 7+cH,22,22,1+cH,22,64,1+cH,22,22,6+cH,22,64
.db 2+cH,22,22,3+cH,22,64,1+cH,22,22,4+cH,22,64
.db 3+cH,22,22,1+cH,22,64,2+cH,22,22,1+cHW,low(22),high(22),low(1539),high(1539)
.db 1+cHW,low(349),high(349),low(86),high(86),1+cHW,low(22),high(22),low(3708),high(3708)
.db 1+cHW,low(349),high(349),low(86),high(86),1+cHW,low(22),high(22),low(3708),high(3708)
.db 10,255,255,10,255,255
; HDR on
.db 1+cH,172,172,5+cH,23,16,1+cH,23,55,10+cH,23,16
.db 1+cH,23,172,4+cH,23,16,1+cH,23,55,3+cH,23,16
.db 1+cH,23,55,2+cH,23,16,1+cH,23,55,1+cH,23,16
.db 3+cH,23,55,1+cH,23,16,2+cH,23,55,1+cH,23,16
.db 1+cHW,low(23),high(23),low(2287),high(2287),1+cH,172,172
.db 5+cH,23,16,1+cH,23,55,10+cH,23,16,1+cH,23,172
.db 4+cH,23,16,1+cH,23,55,3+cH,23,16,1+cH,23,55
.db 2+cH,23,16,1+cH,23,55,1+cH,23,16,3+cH,23,55
.db 1+cH,23,16,2+cH,23,55,1+cH,23,16,1+cHW,low(23),high(23),low(2287),high(2287)
.db 1+cH,172,172,5+cH,23,16,1+cH,23,55,10+cH,23,16
.db 1+cH,23,172,4+cH,23,16,1+cH,23,55,3+cH,23,16
.db 1+cH,23,55,2+cH,23,16,1+cH,23,55,1+cH,23,16
.db 3+cH,23,55,1+cH,23,16,2+cH,23,55,1+cH,23,16
.db 1+cHW,low(23),high(23),low(2287),high(2287),1+cH,172,172
.db 5+cH,23,16,1+cH,23,55,10+cH,23,16,1+cH,23,172
.db 4+cH,23,16,1+cH,23,55,3+cH,23,16,1+cH,23,55
.db 2+cH,23,16,1+cH,23,55,1+cH,23,16,3+cH,23,55
.db 1+cH,23,16,2+cH,23,55,1+cH,23,16,1+cHW,low(23),high(23),low(2287),high(2287)
.db 1+cH,172,172,5+cH,23,16,1+cH,23,55,10+cH,23,16
.db 1+cH,23,172,4+cH,23,16,1+cH,23,55,3+cH,23,16
.db 1+cH,23,55,2+cH,23,16,1+cH,23,55,1+cH,23,16
.db 3+cH,23,55,1+cH,23,16,2+cH,23,55,1+cH,23,16
.db 1+cHW,low(23),high(23),low(2287),high(2287),1+cH,172,172
.db 5+cH,23,16,1+cH,23,55,10+cH,23,16,1+cH,23,172
.db 4+cH,23,16,1+cH,23,55,3+cH,23,16,1+cH,23,55
.db 2+cH,23,16,1+cH,23,55,1+cH,23,16,3+cH,23,55
.db 1+cH,23,16,2+cH,23,55,1+cH,23,16,1+cHW,low(23),high(23),low(2287),high(2287)
.db 1+cH,172,172,5+cH,23,16,1+cH,23,55,10+cH,23,16
.db 1+cH,23,172,4+cH,23,16,1+cH,23,55,3+cH,23,16
.db 1+cH,23,55,2+cH,23,16,1+cH,23,55,1+cH,23,16
.db 3+cH,23,55,1+cH,23,16,2+cH,23,55,1+cH,23,16
.db 1+cHW,low(23),high(23),low(2287),high(2287),63,255,255
; TV av channel
.db 2+cH,35,30,1+cH,68,30,3+cH,35,30,1+cH,35,68
.db 2+cH,35,30,1+cH,68,30,1+cH,35,30,1+cHW,low(35),high(35),low(3472),high(3472)
.db 2+cH,35,30,1+cH,68,30,3+cH,35,30,1+cH,35,68
.db 2+cH,35,30,1+cH,102,9,1+cH,35,30,1+cHW,low(35),high(35),low(3472),high(3472)
.db 2+cH,35,30,1+cH,68,30,3+cH,35,30,1+cH,35,68
.db 2+cH,35,30,1+cH,68,30,1+cH,35,30,1+cHW,low(35),high(35),low(3472),high(3472)
.db 2+cH,35,30,1+cH,68,30,3+cH,35,30,1+cH,35,68
.db 2+cH,35,30,1+cH,68,30,1+cH,35,30,1+cHW,low(35),high(35),low(3472),high(3472)
.db 2+cH,35,30,1+cH,68,30,3+cH,35,30,1+cH,35,68
.db 2+cH,35,30,1+cH,68,30,1+cH,35,30,1+cHW,low(35),high(35),low(3472),high(3472)
.db 2+cH,35,30,1+cH,68,30,3+cH,35,30,1+cH,35,68
.db 2+cH,35,30,1+cH,68,30,1+cH,35,30,1+cHW,low(35),high(35),low(3472),high(3472)
.db 2+cH,35,30,1+cH,68,30,3+cH,35,30,1+cH,35,68
.db 2+cH,35,30,1+cH,68,30,1+cH,35,30,1+cHW,low(35),high(35),low(3472),high(3472)
.db 2+cH,35,30,1+cH,68,30,3+cH,35,30,1+cH,35,68
.db 2+cH,35,30,1+cH,68,30,1+cH,35,30,1+cHW,low(35),high(35),low(3472),high(3472)
; end of commands
.db 0,0
p2: ; switch SAT/HDR/Beamer/Amplifier on
; Beamer and Amplifier on
.db 1+cHW,low(325),high(325),low(161),high(161),4+cH,21,21
.db 4+cH,21,60,1+cH,21,161,1+cH,21,60,5+cH,21,21
.db 1+cH,21,60,1+cH,21,21,1+cHW,low(21),high(21),low(1085),high(1085),1+cHW,low(325),high(325),low(161),high(161)
.db 4+cH,21,21,4+cH,21,60,1+cH,21,161,1+cH,21,60
.db 5+cH,21,21,1+cH,21,60,1+cH,21,21,1+cHW,low(21),high(21),low(1085),high(1085)
.db 1+cHW,low(325),high(325),low(161),high(161),4+cH,21,21
.db 4+cH,21,60,1+cH,21,161,1+cH,21,60,1+cH,21,15
.db 4+cH,21,21,1+cH,21,60,1+cH,21,21,1+cHW,low(21),high(21),low(1085),high(1085)
.db 1+cHW,low(325),high(325),low(161),high(161),4+cH,21,21
.db 4+cH,21,60,1+cH,21,161,1+cH,21,60,1+cH,21,15
.db 4+cH,21,21,1+cH,21,60,1+cH,21,21,1+cHW,low(21),high(21),low(1085),high(1085)
; HDR on
.db 1+cH,172,172,5+cH,23,16,1+cH,23,55,10+cH,23,16
.db 1+cH,23,172,4+cH,23,16,1+cH,23,55,3+cH,23,16
.db 1+cH,23,55,2+cH,23,16,1+cH,23,55,1+cH,23,16
.db 3+cH,23,55,1+cH,23,16,2+cH,23,55,1+cH,23,16
.db 1+cHW,low(23),high(23),low(2287),high(2287),1+cH,172,172
.db 5+cH,23,16,1+cH,23,55,10+cH,23,16,1+cH,23,172
.db 4+cH,23,16,1+cH,23,55,3+cH,23,16,1+cH,23,55
.db 2+cH,23,16,1+cH,23,55,1+cH,23,16,3+cH,23,55
.db 1+cH,23,16,2+cH,23,55,1+cH,23,16,1+cHW,low(23),high(23),low(2287),high(2287)
.db 1+cH,172,172,5+cH,23,16,1+cH,23,55,10+cH,23,16
.db 1+cH,23,172,4+cH,23,16,1+cH,23,55,3+cH,23,16
.db 1+cH,23,55,2+cH,23,16,1+cH,23,55,1+cH,23,16
.db 3+cH,23,55,1+cH,23,16,2+cH,23,55,1+cH,23,16
.db 1+cHW,low(23),high(23),low(2287),high(2287),1+cH,172,172
.db 5+cH,23,16,1+cH,23,55,10+cH,23,16,1+cH,23,172
.db 4+cH,23,16,1+cH,23,55,3+cH,23,16,1+cH,23,55
.db 2+cH,23,16,1+cH,23,55,1+cH,23,16,3+cH,23,55
.db 1+cH,23,16,2+cH,23,55,1+cH,23,16,1+cHW,low(23),high(23),low(2287),high(2287)
.db 1+cH,172,172,5+cH,23,16,1+cH,23,55,10+cH,23,16
.db 1+cH,23,172,4+cH,23,16,1+cH,23,55,3+cH,23,16
.db 1+cH,23,55,2+cH,23,16,1+cH,23,55,1+cH,23,16
.db 3+cH,23,55,1+cH,23,16,2+cH,23,55,1+cH,23,16
.db 1+cHW,low(23),high(23),low(2287),high(2287),1+cH,172,172
.db 5+cH,23,16,1+cH,23,55,10+cH,23,16,1+cH,23,172
.db 4+cH,23,16,1+cH,23,55,3+cH,23,16,1+cH,23,55
.db 2+cH,23,16,1+cH,23,55,1+cH,23,16,3+cH,23,55
.db 1+cH,23,16,2+cH,23,55,1+cH,23,16,1+cHW,low(23),high(23),low(2287),high(2287)
.db 1+cH,172,172,5+cH,23,16,1+cH,23,55,10+cH,23,16
.db 1+cH,23,172,4+cH,23,16,1+cH,23,55,3+cH,23,16
.db 1+cH,23,55,2+cH,23,16,1+cH,23,55,1+cH,23,16
.db 3+cH,23,55,1+cH,23,16,2+cH,23,55,1+cH,23,16
.db 1+cHW,low(23),high(23),low(2287),high(2287),32,255,255
; SAT on
.db 1+cHW,low(349),high(349),low(172),high(172),1+cH,22,64
.db 7+cH,22,22,1+cH,22,64,1+cH,22,22,6+cH,22,64
.db 2+cH,22,22,3+cH,22,64,1+cH,22,22,4+cH,22,64
.db 3+cH,22,22,1+cH,22,64,2+cH,22,22,1+cHW,low(22),high(22),low(1539),high(1539)
.db 1+cHW,low(349),high(349),low(86),high(86),1+cHW,low(22),high(22),low(3708),high(3708)
.db 1+cHW,low(349),high(349),low(86),high(86),1+cHW,low(22),high(22),low(3708),high(3708)
; end of commands
.db 0,0
p3: ; unused
.db 0,0
p4: ; Volume up
; Volume Beamer up
.db 1+cHW,low(325),high(325),low(161),high(161),1+cH,21,15
.db 3+cH,21,21,4+cH,21,60,1+cH,21,161,1+cH,21,60
.db 1+cH,21,21,1+cH,21,60,4+cH,21,21,1+cH,21,60
.db 1+cHW,low(21),high(21),low(1085),high(1085),1+cHW,low(325),high(325),low(161),high(161)
.db 4+cH,21,21,4+cH,21,60,1+cH,21,161,1+cH,21,60
.db 1+cH,21,21,1+cH,21,60,4+cH,21,21,1+cH,21,60
.db 1+cHW,low(21),high(21),low(1085),high(1085),1+cHW,low(325),high(325),low(161),high(161)
.db 4+cH,21,21,4+cH,21,60,1+cH,21,161,1+cH,21,60
.db 1+cH,21,21,1+cH,21,60,4+cH,21,21,1+cH,21,60
.db 1+cHW,low(21),high(21),low(1085),high(1085),1+cHW,low(325),high(325),low(161),high(161)
.db 4+cH,21,21,4+cH,21,60,1+cH,21,161,1+cH,21,60
; Volume TV up
.db 1+cH,35,35,1+cH,68,35,5+cH,35,35,1+cH,35,68
.db 1+cH,68,35,2+cH,35,35,1+cHW,low(35),high(35),low(7233),high(7233),2+cH,35,35
.db 1+cH,68,35,4+cH,35,35,1+cH,35,68,1+cH,68,35
.db 2+cH,35,35,1+cHW,low(35),high(35),low(3472),high(3472)
.db 2+cH,35,35,1+cH,68,35,4+cH,35,35,1+cH,35,68
.db 1+cH,68,35,2+cH,35,35,1+cHW,low(35),high(35),low(3472),high(3472),2+cH,35,35
.db 1+cH,68,35,4+cH,35,35,1+cH,35,68,1+cH,68,35
.db 2+cH,35,35,1+cHW,low(35),high(35),low(3472),high(3472)
.db 2+cH,35,35,1+cH,68,35,4+cH,35,35,1+cH,35,68
.db 1+cH,68,35,2+cH,35,35,1+cHW,low(35),high(35),low(3472),high(3472),2+cH,35,35
.db 1+cH,68,35,4+cH,35,35,1+cH,35,68,1+cH,68,35
.db 2+cH,35,35,1+cHW,low(35),high(35),low(3472),high(3472)
.db 0,0 ; end of code
p5: ; Start HDR recording
.db 1+cH,172,172,5+cH,23,16,1+cH,23,55,10+cH,23,16
.db 1+cH,23,172,5+cH,23,16,1+cH,23,55,4+cH,23,16
.db 3+cH,23,55,1+cH,23,16,4+cH,23,55,2+cH,23,16
.db 1+cHW,low(23),high(23),low(2287),high(2287),1+cH,172,172
.db 5+cH,23,16,1+cH,23,55,10+cH,23,16,1+cH,23,172
.db 5+cH,23,16,1+cH,23,55,4+cH,23,16,3+cH,23,55
.db 1+cH,23,16,4+cH,23,55,2+cH,23,16,1+cHW,low(23),high(23),low(2287),high(2287)
.db 0,0 ; unused
p6: ; SAT Program up
.db 1+cHW,low(349),high(349),low(172),high(172),1+cH,22,64
.db 7+cH,22,22,1+cH,22,64,1+cH,22,22,6+cH,22,64
.db 1+cH,22,22,1+cH,22,64,1+cH,22,22,1+cH,22,64
.db 2+cH,22,22,3+cH,22,64,1+cH,22,22,1+cH,22,64
.db 1+cH,22,22,2+cH,22,64,2+cH,22,22,1+cHW,low(22),high(22),low(1539),high(1539)
.db 1+cHW,low(349),high(349),low(86),high(86),1+cHW,low(22),high(22),low(3708),high(3708)
.db 1+cHW,low(349),high(349),low(86),high(86),1+cHW,low(22),high(22),low(3708),high(3708)
.db 0,0 ; unused
p7: ; Volume down
; Volume beamer down
.db 1+cHW,low(325),high(325),low(161),high(161),4+cH,21,15
.db 2+cH,26,60,2+cH,21,60,1+cH,26,161,2+cH,21,15
.db 1+cH,21,60,1+cH,26,15,3+cH,21,15,1+cH,21,60
.db 1+cHW,low(26),high(26),low(1085),high(1085),1+cHW,low(325),high(325),low(161),high(161)
.db 1+cH,26,15,1+cH,21,15,1+cH,26,15,1+cH,21,15
.db 4+cH,21,60,1+cH,21,161,2+cH,21,15,1+cH,21,60
.db 4+cH,21,15,1+cH,21,60,1+cHW,low(21),high(21),low(1085),high(1085),1+cHW,low(325),high(325),low(161),high(161)
.db 4+cH,21,21,4+cH,21,60,1+cH,21,161,2+cH,21,21
.db 1+cH,21,60,4+cH,21,21,1+cH,21,60,1+cHW,low(21),high(21),low(1085),high(1085)
; Volume TV down
.db 2+cH,35,35,1+cH,68,35,4+cH,35,35,1+cH,35,68
.db 1+cH,68,35,1+cH,35,35,1+cH,35,68,1+cHW,low(35),high(35),low(3472),high(3472)
.db 2+cH,35,35,1+cH,68,35,4+cH,35,35,1+cH,35,68
.db 1+cH,68,35,1+cH,35,35,1+cH,35,68,1+cHW,low(35),high(35),low(3472),high(3472)
.db 2+cH,35,35,1+cH,68,35,4+cH,35,35,1+cH,35,68
.db 1+cH,68,35,1+cH,35,35,1+cH,35,68,1+cHW,low(35),high(35),low(3472),high(3472)
.db 2+cH,35,35,1+cH,68,35,4+cH,35,35,1+cH,35,68
.db 1+cH,68,35,1+cH,35,35,1+cH,35,68,1+cHW,low(35),high(35),low(3472),high(3472)
.db 0,0 ; unused
p8: ; Stop HDR recording
.db 1+cH,172,172,5+cH,23,16,1+cH,23,55,10+cH,23,16
.db 1+cH,23,172,5+cH,23,16,1+cH,23,55,3+cH,23,16
.db 1+cH,23,55,1+cH,23,16,2+cH,23,55,1+cH,23,16
.db 3+cH,23,55,1+cH,23,16,1+cH,23,55,1+cH,23,16
.db 1+cHW,low(23),high(23),low(2287),high(2287),1+cH,172,172
.db 1+cH,172,172,5+cH,23,16,1+cH,23,55,10+cH,23,16
.db 1+cH,23,172,5+cH,23,16,1+cH,23,55,3+cH,23,16
.db 1+cH,23,55,1+cH,23,16,2+cH,23,55,1+cH,23,16
.db 3+cH,23,55,1+cH,23,16,1+cH,23,55,1+cH,23,16
.db 1+cHW,low(23),high(23),low(2287),high(2287),1+cH,172,172
.db 0,0 ; unused
p9: ; SAT Program down
.db 1+cHW,low(349),high(349),low(172),high(172),1+cH,22,64
.db 7+cH,22,22,1+cH,22,64,1+cH,22,22,6+cH,22,64
.db 1+cH,22,22,1+cH,22,64,2+cH,22,22,1+cH,22,64
.db 1+cH,22,22,3+cH,22,64,1+cH,22,22,2+cH,22,64
.db 1+cH,22,22,1+cH,22,64,2+cH,22,22,1+cHW,low(22),high(22),low(1539),high(1539)
.db 1+cHW,low(349),high(349),low(86),high(86),1+cHW,low(22),high(22),low(3708),high(3708)
.db 1+cHW,low(349),high(349),low(86),high(86),1+cHW,low(22),high(22),low(3708),high(3708)
.db 0,0 ; unused
;
; Test codes
;
;pStar:
;.db 5+nHgh,25,25,0
;pNmbr:
;.db 10+nHgh,50,50,0
;p0:
;.db 15+nHgh,75,75,0
;p1:
;.db 20+nHgh,100,100,0
;p2:
;.db 25+nHgh,125,125,0
;p3:
;.db 30+nHgh,150,150,0
;p4:
;.db 35+nHgh,175,175,0
;p5:
;.db 40+nHgh,200,200,0
;p6:
;.db 45+nHgh,225,225,0
;p7:
;.db 50+nHgh,250,250,0
;p8:
;.db 55+nDblHgh,Low(275),High(275),Low(275),HIGH(275),0
;p9:
;.db 60+nDblHgh,Low(300),High(300),Low(300),High(300),0
;
; Ende Quellcode
; Copyright
.db "(C)2010 by Gerhard Schmidt " ; menschenlesbar
.db "C(2)10 0ybG reahdrS hcimtd " ; wortgerecht
;
An den Seitenanfang, Zur TX45-Seite,
Zur IR-Leitseite
©2010 by http://www.avr-asm-tutorial.net