Witam!
Mam mały problem z odczytem rc5 na atmega88pa. Program bez problemu działa na atmega8 ale już na atmega88pa nie działa. Kontroler jest nowy. Do odczytu używam tych samych odbiorników rc5 TSOP34836. Wyjście odbiornika podpięte bezpośrednio do portd.2, między GND a Vs jest kondensator 100u i Vs jest podpięte do +5V z rezystorem 220ohm. Proszę o wskazówki co może być nie tak Program :
Mam mały problem z odczytem rc5 na atmega88pa. Program bez problemu działa na atmega8 ale już na atmega88pa nie działa. Kontroler jest nowy. Do odczytu używam tych samych odbiorników rc5 TSOP34836. Wyjście odbiornika podpięte bezpośrednio do portd.2, między GND a Vs jest kondensator 100u i Vs jest podpięte do +5V z rezystorem 220ohm. Proszę o wskazówki co może być nie tak Program :
$regfile = "m88pdef.DAT"
$crystal = 8000000
Config Lcdpin = Pin , Db4 = Portc.1 , Db5 = Portc.2 , Db6 = Portc.3 , Db7 = Portc.4 , E = Portc.0 , Rs = Portd.5
Config Lcd = 16 * 2
'Config Lcdpin = Pin , Db4 = Portd.6 , Db5 = Portd.5 , Db6 = Portd.1 , Db7 = Portd.0 , E = Portd.7 , Rs = Portb.0
'Config Lcd = 16 * 2
Cursor Off
Cls
Lcd "cos"
Wait 2
Config Pinc.5 = Output
Reset Portc.5
Config Int0 = Low Level
Config Rc5 = Pind.2 'do Int0
On Int0 Pobr_rc5
Dim Address As Byte , Command As Byte
Dim Odebr_kod As Bit
Enable Interrupts
Enable Int0
Do
Cls
Lcd "Adres:" ; Address
Lowerline
Lcd "Komenda:" ; Command
Waitms 100
Loop
End 'end program
Pobr_rc5:
Set Portc.5
Disable Int0
Enable Interrupts
Getrc5(address , Command)
Command = Command And &B01111111
Reset Portc.5
Cls
Enable Int0
Return