CONFIG TIMER1/de

(Difference between revisions)
Jump to: navigation, search
((**COPIED FROM ENGLISH PAGE**) =)
(Remarks)
Line 33: Line 33:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">Remarks</span> =
+
= <span class="f_Header">Anmerkungen</span> =
  
The TIMER1 is a 16 bit counter. See the hardware description of TIMER1.
+
Der TIMER1 ist ein 16 Bit-Zähler. Siehe die Hardware-Beschreibung des TIMER1.
  
It depends on the chip if COMPARE_B is available or not.
+
Es hängt vom verwendeten Chip ab, ob COMPARE_B verfügbar ist oder nicht.
  
Some chips even have a COMARE_C.
+
Einige Chips haben sogar einen COMPARE_C.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
The syntax shown above must be on one line. Not all the options need to be selected.
+
Die gezeigte Syntax muss in EINER Zeile stehen. Nicht alle Parameter müssen verwendet werden.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
Line 49: Line 49:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
Here is the effect of the various options.
+
So ist der Effekt der verschiedenen Parameter:
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
{| width="604" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
 
{| width="604" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
Line 57: Line 57:
  
 
| valign="top" width="100%" style="width: 484px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 484px; border: 1px solid rgb(0, 0, 0);" |  
You can select whether the TIMER will count on the falling or rising edge. Only for COUNTER mode.
+
Man kann selektieren, ob der Timer für fallende oder steigende Flanke (fallig oder rising edge) benutzt werden soll. Nur für COUNTER-Modus.
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 75: Line 75:
  
 
| valign="top" width="100%" style="width: 484px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 484px; border: 1px solid rgb(0, 0, 0);" |  
To allow noise canceling you can provide a value of 1.
+
Um Störunterdrückung zu ermöglichen kann man den Wert 1 einstellen.  
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 82: Line 82:
  
 
| valign="top" width="100%" style="width: 484px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 484px; border: 1px solid rgb(0, 0, 0);" |  
The TIMER is connected to the system clock in this case. You can select the division of the system clock with this parameter.
+
Der TIMER ist in diesem Fall mit dem Systemtakt verbunden. Man kann den Teiler für den Systemtakt mit diesem Parameter wählen.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
Valid values are 1 , 8, 64, 256 or 1024
+
Gültige Werte sind 1 , 8, 64, 256 oder 1024
  
PRESCALE can't be used in COUNTER mode.
+
PRESCALE kann NICHT im COUNTER Modus verwendet werden.
  
 
|}
 
|}
Line 98: Line 98:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
The TIMER1 also has two compare registers A and B
+
Der TIMER1 hat auch zwei Compare Register A und B
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
When the timer value matches a compare register, an action can be performed
+
Wenn der Timer-Wert mit dem Wert in einem Compare-Register übereinstimmt dann kann eine Aktion ausgeführt werden.
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
{| width="604" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
 
{| width="604" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
Line 110: Line 110:
  
 
| valign="top" width="100%" style="width: 502px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 502px; border: 1px solid rgb(0, 0, 0);" |  
The action can be:
+
Die Aktion kann sein:
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
SET will set the OC1X pin
+
SET setzt den OC1X Pin
  
CLEAR will clear the OC1X pin
+
CLEAR löscht OC1X Pin
  
TOGGLE will toggle the OC1X pin
+
TOGGLE toggelt den OC1X Pin
  
DISCONNECT will disconnect the TIMER from output pin OC1X
+
DISCONNECT entkoppelt den TIMER com Ausgabe-Pin OC1X
  
 
|}
 
|}
Line 126: Line 126:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
And the TIMER can be used in PWM mode.
+
Und der TIMER kann im PWM Modus benutzt werden.
 +
 
 +
Man hat die Wahl zwischen 8, 9 oder 10 Bit PWM Modus
  
You have the choice between 8, 9 or 10 bit PWM mode
 
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
Also you can specify if the counter must count UP or down after a match to the compare registers
+
Man kann außerdem spezifizieren, ob der Timer nach einer Übereinstimmung mit dem Compare Register hoch (UP) oder runter (DOWN) gezählt werden soll.
  
