logo elektroda
logo elektroda
X
logo elektroda
REKLAMA
REKLAMA
Adblock/uBlockOrigin/AdGuard mogą powodować znikanie niektórych postów z powodu nowej reguły.

Attiny i pin ss. Czy jest taki pin? Gdzie jest? Do SPI.

zibi11 10 Lut 2007 16:24 2202 3
REKLAMA
  • #1 3552760
    zibi11
    Poziom 19  
    Posty: 537
    Pomógł: 1
    Ocena: 30
    Czy attiny 2313 ma pin ss i gdzie?? Do SPI
  • REKLAMA
  • #2 3552834
    crazy_phisic
    VIP Zasłużony dla elektroda
    Posty: 2244
    Pomógł: 278
    Ocena: 130
    Informacja ze strony 143 (Three-wire Mode):
    "The USI Three-wire mode is compliant to the Serial Peripheral Interface (SPI) mode 0
    and 1, but does not have the slave select (SS) pin functionality. However, this feature
    can be implemented in software if necessary. Pin names used by this mode are: DI, DO,
    and USCK"
  • REKLAMA
  • #3 3552936
    zibi11
    Poziom 19  
    Posty: 537
    Pomógł: 1
    Ocena: 30
    softwarowo ss robił to ktoś w bascomie
    żeby ustawić attinke jako slave??
  • #4 3553325
    wicy
    Poziom 22  
    Posty: 670
    Pomógł: 30
    Ocena: 111
    Czy to SS jest konieczne?? Na takim programiku zadziałała mi transmisja z LPT. Dwie linie LPT podpięte pod PD5 i PD7. Trzeciej linii w stronę PC nie próbowałem bo i nie była mi potrzebna.
    
    $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
REKLAMA