Hallo ,
Ich bin Anfänger in Bascom.
Ich habe ein RNControl v1.4 mit dem Chip ATmega32.
Ich beschäftige mich mit Servomotor und PMW Signal.
Mein Problem war:
Ich will meinen Motor nach 50 Pülse bleibenstehen.
Unten ist der Code
Code:
$programmer = 13
$crystal = 16000000
$baud = 9600
$regfile = "m32def.dat"
Config Int0 = Falling
Dim Zaehlerirq0 As Integer
Zaehlerirq0 = 0
Enable Interrupts
Enable Int0
On Int0 Irq0
Config Timer1 = Pwm , Pwm = 8 , Compare B Pwm = Clear Down
Pwm1b = 0
Tccr1b = Tccr1b Or &H02
Config Pinc.6 = Output
Config Pinc.7 = Output
Config Pind.4 = Output
Portc.6 = 0
Portc.7 = 0
'Hauptprogramm
Do
Portc.6 = 1
Portc.7 = 0
Portd.4 = 1
Pwm1b = 80
Print Zaehlerirq0
Waitms 500
Loop Until Zaehlerirq0 > 50
End
Irq0:
Incr Zaehlerirq0
Return
Der Motor läuft ewig.Ausserdem hab ich in Terminalemulator erkannt ,dass
die Zaehlerirq0 zählt nicht.
Was habe ich falsch gemacht?
Könntet ihr mir helfen?
Vielen Dank!
MFG.