Note that there are two compare registers A and B
+
Beachten Sie, dass es zwei Compare Register A und B gibt.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
Line 144: Line 145:
  
 
| valign="top" width="100%" style="width: 442px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 442px; border: 1px solid rgb(0, 0, 0);" |  
Can be 8, 9 or 10.
+
Kann 8, 9 oder 10 sein.
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 151: Line 152:
  
 
| valign="top" width="100%" style="width: 442px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 442px; border: 1px solid rgb(0, 0, 0);" |  
PWM compare mode. Can be CLEAR_UP or CLEAR_DOWN
+
PWM compare Modus. Kann CLEAR_UP oder CLEAR_DOWN sein
  
 
|}
 
|}
Line 159: Line 160:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
Using COMPARE_A, COMPARE_B, COMPARE_A_PWM or COMPARE_B_PWM will set the corresponding pin for output. When this is not desired you can use the alternative NO_OUTPUT version that will not alter the output pin.
+
Bei Benutzung von COMPARE_A, COMPARE_B, COMPARE_A_PWM oder COMPARE_B_PWM werden die entsprechenden Ausgabe-Pins gesetzt. Wenn dies nicht gewünscht ist kann man  NO_OUTPUT benutzen damit der Output-Pin nicht verändert wird.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
For example&nbsp;: COMPARE_A_NO_OUTPUT , COMPARE_A_PWM NO_OUTPUT
+
Beispiel&nbsp;: COMPARE_A_NO_OUTPUT , COMPARE_A_PWM NO_OUTPUT
  
 
&nbsp;
 
&nbsp;
  
CONFIGURATION is optional. When you add configuration=mysetting, you can use this setting when you start the timer&nbsp;: START TIMER0 , mysetting
+
CONFIGURATION ist optional. Wenn man configuration=mysetting hinzufügt dann kann man beim Start des Timers benutzen: START TIMER0 , mysetting
  
If you have multiple settings, you can start the timer with these different settings.
+
Wenn man mehrere Settings hat dann kann man den Timer mit diesen Settings starten.
  
 
&nbsp;
 
&nbsp;

Revision as of 23:42, 1 April 2013

Contents

Funktion

Konfigurieren des TIMER1.

 

 

Syntax

CONFIG TIMER1 = COUNTER | TIMER | PWM ,

EDGE=RISING | FALLING , PRESCALE= 1|8|64|256|1024 ,

NOISE_CANCEL=0 |1, CAPTURE_EDGE = RISING | FALLING ,

CLEAR_TIMER = 1|0,

COMPARE_A = CLEAR | SET | TOGGLE | DISCONNECT ,

COMPARE_B = CLEAR | SET | TOGGLE | DISCONNECT ,

PWM = 8 | 9 10 ,

COMPARE_A_PWM = CLEAR_UP| CLEAR_DOWN | DISCONNECT

COMPARE_B_PWM = CLEAR_UP| CLEAR_DOWN | DISCONNECT

[,CONFIGURATION=NAME]

 

 

Anmerkungen

Der TIMER1 ist ein 16 Bit-Zähler. Siehe die Hardware-Beschreibung des TIMER1.

Es hängt vom verwendeten Chip ab, ob COMPARE_B verfügbar ist oder nicht.

Einige Chips haben sogar einen COMPARE_C.

 

Die gezeigte Syntax muss in EINER Zeile stehen. Nicht alle Parameter müssen verwendet werden.

 

 

So ist der Effekt der verschiedenen Parameter:

EDGE

Man kann selektieren, ob der Timer für fallende oder steigende Flanke (fallig oder rising edge) benutzt werden soll. Nur für COUNTER-Modus.

CAPTURE_ EDGE

You can choose to capture the TIMER registers to the INPUT CAPTURE registers

 

With the CAPTURE_EDGE = FALLING/RISING, you can specify to capture on the falling or rising edge of pin ICP

NOISE_ CANCELING

Um Störunterdrückung zu ermöglichen kann man den Wert 1 einstellen.

PRESCALE

Der TIMER ist in diesem Fall mit dem Systemtakt verbunden. Man kann den Teiler für den Systemtakt mit diesem Parameter wählen.

 

Gültige Werte sind 1 , 8, 64, 256 oder 1024

PRESCALE kann NICHT im COUNTER Modus verwendet werden.

 

 

 

Der TIMER1 hat auch zwei Compare Register A und B

 

Wenn der Timer-Wert mit dem Wert in einem Compare-Register übereinstimmt dann kann eine Aktion ausgeführt werden.

COMPARE_A

Die Aktion kann sein:

 

SET setzt den OC1X Pin

CLEAR löscht OC1X Pin

TOGGLE toggelt den OC1X Pin

DISCONNECT entkoppelt den TIMER com Ausgabe-Pin OC1X

 

