Hey leute ich hab jetzt mal nen bvisschen ausprobiert und es einigermaßen hinbekommen jetzt habe ich aber ein kleines Problem also die Pwm Geschwindigkeiten sind im EEProm abgelegt unter den Stellen 0-2. Die stelle ist am anfang auf 0 gesetzt. und wird durch ausführen des PCINT1 auf 1 Oder 2 gesetzt. Jetzt möchte ich beim Ausführen des Interrupts INT0 das Diese stellen wieder auf 0 Gesetzt werden und da habe ich ein problem undzwar tut es dies nicht . Die Varriable E dient aussschließslich dazu das nur ein Taster Betätigt werden kann.

Der Code
PHP-Code:
$regfile "m168def.dat"
$crystal 8000000


Config Pinc.0 
Input
Config Pinc.1 
Input
Config Pinc.2 
Input
Config Pinc.3 
Input
Config Pinc.4 
Input
Config Pinc.5 
Input
Config Pind.2 
Input


Config Pinb.1 
Output
Config Pinb.2 
Output
Config Pind.5 
Output
Config Pind.6 
Output

Motor1 Alias Pinb.1
Motor2 Alias Pinb.2
Motor3 Alias Pind.5
Motor4 Alias Pind.6
Freischalten Alias Pind.7

Pind.2 
1


Enable Interrupts

Enable Pcint1
Enable Int0

On Pcint1 Pwm1
On Int0 Pwm2

Pcmsk1 
= &B11111111
Config Int0 
Falling



Config Timer1 
Pwm Pwm Compare A Pwm Clear Up Compare B Pwm Clear Up Prescale 8
'Config Timer0 = Pwm , Prescale = 1 , Compare A Pwm = Clear Up , Compare B Pwm = Clear Up

$eeprom                                                     '
EEprom beschreiben

Label1
:
Data 128 192 64
$data

Dim M 
As Byte
Dim N 
As Byte
Dim X 
As Byte
Dim Y 
As Byte
Dim A 
As Byte
Dim B 
As Byte
Dim C 
As Byte
Dim D 
As Byte
Dim E 
As Byte



0
0
0
0
0



Do

   
Gedrueckt1:

   
Readeeprom A M                                         'Auslesen der Daten aus dem EEprom und anschließende Ausgabe
   Compare1b = A



   Freischalten = 1

Loop

Pwm1:

   If E = 1 Then

      Goto Gedrueckt1

   End If

   If Pinc.0 = 0 Then

      M = M + 2
      N = N + 2
      E = E + 1

   End If

   If Pinc.1 = 0 Then

      M = M + 1
      N = N + 1
      E = E + 1

   End If

   If Pinc.2 = 0 Then

      X = X + 2
      Y = Y + 1
      E = E + 1

   End If

   If Pinc.3 = 0 Then

      M = M + 2
      N = N + 1
      E = E + 1

   End If

   If Pinc.4 = 0 Then

      M = M + 61
      N = N + 2
      E = E + 1

   End If

   If Pinc.5 = 0 Then

      X = X + 1
      Y = Y + 2
      E = E + 1

   End If

Return

Pwm2:

      M = M * 0
      N = N * 0
      X = X * 0
      Y = Y * 0
      E = E - 1

Return

End