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

[bascom] [attiny2313]timer0

Braders 06 Lut 2012 23:17 1813 3
REKLAMA
  • #1 10506917
    Braders
    Poziom 12  
    witam szukam jakiegoś poradnika na ten temat.
    za każda podpowiedz dziękuje.
  • REKLAMA
  • REKLAMA
  • #3 10517020
    Braders
    Poziom 12  
    witam mam takie pytanie co w tym programie jest źle
    
     $regfile = "attiny2313.dat"
    $crystal = 8000000
    
    
    Config Portd = Input
           Portd = &B00000000
    Config Portb = Output
           Portb = &B0000000
    
    Config Timer0 = Timer , Prescale = 64
    
    On Timer0 Przerwanie_co_2ms
    
    
    Dim Licznik As Integer
    Enable Interrupts
    Enable Timer0
    Timer0 = 56
    
    Licznik = 0
    Do
    Loop
    End
    :
    
      Counter0 = Counter0 + 56
    
    
      Incr Licznik
      If Licznik = 100 Then
       Portb. 0 = 1
       Portb. 1 = 0
       Portb. 2 = 0
       Portb. 3 = 0
    
    
    
       If Licznik = 200 Then
       Portb. 0 = 0
       Portb. 1 = 1
       Portb. 2 = 0
       Portb. 3 = 0
    
    
       If Licznik = 300 Then
       Portb. 0 = 0
       Portb. 1 = 0
       Portb. 2 = 1
       Portb. 3 = 0
    
       If Licznik = 400 Then
       Portb. 0 = 0
       Portb. 1 = 0
       Portb. 2 = 0
       Portb. 3 = 1
    
      End If
    Return
    



    jest to sterownik silnika krokowego.
    bascoma uczę się na poważnie od jakiś 2 tygodni więc za błędy z góry pzepraszam.
REKLAMA