16F628A using PORTA.4, and it works, but...


Closed Thread
Results 1 to 2 of 2
  1. #1
    zx81's Avatar
    zx81 Guest

    Default 16F628A using PORTA.4, and it works, but...

    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

  2. #2
    zx81's Avatar
    zx81 Guest


    Did you find this post helpful? Yes | No

    Default

    Well, It seems a speed problem. I'm using internal clock, and if I use RC4 as described, the program loose the ZZ switch, but if i lock the switch, it works ok.

    It's possible that the use of PORTA.4 speed down the PIC?

    The switch that fails is connected to PORTA.5 (MCLR pin), don't know if this is important.

    Regards
    Last edited by zx81; - 17th August 2005 at 08:50.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts