Czy attiny 2313 ma pin ss i gdzie?? Do SPI
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tam
$regfile = "ATtiny2313.DAT"
$crystal = 4000000
$hwstack = 40
Dioda_led Alias Portb.2
Ddrb.2 = 1 'wyjscie - podpieta LED
Ddrb.3 = 1 'wyjscie - podpieta IR
'konfiguracja portow dla SPI
Ddrb.7 = 0 : Portb.7 = 0 'wejscie - CLK
Ddrb.5 = 0 : Portb.5 = 0 'wejscie - MISO
Dim Transmisja As Byte
Dim Zmienna As Byte
Dim I As Byte
Declare Sub Led
Declare Sub Led_k
On Uci_ovflw Odebrano
Usicr = &B01011001
Config Spi = Soft , Din = Pinb5 , Dout = Portb6 , Ss = None , Clock = Portb7
Enable Interrupts
Transmisja = 0
Led : Led
Do
If Transmisja = 1 Then
Usisr.6 = 1
Usisr.6 = 0
Transmisja = 0
For I = 1 To Zmienna
Led
Next I
End If
Loop
End
Sub Led
Reset Dioda_led : Waitms 200 : Set Dioda_led : Waitms 200
End Sub
Sub Led_k
Reset Dioda_led : Waitms 100 : Set Dioda_led : Waitms 100
End Sub
Odebrano:
Zmienna = Usidr
Transmisja = 1
Return