Hallo zusammen,

man findet ja leider nicht viel in AVR8ASM zu diesem Thema.

Muss TSM wirklich einmal seperat gesetzt werden ?
Code:
Neustart2:
ldi rmp,1<<TSM ; Prescaler Sync Mode
out GTCCR,rmp
ldi rmp,(1<<TSM)|(1<<PSR10) ; Reset Presc1
out GTCCR,rmp
clr rmp
out GTCCR,rmp ; Prescaler Count Mode
out TCNT1H,rmp ; 16-Bit-Zaehler ruecksetzen
out TCNT1L,rmp
ldi rmp,1<<OCIE1A
out TIMSK1,rmp ; in Timer-Int-Maske
ret
Würde es beim ATtiny13A nicht auch so reichen ?
Code:
ldi rmp,1<<TSM|1<<PSR10
out GTCCR,rmp
clr rmp
out GTCCR,rmp
out TCNT0,rmp
oder gar so :
Code:
ldi  rmp,1<<TSM
out  GTCCR,rmp
clr  rmp
out  GTCCR,rmp
out  TCNT0,rmp
Raffe dass Englische nämlich nicht, trotz Google-Übersetzers, wegen dem
letzten Satz :

• Bit 7 – TSM: Timer/Counter Synchronization Mode
Writing the TSM bit to one activates the Timer/Counter Synchronization
mode. In this mode, the value that is written to the PSR10 bit is kept,
hence keeping the Prescaler Reset signal asserted. This ensures that the
Timer/Counter is halted and can be configured without the risk of
advancing during configuration. When the TSM bit is written to zero, the
PSR10 bit is cleared by hardware, and the Timer/Counter start counting.

• Bit 0 – PSR10: Prescaler Reset Timer/Counter0
When this bit is one, the Timer/Counter0 prescaler will be Reset.

*This bit is normally cleared immediately by hardware, except if the TSM
bit is set.*


Bernd_Stein