Схема там элементарная, порты светодиода через резисторы 22 ома параллельно питают светодиод. А кусок исходника кодера RC-5 вот:
.equ FCLK = 8000000 ;clock frequency (internal RC) [Hz]
.equ SYS = 0 ;RC-5 system number - DEBUG
.equ COM1 = 1 ;RC-5 command code for button 1
.equ COM2 = 2 ;RC-5 command code for button 2
.equ CB = 0x20 ;RC-5 control bit position
;Macro: generate IR pulse @0 [uS] modulated with @1 [Hz] :
.macro Pulse
ldi HalfP,(FCLK / 2 / @1)
ldi tempL,byte1((@0 * @1 / 100000 - 5) / 10)
ldi tempH,byte2((@0 * @1 / 100000 - 5) / 10)
rcall DoPls
.endm
;Macro: generate pause @0 [uS]:
.macro Pause
ldi tempL,byte1((@0 * FCLK / 100 / 100000 - 5) / 10)
ldi tempH,byte2((@0 * FCLK / 100 / 100000 - 5) / 10)
rcall DoPau
.endm
.def temp = r16 ;temporary register temp
.def tempL = r17 ;temporary register tempL
.def tempH = r18 ;temporary register tempH
.def Cnt = r19 ;temporary register Cnt
.def System = r20 ;RC-5 system code and control bit
.def Command = r21 ;RC-5 command code
.def HalfP = r22 ;modulation half-period
.def tempC = r23 ;temporary register tempC
.def tempS = r24 ;temporary register tempS
;Delay:
;Cnt - cycles number (17 minimum)
; ldi Cnt,Cycles ;1
; rcall Delay ;3
Delay: subi Cnt,13 ;1
lsr Cnt ;1 Cnt / 2
brcs de1 ;2(1)
de1: lsr Cnt ;1 Cnt / 2
brcs de2 ;2(1)
de2: brcs de3 ;2(1)
de3: dec Cnt ;1
nop ;1
brne de3 ;2(1)
ret ;4
;Generate IR modulated pulse:
;tempH:tempL - pulse duration in loop cycles
;Pulse - modulation half-period
DoPls: ldi temp,~LED ;1
out PORTC,temp ;1
ldi Cnt,-3 ;1
add Cnt,HalfP
rcall Delay ;Pulse - 3
ldi temp,LED ;1
out PORTC,temp ;1
ldi Cnt,-7 ;1
add Cnt,HalfP
rcall Delay ;Pulse - 7
subi tempL,1 ;1
sbci tempH,0 ;1
brcc DoPls ;2(1)
ret
;Generate pause:
;tempH:tempL - pause duration in loop cycles
DoPau: ldi Cnt,96
rcall Delay ;96
subi tempL,1 ;1
sbci tempH,0 ;1
brcc DoPau ;2(1)
ret
;Transmit bit in manchester code:
Manch: brcs bit1
nop
bit0: Pulse 889, 36000
Pause 889
ret
bit1: Pause 889
Pulse 889, 36000
ret
;Transmit RC-5:
;System - RC-5 system number and control bit (X,X,CB,S4,S3,S2,S1,S0)
;Command - RC-5 command (X,X,C5,C4,C3,C2,C1,C0)
Tx_Rc5: mov tempS,System
ori tempS,0xC0 ;add start bits
mov tempC,Command
lsl tempC ;shift command code
lsl tempC
lsl tempS
rcall Manch ;bit 01: Start bit 1
lsl tempS
rcall Manch ;bit 02: Start bit 2
lsl tempS
rcall Manch ;bit 03: Control bit
lsl tempS
rcall Manch ;bit 04: System bit 4
lsl tempS
rcall Manch ;bit 05: System bit 3
lsl tempS
rcall Manch ;bit 06: System bit 2
lsl tempS
rcall Manch ;bit 07: System bit 1
lsl tempS
rcall Manch ;bit 08: System bit 0
lsl tempC
rcall Manch ;bit 09: Command bit 5
lsl tempC
rcall Manch ;bit 10: Command bit 4
lsl tempC
rcall Manch ;bit 11: Command bit 3
lsl tempC
rcall Manch ;bit 12: Command bit 2
lsl tempC
rcall Manch ;bit 13: Command bit 1
lsl tempC
rcall Manch ;bit 14: Command bit 0
ret