Attiny25 Deadtime

Gast #6885196
Lesenswert?
• ▲
▼
Hallo,
ich versuche eine Totzeit beim Attiny25
am Port OCR1B zu programmieren.
Die PWM funktioniert, aber die Totzeit ist nicht da?
Was ist falsch?
anbei Ausschnitt Quellcode

      ldi temp, (1<<PLLE)  ; Enable PLL
      out PLLCSR, temp
waitPLL:

      in temp, PLLCSR  ; Wait for PLL 100ms)
      sbrs temp,PLOCK
      rjmp waitPLL

      in temp, PLLCSR  ; Set PLL as PWM clock source 64Mhz
      ldi temp1,(1<<PCKE)
      or temp,temp1
      out PLLCSR,temp


      ldi temp,(1<<CS12)|(1<<CS10); 30 kHz Takt
        out TCCR1,temp


        ldi temp,(1<<PWM1B)|(1<<COM1B0)  ;Port B3 Comparator
       out GTCCR,temp


      ldi temp1,3  ;Deadtime Teiler 8x
      out DTPS1,temp

      ldi temp1,255  ;Deadtime B Comparator  Max
       out DT1B,temp
Gast #6885232
Lesenswert?
• ▲
▼
Guck mal in Zeile 42 ;-)
Wie, keine Zeilennummern? Das würde die Diskussion über deinen Code 
erheblich vereinfachen.

Hat es einen besonderen Grund, dass du keine code-Tags verwendest, wie 
unter "Formatierung" angegeben?
Gast #6885715
Lesenswert?
• ▲
▼
Noch eine Anmerkung: 'out DTPS1,temp' geht schief, das Datenblatt ist an 
dieser Stelle (14.1.1) falsch, siehe tn25def.inc:
1
.equ  DTPS  = 0x23
2
; DTPS - Dead time prescaler register
3
.equ  DTPS0  = 0  ; 
4
.equ  DTPS1  = 1  ;

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren