hy zusammen,

ich habe da ein kleines problem, weil ich die funktionen GETRC5 und SERVO im gleichen programm verwenden möchte. diese benutzen ja denselben Timer interrupt 0. gibt es eine möglichkeit z.b. für GETRC5 den Timer 1 zu verwenden? eine idee wäre das pwm für den servo softwaremässig zu programmieren, aber vielleicht gehts ja auch eleganter...

mfg
stefan

Code:
$regfile = "m8def.dat"
$crystal = 3686400

Config Lcdpin = Pin , Db4 = Portd.4 , Db5 = Portd.5 , Db6 = Portd.6 , Db7 = Portd.7 , E = Portd.3 , Rs = Portd.2
Config Lcd = 16 * 2
Config Portd = Output

Dim Pulsweite As Single

Pulsweite = 100

Ddrb = &B00100000
Portb = &B00010000

'Config Servos = 1 , Servo1 = Portb.5 , Reload = 100


Enable Interrupts

Config Rc5 = Pinb.4


Dim Address As Byte , Command As Byte
Dim Flag As Bit

Flag = 1

Cls
Cursor Off
Lcd "Servo Pulsweite"
Locate 2 , 1
Lcd Pulsweite ; "     "

Do

Getrc5(address , Command)

If Address <> 255 Then
   Reset Command.7
   Select Case Command
   Case 1 : If Pulsweite = 100 Then
         Pulsweite = 100
      Else
         Pulsweite = Pulsweite + 0.5
         Locate 2 , 1
         Lcd Pulsweite ; "     "
      End If
   Case 2 : If Pulsweite = 20 Then
         Pulsweite = 20
      Else
         Pulsweite = Pulsweite - 0.5
         Locate 2 , 1
         Lcd Pulsweite ; "     "
      End If
End Select


End If

'Servo(1) = Pulsweite

Loop
End