Und der TIMER kann im PWM Modus benutzt werden.

Man hat die Wahl zwischen 8, 9 oder 10 Bit PWM Modus


 

Man kann außerdem spezifizieren, ob der Timer nach einer Übereinstimmung mit dem Compare Register hoch (UP) oder runter (DOWN) gezählt werden soll.

Beachten Sie, dass es zwei Compare Register A und B gibt.

 

PWM

Kann 8, 9 oder 10 sein.

COMPARE_A_PWM

PWM compare Modus. Kann CLEAR_UP oder CLEAR_DOWN sein

 

 

Bei Benutzung von COMPARE_A, COMPARE_B, COMPARE_A_PWM oder COMPARE_B_PWM werden die entsprechenden Ausgabe-Pins gesetzt. Wenn dies nicht gewünscht ist kann man NO_OUTPUT benutzen damit der Output-Pin nicht verändert wird.

 

Beispiel : COMPARE_A_NO_OUTPUT , COMPARE_A_PWM NO_OUTPUT

 

CONFIGURATION ist optional. Wenn man configuration=mysetting hinzufügt dann kann man beim Start des Timers benutzen: START TIMER0 , mysetting

Wenn man mehrere Settings hat dann kann man den Timer mit diesen Settings starten.

 

 

Example


'-----------------------------------------------------------------------------------------
'name : timer1.bas
'copyright : (c) 1995-2005, MCS Electronics
'purpose : show using Timer1
'micro : 90S8515
'suited for demo : yes
'commercial addon needed : no
'-----------------------------------------------------------------------------------------
 
$regfile = "8515def.dat" ' specify the used micro
$crystal = 4000000 ' used crystal frequency
$baud = 19200 ' use baud rate
$hwstack = 32 ' default use 32 for the hardware stack
$swstack = 10 ' default use 10 for the SW stack
$framesize = 40 ' default use 40 for the frame space
 
 
Dim W As Word
 
'The TIMER1 is a versatile 16 bit TIMER.
'This example shows how to configure the TIMER
 
'First like TIMER0 , it can be set to act as a TIMER or COUNTER
'Lets configure it as a TIMER that means that it will count and that
'the input is provided by the internal clock.
'The internal clock can be divided by 1,8,64,256 or 1024
Config Timer1 = Timer , Prescale = 1024
 
 
'You can read or write to the timer with the COUNTER1 or TIMER1 variable
W = Timer1
Timer1 = W
 
 
'To use it as a COUNTER, you can choose on which edge it is trigereed
Config Timer1 = Counter , Edge = Falling
'Config Timer1 = Counter , Edge = Rising
 
'Also you can choose to capture the TIMER registers to the INPUT CAPTURE registers
'With the CAPTURE EDGE = , you can specify to capture on the falling or rising edge of
'pin ICP
Config Timer1 = Counter , Edge = Falling , Capture_Edge = Falling
'Config Timer1 = Counter , Edge = Falling , Capture Edge = Rising
 
'To allow noise canceling you can also provide :
Config Timer1 = Counter , Edge = Falling , Capture_Edge = Falling , Noise_Cancel = 1
 
'to read the input capture register :
W = Capture1
'to write to the capture register :
Capture1 = W
 
 
 
 
 
'The TIMER also has two compare registers A and B
'When the timer value matches a compare register, an action can be performed
Config Timer1 = Counter , Edge = Falling , Compare_A = Set , Compare_B = Toggle , Clear_Timer = 1
'SET , will set the OC1X pin
'CLEAR, will clear the OC1X pin
'TOGGLE, will toggle the OC1X pin
'DISCONNECT, will disconnect the TIMER from output pin OC1X
'CLEAR TIMER will clear the timer on a compare A match
 
'To read write the compare registers, you can use the COMPARE1A and COMPARE1B variables
Compare1a = W
W = Compare1a
 
 
'And the TIMER can be used in PWM mode
'You have the choice between 8,9 or 10 bit PWM mode
'Also you can specify if the counter must count UP or down after a match
'to the compare registers
'Note that there are two compare registers A and B
Config Timer1 = Pwm , Pwm = 8 , Compare_A_Pwm = Clear_Up , Compare_B_Pwm = Clear_Down , Prescale = 1
 
'to set the PWM registers, just assign a value to the compare A and B registers
Compare1a = 100
Compare1b = 200
 
'Or for better reading :
Pwm1a = 100
Pwm1b = 200
End

Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language