today i connected a steper motor drive circuit shown below, that will forward(RA0 switch), reverse(RA1 switch) and stop(RA2 switch) but i faced problems.
the program code is shown below.
TRISB=0
TRISA=255
start:
IF PORTA.0=0 Then Forwardmotor
IF PORTA.1=0 Then Reversemotor
IF PORTA.2=0 Then Stopmotor
GoTo start
Forwardmotor:
PORTB.0=1
Pause 100
PORTB.1=1
Pause 100
PORTB.2=1
Pause 100
PORTB.3=1
Pause 100
IF PORTA.0=0 Then Forwardmotor
GoTo start
Reversemotor:
PORTB.3=1
Pause 100
PORTB.2=1
Pause 100
PORTB.1=1
Pause 100
PORTB.0=1
Pause 100
IF PORTA.1=0 Then Reversemotor
GoTo start
Stopmotor:
PORTB.0=0
PORTB.1=0
PORTB.2=0
PORTB.3=0
IF PORTA.2=0 Then Stopmotor
GoTo start
i get this from a book but when it was connected, so many problems i faced.
(1)the output of 4050 hex buffer should be same as its inputs, that is, about 5V.but when i measure the output from the 4050, the outputs are only 1.3V only.i double check the connection but its correct.whats wrong with it?
(2)is it when i make a pin HIGH,the pin will continue HIGH until i make it LOW?it is becasue when i measure the output pin(when i try to make the motor forward and reverse), all the pins are at HIGH level.
(3)the circuit seems to draw more than 3A from the DC power supply.but the motor rating is only 2A.why?
hope someone can solve my wuestion