Can I combine outputs for more current?


Closed Thread
Results 1 to 4 of 4
  1. #1
    jswayze's Avatar
    jswayze Guest

    Default Can I combine outputs for more current?

    I'm trying to power an "ultrabright" LED with a PIC12F629. Each PIC output is rated at 25ma, and the LED lights up just fine. However, I have an LED that requires about 45ma, and it's fairly dim on just one output. To solve this, I figured I could take another PIC output and tie it together with the first one. You get 5v out and twice the current.

    Here's what happens:
    With the first output connected to the LED and powering it, I attached a lead from the second output to the LED. The brightness increased and all was well.
    Next, my program shut off the LED then turned it back on again. This time, nothing. I measured 0 volts at the combined output. If I took one output away I'd get my 5v again and the LED would light.

    It seems that while the LED is on, if you add the additional output everything is OK, but if you turn it off and back on again, something happens to wipe out the voltage.

    With my feeble brain and minimal experience I thought that maybe the current from one output was being diverted into the other output and somehow canceling them. I thought that a diode might do the trick, but I don't have one (will go to Radio Shack tomorrow and try)

    Is it obvious what's happening here? I'm sure I'm violating some basic rule of electrical design, I just don't know what it is.

    Thanks!

    Jeff

  2. #2
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Default

    I have used multiple outputs to run small motors up to 200mA(The maximum chip rating) with little problem. Let's see your code for turning the LED on, and, how are you limiting the current through the LED?

    You do know that it would be better to run the LED with a transistor capable of the total current than a couple of pins from the PIC.

    Try turning the port pins on as a whole. As in... PORTA = %000011, as opposed to individual pin switching. Also keep in mind, the PIC would rather pull to ground, than to B+.

    Hope this helps,
    Ron

  3. #3
    jswayze's Avatar
    jswayze Guest


    Did you find this post helpful? Yes | No

    Default

    Here is my code for the whole program. Basically it switches two outputs based on the pulse width of two incoming signals.

    Code:
    ' ---------------------------------------------
    ' Define aliases to the LED ports
    ' ---------------------------------------------
    PWM1 var GPIO.0
    PWM2 var GPIO.1
    IO1A var GPIO.2
    IO1B var GPIO.5
    IO2 var GPIO.4
    
    
    PwmCount1 var byte               ' Count number of cycles for PWM1
    PwmCount2 var byte               ' Count number of cycles for PWM2
    
         INTCON.6=0                 ' Disable all unmasked Interrupts
         INTCON.7=0                 ' Disable Global Interrupts
         CMCON = 7
      
        '------------------------------
        ' Main program starts here
        '------------------------------
    
        input PWM1
        input pwm2
    output IO1A
    output IO1B
    output IO2
        
        pwmcount1 = 0            ' Initialize PWM counter variables
        pwmcount2 = 0       
    
    MAIN:  
    
    pulsin pwm1,1,PwmCount1
    PULSin pwm2,1,PwmCount2
    if Pwmcount1 > 140 then
       IO1A = 1
       IO1B = 1
       else
            IO1A = 0
            IO1B = 0
    endif
    
    if Pwmcount2 > 140 then
       IO2 = 1
       else
           IO2 = 0
    endif
                  
            goto MAIN   'endless loop
    
    END
    I will try switching IOA and IOB simultaneously and see if that works.

    Thanks,

    Jeff

  4. #4
    jswayze's Avatar
    jswayze Guest


    Did you find this post helpful? Yes | No

    Default

    Actuating the two output simultaneously seems to have done the trick. I used "GPIO = GPIO and %00100100" to turn them on and everything works as expected now.

    I have another general question regarding power switching, but I'll open a new thread. Thanks for the help!

    Jeff

Similar Threads

  1. Reducing PIC current to as low as possible...
    By FromTheCockpit in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th November 2009, 04:28
  2. Replies: 8
    Last Post: - 5th May 2009, 20:10
  3. current sensor interfacing
    By hell_pk in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th January 2009, 04:55
  4. 16F628A current high during sleep
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 9th October 2006, 10:21
  5. Current Meter
    By mikefox in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 18th September 2006, 06:15

Members who have read this thread : 1

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