witam, czy bawi³ siê kto¶ z Was odbiorem RC5 za pomoc± FastAVR? Odbieram tylko komendy o nr 4, 8, 16 lub 12 i czêsto pod jednym przyciskiem ró¿ne. Zmieni³em ju¿ TSOP1736 na SFH5110 i dalej to samo, jeszcze nie zmienia³em pilota ale jaki¶ rok temu dzia³a³.. moze kto¶ te¿ mia³ problemy z t± procedurk± pozdrawiam KamilK PS: fastavr 316, kod:
$Device= Atmega8 ' used device $Stack = 28 ' stack depth $Clock = 6 ' adjust for used crystal $Source=On ' basic source in Asm
$Lcd =PORTC.0, RS=PORTC.5, EN=PORTC.4,16,2 $Def Led=PORTD.0: $Def dled=DDRD.0 $RC5 =PORTD.2 $Def drc5=DDRD.2 $Def rc5in=PIND.2
Declare Interrupt Int0()
Dim adr As Byte Dim comm As Byte Dim rc5ok As Bit
Reset drc5 'rc5 jako wejscie Set dled
InitLcd() Display On Int0 Falling Enable Int0 Enable Timer0 Enable Interrupts Locate 1,1:Lcd "waiting for RC5" Do If rc5ok=1 Then Cls Locate 1,1:Lcd "RC5 adres: "; adr Locate 2,1:Lcd "RC5 command: "; comm Reset rc5ok End If Toggle led WaitMs 100 Loop
'subroutines: Interrupt Int0() , Save 1 ' Disable Int0 Enable Interrupts RC5(adr, comm) If comm<255 Then Set rc5ok Reset Int0 Enable Int0 End Interrupt