jojo das mit dem auf 0 setzten habe ich ... (nur vergessen zu posten)

zum cycle:
emm ich möchte das das deingen 100us AN macht und dann nach 100us AUS...

aber wieso sollte das signal bei 557us liegen, wenn ich das so mache?

will damit nen fahrtenregler ansprechen...

ich poste einfach mal das komplette dingen...
Code:
 $regfile = "2313def.dat"
 $crystal = 3686400
 $baud = 9600

 Ddrb.2 = 1                                                 'X
 Ddrb.3 = 1                                                 'Y
 Ddrb.4 = 1                                                 'Z

 Portb.2 = 0
 Portb.3 = 0
 Portb.4 = 0

 Xport Alias Portb.2
 Yport Alias Portb.3
 Zport Alias Portb.4


 Dim Tcounter As Byte

 Dim Xcounter As Byte
 Dim Ycounter As Byte
 Dim Zcounter As Byte

 Dim Ximpulse As Byte
 Dim Yimpulse As Byte
 Dim Zimpulse As Byte
 Dim Intervallength As Byte

 Tcounter = 0

 Xcounter = 0
 Ycounter = 0
 Zcounter = 0

 Ximpulse = 10                                              '=>1000usek
 Yimpulse = 10                                              '=>1000usek
 Zimpulse = 10                                              '=>1000usek
 Intervallength = 20                                        '=>2000usek

 On Timer0 Ontimer0
 Config Timer0 = Timer , Prescale = 8                       'Takt: Quarz/8 => 460800 => Tick alle 2.17usek

 Enable Timer0
 Enable Interrupts                                          'Interrupts global



'Hauptprogramm
 Do
 Loop

 End

'Ontimer0
 Ontimer0:
   Tcounter = Tcounter + 1
   If Tcounter = 46 Then                                    ' Tick alle 100usek
     Xcounter = Xcounter + 1
     Ycounter = Ycounter + 1
     Zcounter = Zcounter + 1

     If Xcounter <= Ximpulse Then
       Xport = 1
     End If
     If Xcounter > Ximpulse Then
       Xport = 0
     End If
     If Xcounter = Intervallength Then
       Xcounter = 0
     End If

     If Ycounter <= Yimpulse Then
       Yport = 1
     End If
     If Ycounter > Yimpulse Then
       Yport = 0
     End If
     If Ycounter = Intervallength Then
       Ycounter = 0
     End If

     If Zcounter <= Zimpulse Then
       Zport = 1
     End If
     If Zcounter > Zimpulse Then
       Zport = 0
     End If
     If Zcounter = Intervallength Then
       Zcounter = 0
     End If

     Tcounter = 0
   End If
 Return
nach dem dingen sollte das signal 1000usek AN/1000usek AUS sein oder?
an meinem led sieht das aber eher nach 1sek AN/1sek AUS aus... (hab kein oziloskop womit ich das testen könnte...)