Hallo!

Ich habe mein H-Bridge aufgebaut wie mein Schaltplan.
Netzteil ist auf 9 V eingestellt. LED rot leuchtet mit 1 K Vorwiderstand normal hell.
Wenn ich PD0 auf high anlege, leuchtet LED noch bisschen dunkler. PD0 auf low, LED leuchtet wieder normal. Kurzschluß? Oder wurde er vom Motor geklaut?
Ansonsten dreht Motor sowohl vorwärts (PD0 auf high) als auch rückwärts (PD1 auf high).

Bauteile:
4x IRLZ34N
4x BC547
7805
Atmega8

Bild hier   Bild hier  

Code:
'************
'* H-Bridge *
'************

$regfile = "m8def.dat"
$crystal = 1000000
Ddrb = &B111111                                             'Ausgang

'Motor aus
Do
If Pind.0 = 0 And Pind.1 = 0 Then
Waitms 100
Portb.0 = 0
Portb.1 = 0
Portb.2 = 0
Portb.3 = 0
End If

'Vorwärts
If Pind.0 = 1 And Pind.1 = 0 Then
Waitms 100
Portb.0 = 1
Portb.1 = 0
Portb.2 = 1
Portb.3 = 0
End If

'Rückwärts
If Pind.0 = 0 And Pind.1 = 1 Then
Waitms 100
Portb.0 = 0
Portb.1 = 1
Portb.2 = 0
Portb.3 = 1
End If

'Motor aus
If Pind.0 = 1 And Pind.1 = 1 Then
Waitms 100
Portb.0 = 0
Portb.1 = 0
Portb.2 = 0
Portb.3 = 0
End If

Loop