First, excuse my english, it's not too good...
I've a PCB with a 16F628A and a L293B (motor driver) and I want (need) to power the driver through a transistor, but I only have the RA4 free, so I'm using a BC516 (PNP) transistor connected to it.
This sequence turns the motor to the right until switch ZZ is activated:
low L293B 'this lows PORTA.4 and activate the BC516
low MOTOR_1
high MOTOR_2
LOOP:
if ZZ=0 then goto LOOP
and this to the left:
low L293B 'this lows PORTA.4 and activate the BC516
high MOTOR_1
low MOTOR_2
LOOP:
if ZZ=0 then goto LOOP
All this works ok, but here start the problems. While the motor is running it activate some switches (ZZ in the sample), I use this to know its position and when to stop it. When I activate the driver through the BC516, the pic apparently doesn't reads the switches, but if I connect the driver directly to VCC, all works ok.
I've tried with a pull-up in RA4, without, same problem.
Any idea?
Regards
Bookmarks