Hab hier 2x Atmega8, LD 274 bzw. grüne LED als Kontrolle und TSOP1736.
Die Hardware wurde identisch aufgebaut wie auf dem Schaltplan.
Bild hier
Sender
Beim Senden klappt es. Hab grüne LED angeschlossen und es blinkt alle 1 Sekunde.Code:'RC5 senden
$regfile = "m8def.dat"
$crystal = 1000000 'Interner Takt 1 MHz
' +5V <---[A IR-Led K]---[330 Ohm]---> Pb.1(OC1A) for Atmega8
Dim Togbit As Byte , Adresse As Byte , Command As Byte
Command = 12
Adresse = 0
Togbit = 0
Do
Wait 1
Rc5send Togbit , Adresse , Command
Loop
Empfänger
Es empfängt gar nicht außer Terminal "Waiting for RC5..."Code:'RC5 empfangen
$regfile = "m8def.dat"
$crystal = 16000000 'externer Quarzoszillator 16 MHz
$baud = 9600
$lib "mcsbyte.lbx"
'PD.4 (INT0)
Config Rc5 = Pind.4
Enable Interrupts
Dim Adresse As Byte , Command As Byte
Print "Waiting for RC5..."
Do
Getrc5(adresse , Command)
If Adresse = 0 Then
Command = Command And &B01111111
Print "Adresse:" ; Adresse
Print "Command:" ; Command
End If
Loop
Bild hier