Wiecie co? Może przeanalizujemy razem ten projekt bo próbowałem sam ale jakoś mi to nie wychodzi.
Po niżej listing programu:
Cytat: $crystal = 10000000
$baud = 9600
Dim Command As Byte , Adress As Byte
Dim Tempcommand As Byte , Setcommand As Byte
Dim Registered_adress As Byte
Dim Togglebit As Bit
Config Rc5 = Pind.2
Config Pind.2 = Input
Config Portb = Output
Declare Sub Get_rc5
Declare Sub Sendcommand
Declare Sub Address_registration
Enable Interrupts
Set Portb.7
Reset Portb.0
Readeeprom Registered_adress , 1
If Pinb.7 = 0 Or Registered_adress = 255 Then Address_registration
Do
Call Get_rc5
Set Portb.0
If Adress = Registered_adress Then
Reset Portb.0
Tempcommand = Command
Waitms 200
Call Get_rc5
If Adress = Registered_adress Then
If Tempcommand = Command Then
Togglebit = 1
Do
Setcommand = Command Or &B10000000
Call Sendcommand
Call Get_rc5
Loop Until Tempcommand <> Command
Else
Setcommand = Tempcommand And &B01111111
Call Sendcommand
Setcommand = Command And &B01111111
Call Sendcommand
End If
Else
If Togglebit = 0 Then
Setcommand = Tempcommand And &B01111111
Call Sendcommand
End If
End If
Togglebit = 0
End If
Loop
Sub Address_registration
Waitms 50
Print
Print "Nacisnij przycisk pilota."
Do
Adress = 255
Call Get_rc5
If Adress < 32 Then
Writeeeprom Adress , 1
Readeeprom Registered_adress , 1
Print "Adres pilota zapisany. Adress: " ; Registered_adress
Waitms 100
Exit Do
End If
Loop
End Sub
Sub Get_rc5:
Getrc5(adress , Command)
End Sub
Sub Sendcommand:
Print Setcommand
End Sub
Ja bym się przyczepił do początkowej części progamu:
Cytat: $crystal = 10000000
$baud = 9600
Dim Command As Byte , Adress As Byte
Dim Tempcommand As Byte , Setcommand As Byte
Dim Registered_adress As Byte
Dim Togglebit As Bit
Config Rc5 = Pind.2
Config Pind.2 = Input
Config Portb = Output
Declare Sub Get_rc5
Declare Sub Sendcommand
Declare Sub Address_registration
Enable Interrupts
Set Portb.7
Reset Portb.0
Readeeprom Registered_adress , 1
If Pinb.7 = 0 Or Registered_adress = 255 Then Address_registration
Z tego co mi się wydaje to: albo schemat ma mały błąd, ponieważ mikroprocesor ma wysyłać informacje za pomocą pinu 19 (Set Portb.7), zaś móżka z IC2 jest przylutowana do pinu3 (PD1). Z tego co mi cię wydaje z tego co mi cię wydaje to piny o nazwie
PD odbierają informacje, zaś piny o nazwie
PB wysyłają.
Prozę komentarz czy dobrze kombinuje.
Dodano po 2 [godziny]: Zastanawia mnie jedna rzecz, skoro czytnik IC4 - TFMS5360 jest podłączony odpowiednio do procka, to dlaczego nie mryga dioda?
Przecież jest dobrze podłączona?