Hallo,
wie ich schon im Thread zu IMADEIT geschrieben habe, habe ich mit dem Timer/Counter ein Problem.
Timer0 geht, aber Timer1 kriege ich einfach nicht hin.
Mein Code für Timer0:
Wie sähe das jetzt mit Timr1 und Timer0 in einem aus??Code:'########## '# by jon # '########## $regfile = "m32def.dat" $crystal = 1000000 $baud = 2400 Const Ticks = 32 Dim Count As Byte Config Timer0 = Counter , Edge = Rising Load Timer0 , Ticks Set Portb.1 On Timer0 Timer0_isr Config Pinb.0 = Input Enable Timer0 Enable Interrupts Config Pind.5 = Output 'Links Config Pind.4 = Output 'Rechts Config Pinc.5 = Output R_1 Alias Portc.5 Config Pinc.4 = Output R_2 Alias Portc.4 Config Pinc.3 = Output L_1 Alias Portc.3 Config Pinc.2 = Output L_2 Alias Portc.2 Config Timer1 = Pwm , Pwm = 10 , Compare A Pwm = Clear Up , Compare B Pwm = Clear Up , Prescale = 1 R_1 = 0 R_2 = 1 Pwm1b = 50 L_1 = 0 L_2 = 1 Pwm1a = 50 Do Print "TCNT0 = " ; Tcnt0 ; Spc(3) ; "Count = " ; Count Waitms 200 Loop End Timer0_isr: Load Timer0 , Ticks Incr Count Return
Würde mich freuen, wenn sich jemand die Mühe macht und mir hilft!
jon







Zitieren


Lesezeichen