1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

15 Channel RGB (45 LED) Color Wave Using PIC16F628A

Discussion in 'Microcontrollers' started by Chipwizard, Jun 15, 2011.

  1. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    Very well said colin.

    Do keep in mind though that real world impedance especially for pulsed output pins (the FET failure is from overheating) is quiet flexible with proper derating.

    Pommie, you should look up what 'clamp current' means it's nothing more than the output current that is specified for an I/O line set in a state to be READ in a certain state.

    Meaning that an I/O line on a PIC set to an output and high will READ low (voltage only) if the output current is higher than 20ma, this has NOTHING whatsoever to do with the intrinsic FETS current ability, it can supply far beyond the clamp current.

    I have advocated this VERY same technique on at least three other threads for determining the short circuit or error states of I/O lines. Because if an I/O line is set to output/high and it's reading low on it's logic state, or it's output is set to low and reading high something is obviously wrong or out of spec with the external circuit!
     
    Last edited: Jul 13, 2011
  2. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,161
    Likes:
    340
    Location:
    Brisbane Australia
    I have attempted to look this up without success. Do you have a link? I'm fully aware of the RMW problem and the later chips which don't list an output clamp current still have the problem.

    Edit, I'm also wondering why Microchip would use such a well understood term if it was something else they meant.

    Mike.
     
    Last edited: Jul 13, 2011
  3. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    Pommie, read the notes on the PDF you linked to me for statements of clamp current. 20ma clamp current ONLY MEANS that with the output is 20ma, that the logic high output can be read as logic LOW from the INTERNAL LOGIC, this AGAIN, has NOTHING to do with the absolute output current of the drivers... You're drawing conclusions from datsheets that are not derived from the real world.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,161
    Likes:
    340
    Location:
    Brisbane Australia

    I haven't posted any links. If you are referring to the data sheet then "read the notes" of a 178 page document isn't very helpful. Can you tell me where you found the explanation of output clamp current? Document and page number would be nice.

    Mike.
     
  6. Chipwizard

    Chipwizard New Member

    Joined:
    Dec 14, 2009
    Messages:
    146
    Likes:
    0
    Location:
    Florida, US
    I was under the impression that pic16f628a has an internal over current shutdown feature like many other chips(obviously it does not). I agree that internally circuitry is not limiting the individual I/O currents and allows for more that 25ma per pin. However I agree with Pommie that combined ports current draw of the chip per datasheet and real life is 200ma. I have push the chip to this limit and beyond. At 225ma current the chip got hot and after a long time driving the chip in this condition the chip failed. This caused the chip to act unpredictable, some I/O's would not come on any more and the chip was running hot after the current was reduced. This tells me that over current will do permanent damage to this chip. In case of this project I pushed all LED's in full white (RGB) on all channels without modulating them and chip got very hot and failed after two days of non-stop use. (9x25ma = 225ma total ports) I would think the results will be different from chip to chip depending on manufacturing tolerances. However the fact remains that the chip should not be over-driven like that.
     
  7. Chipwizard

    Chipwizard New Member

    Joined:
    Dec 14, 2009
    Messages:
    146
    Likes:
    0
    Location:
    Florida, US
    The million dollar question I have for Michrochip Corp is why would they design a 15 I/O device and not allow 25mA current thru all pins (15x25 =375 mA total device current)? After all these chips were designed to act as a TTL with 5v, 20-25mA outputs to drive LED's and other TTL devices!
     
  8. colin55

    colin55 Well-Known Member

    Joined:
    Feb 14, 2009
    Messages:
    3,534
    Likes:
    82
    Location:
    Melbourne Australia
    The reason why the chip got hot and failed is due to the current. If you draw 25mA, the output goes high and the loss across the FET is 0.025 x 50mV
    When you draw 33mA, the voltage across the FET is 500mV and the wattage is 12 times greater.
    By increasing the current-liming resistors slightly, the chip will run completely cold.
     
  9. Chipwizard

    Chipwizard New Member

    Joined:
    Dec 14, 2009
    Messages:
    146
    Likes:
    0
    Location:
    Florida, US
    Colins
    You missed my point. Overall and total current draw from the chip from all the ports combined (PortA + PortB) can not exceed 200mA. No matter what kind of external resistor you use, as long as you draw 25ma per pin and use more than 8 pins at a time, the chip will fail (25x8 = 200ma). This is not due to individual internal drive/sink FETs but rather limitation of internal supply bus lines feeding these FET's. This could have easily been cured in chip manufacturing by making internal supply buses thicker while leaving the FET's the way they are. This would also allow for full use of all 15 pins at the same time at 25ma each.

    I agree with you in regards to use of external resistors as I indicated in my earlier posts and these resistors are reflected in my shcematics and PCB. I also agree with you and thank you for your correction that those external resistors are essential and not optional given the limitation of PIC chip.

    In regards to your statement above, I respectfully disagree. If the FETs used are shottky devices, the voltage across the FET will remain the same while you increase the current. Increaing the current will widen the internal channel of the FET allowing more current to flow thru by reducing internal resistance. There is a limit of how much current passes thru this widened channel (Full saturation) and increasing the current beyond FET's ability to pass it thru will overheat the FET and will cause burnout. In regards to your calculation, increasing the current to 33mA will result in wattage (dissipation) of 0.033 x 50mv.

    During my testing I used 9 pins of the PIC and limited per pin current to 25mA, the chip still got hot and failed.

    Regards,
    Rom
     
    Last edited: Jul 14, 2011
  10. colin55

    colin55 Well-Known Member

    Joined:
    Feb 14, 2009
    Messages:
    3,534
    Likes:
    82
    Location:
    Melbourne Australia
    Have you ever measured the ouput voltage of a pin when the current is 25mA and 33mA.
    The voltage across a red LED is 1.7v The current through a 100R is about 33mA
    The voltage across a green LED is about 2.4v The current through a 68R is 38mA
     
  11. Chipwizard

    Chipwizard New Member

    Joined:
    Dec 14, 2009
    Messages:
    146
    Likes:
    0
    Location:
    Florida, US
    I do not have a scope to give you an accurate measurement. Given the pins and LED's are modulated the AC and DC characteristic might be different. Using a normal VU meter I got reading of 2V for red and 3.2v for green and blue. Output pin of PIC at full brightness of single color was at about 4.9v.

    You have to remember that I have intentionally over-driven the current to compensate for the duty cycle (20%). So what PIC and LED's are sensing while being modulated could be different than just applying a fixed DC voltage. Given all of that the PIC runs smoothly without any issues or heating up.
     
  12. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    Sorry about that Pommie I think I jumped the gun on my post a bit and read too much into it. I did however find out what clamp current means.
    http://www-k.ext.ti.com/SRVS/Data/ti/KnowledgeBases/logic/document/tutorial/iccc.htm

    So while my previous definition of clamp current was wrong it's still not related to I/O sink/source ability of the I/O line during normal operation, it only matter when considering over or under voltage conditions on the I/O line. Once again TI's appnotes are quiet informative.
     
  13. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    ChipWizard, I hate to burst your bubble, but no matter how many micro controller applications you see that directly drive an LED from an I/O line no micro controller is designed specifically to be an LED driver. A typical modern TTL load is very low, 1ma to 3ma I'd say is a good range, 20ma from a single I/O line would give you a worse case drive ability of 6 TTL devices per pin, or 66TTL devices total (assuming 200ma maximum chip current) and a best case of 20 per pin 200 per device at the 1ma load.

    That is GENEROUS current source/sinking if you ask me, so it's most definitely not a million dollar question. Microcontrollers will ALWAYS need external components for specific applications, all it takes is a single resistor and a transistor to turn the 20/200 ma limit into the multi amp range.
     
  14. Chipwizard

    Chipwizard New Member

    Joined:
    Dec 14, 2009
    Messages:
    146
    Likes:
    0
    Location:
    Florida, US
    Sceadwian, thank you for your input and opinion. I hate to dissapoint you but the original design of PIC was based on LED's decoding of 0 and 1. 70% of all applications I found are dedicated to LED's. The other major portion of the application are limited to motor control, LCD driving, alarm system, and simple data aquisition. If such devices are designed for most part as LED application why not think ahead of it's utilitarian application in LED. After all these devices are designed to be stand alone and doing one function and be good at it. They are very limited in programming space and data space.

    In regards to your comment about driving TTL devices as swithces, you need at least 4ma per external device (prefferably 8ma for adequate saturation). With that in mind they fall short of my expectation in delivering as a powerful device. But that is just my opinion. If it works for you then more power to you.

    To have a meaningful system of any sort you need a patch work of multiple devices. I prefer a more powerful device that can handle it all.
     
    Last edited: Jul 14, 2011
  15. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,642
    Likes:
    109
    Location:
    Michigan, USA
    If you've found evidence about the "original design of PIC", would you share it with us, please?

    Are you arguing that 70% of all applications are LED applications simply based on what you've found? Is there any empirical evidence to support that claim?
     
    Last edited: Jul 15, 2011
  16. Chipwizard

    Chipwizard New Member

    Joined:
    Dec 14, 2009
    Messages:
    146
    Likes:
    0
    Location:
    Florida, US
    Brief History of Microcontrollers:
    It all started in Summer of 1947 when a UFO crashed into a telephone pole in Area 51. Engineers were quick to notice the use of a small device onboard dangling with a few wires connected to some sort of light source.
    Between 1947 and 1970 design engineers had been scratching their heads trying to figure out the technology behind the device.
    In 1971 Michael Cochron and Gary Boone for the most part decoded the technology and came up with the first official microcontroller named TMS1000.
    In 1974 this device went commercial.
    In 1977 for the first time microcontrollers and LEDs were used in the famous movie Close Encounters of The Third Kind making attempt to communicate with UFO thru colored lights and LEDs. Although at the time it seemed insignificant, we were able to show galactical engineers that we are capable of communicating.
    In 1989 Microchip Corp (Formerly known as General Instrumental Microelectronics) in aid of galactical engineers were able to produce their first microcontroller in Delawre.
    Ever since we have made many attempts to communicate signals thru colored LED's with other intelligent beings to no avail. The closest we have ever come were visits by UFO on numerous occasions during which engineers recorded sounds of laughter thru their radio from UFO passing by.
     
    Last edited: Jul 15, 2011
  17. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,642
    Likes:
    109
    Location:
    Michigan, USA
    If you can't cite sources (APA or MLA method preferred), some people may feel you're providing opinions instead of facts. Your credibility may suffer when your opinions or arguments are perceived as;

    fal·la·cy/ˈfaləsē/Noun

    1. A mistaken belief, esp. one based on unsound argument.
    2. A failure in reasoning that renders an argument invalid.
     
    Last edited: Jul 16, 2011
  18. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    What do you mean LED's decoding 0 and 1, please quote your sources. If you can show me a document from a valid source that proves that Microchip started the entire PIC line in order to drive LED's from it's I/O lines I will mail you a 100 dollar bill fresh off the press.

    That's because you looked on the Internet, every jack wad in the universe starts out by blinking LED's on a micro controller, it's the easiest thing to do, it is NOT what they are designed to do, otherwise their outputs would be natively constant current controlled. PIC's are used in so many device. PIC's fill so many different applications that youre quote of 70% of all application are dedicated to LEDs is ABSURD. What you found has nothing to do with reality.

    I looked this up a bit more, and apparently we're both wrong. Standard TTL logic actually requires 16ma (low voltage only 8ma) Another reference to for that is this. However that is only for the 0 level logic output, input requires less than 2ma. It's no wonder to me now why many TTL device protocals use a native inverted logic. 16ma is a lot of current to be drawn holding a bus low, this may not be required to allow TTL functionality though, meaning it will probably work fine on the lower currents, however I'm a little confused about it, I can't find too much information which clarifies the details of the 16ma requirement.
     
    Last edited: Jul 15, 2011
  19. colin55

    colin55 Well-Known Member

    Joined:
    Feb 14, 2009
    Messages:
    3,534
    Likes:
    82
    Location:
    Melbourne Australia
    PIC's started in dongles.
     
  20. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
  21. edeca

    edeca Active Member

    Joined:
    Apr 8, 2008
    Messages:
    589
    Likes:
    38
    Location:
    England
    [​IMG]
     

Share This Page