LED "capacitance" won't get lower


Results 1 to 17 of 17

Threaded View

  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938

    Unhappy LED "capacitance" won't get lower

    Hello,

    I've been reading some threads about the LED's capacity feature and that they can be used as "sensors".

    Now, I made a short program where I involve 3 LEDs to be discharged and measured in time like this:
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1583&stc=1&d=117804885 4">

    The shema is simple: one port connected to all Anodes (through a 330 ohms resistor) and three ports connected each to one Kathode. I use a 16F88 @ 20MHz.

    I reduced the code as much as I could and here it is:
    Code:
    LOOP:
        for Counter = 1 to 3                                                 
            PORTB.0 = 0 : PORTB.0(counter) = 1 'reverse power to the LED to "charge" it
            TRISB.0(counter) = 1               'make the last HIGH port an Input and...
            while PORTB.0(counter) = 1         '...read it. As long as port is 1, increment "Discharge"
                discharge = discharge + 1
            wend
            discharge(counter) = discharge     'store Discharge's value for later comparision
            discharge = 0
        next
        gosub display
        TRISB = 0
        goto loop
    end
    I know I can reduce the overall process time by modifying the program but this is currently not the problem since I want to reduce the discharge time of each LED.

    I thought I would be able to lower the LED's capacitance by reducing the voltage applied to it. So I put a 10K instead of the 330ohms one.

    I even added a 10Mohms resistor in parallel with the LED to make a kind of load.

    Result: no change(!?). The time values never change.

    What am I doing wrong here? Should I use a 40MHz PIC instead?
    Attached Images Attached Images  
    Roger

Similar Threads

  1. Single digit 7 Seg LED clock - PIC16F88
    By thirsty in forum Code Examples
    Replies: 4
    Last Post: - 17th July 2009, 08:42
  2. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 20:19
  3. For next loop using: Led var Byte
    By quester in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th March 2008, 10:16
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. can't even flash an LED
    By bruno333 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 28th April 2005, 13:27

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