Hallo,

ich habe ein Problem.
Ich schaffe es irgendwie nicht, ein handelsübliches modellbauservo mit meinem Mega8 anzusteuern. In der Hilfe von BascomAVR steht, dass man das einfach mit dem Servo-befehl machen kann.
Aber wenn ich das Beispielprogramm ablaufen lasse, fährt das Servo nur auf vollen linksanschlag und bleibt dort (drückt gegen mech. Anschlag).
Ich habe auf einer anderen Site folgende beschreibung gefunden:

Bei einer Pulsweite von 1 Millisekunde dreht das Servo z.B. voll auf die eine Seite , bei 1,5 Millisekunden auf Mittelstellung und bei 2ms voll auf die andere Seite. Je nach Auflösung und Genauigkeit des PWM-Signals in diesem Bereich zwischen 1 und 2ms, kann somit jede Position zwischen den beiden Anschlägen angefahren werden.

Welche Werte muss ich denn für Reload und Servo(1) einstellen, um auf die benötigten Werte zu kommen ?

Das Beispielprogramm findet ihr unten.
Ich wäre für eine Hilfe sehr dankbar.

Ciao
Basti

--------------------------------------------------
' (c) 2001 MCS Electronics
' servo.bas demonstrates the SERVO option
'---------------------------------------------------

'Servo's need a pulse in order to operate
'with the config statement CONFIG Servos we can specify how many servo's we
'will use and which port pins are used
'A maximum of 16 Servos might be used
'The SERVO statements use one byte for an interrupt counter and the TIMER0
'This means that you can not use TIMER0 anymore
'The reload value specifies the interval of the timer in uS
Config Servos = 2 , Servo1 = Portb.0 , Servo2 = Portb.1 , Reload = 10
'we use 2 Servos with 10 uS resolution

'we must configure the port pins used to act as output
Config Portb = Output

'finally we must turn on the global interrupt
Enable Interrupts

'the servo() array is created automatic. You can used it to set the
'time the servo must be on
Servo(1) = 100 '1000 uS on
Servo(2) = 200 ' 2000 uS on


Dim I As Byte
Do
For I = 0 To 100
Servo(1) = I
Waitms 1000
Next

For I = 200 To 0 Step -1
Servo(1) = I
Waitms 1000
Next
Loop
End