Die Lösung hat vielleicht etwas hiermit zu tun, aber ich finde keine Infos zu den entsprechenden Registern in Bascom
- - - Aktualisiert - - -
Super, wenn vor dem Bäcker eine lange Schlange ist, dann kann man noch mehr googeln... Das hier wird hoffentlich die Lösung sein:
Code:
'----------COUNTER/TIMER----Subroutines-----------------------------------------
'TC0_ConfigClockSource
'Configures clock source for the Timer/Counter 0
'Clockselection [0 = OFF, 1 = DIV1, 2 = DIV2, 3 = DIV4, 4= DIV8, 5 = DIV64, 6 = DIV256, 7 = DIV1024, 8 = EventChannel 0 ....15 = Event Channel 7
Sub Tc0_configclocksource(byval Port As String , Byval Clockselection As Byte)
Select Case Port
Case "C": 'Port C
Select Case Clockselection
Case 0 : Tcc0_ctrla = &B0000_0000 'OFF
Case 1 : Tcc0_ctrla = &B0000_0001 'DIV1
Case 2 : Tcc0_ctrla = &B0000_0010
Case 3 : Tcc0_ctrla = &B0000_0011
Case 4 : Tcc0_ctrla = &B0000_0100
Case 5 : Tcc0_ctrla = &B0000_0101
Case 6 : Tcc0_ctrla = &B0000_0110
Case 7 : Tcc0_ctrla = &B0000_0111 'DIV1024
Case 8 : Tcc0_ctrla = &B0000_1000 'Event Channel 0
Case 9 : Tcc0_ctrla = &B0000_1001
Case 10 : Tcc0_ctrla = &B0000_1010
Lesezeichen