From: Tony Williams
Subject: Re: Best way to power array of LEDs?
Date: Fri, 06 Dec 2002 08:41:57 +0000 (GMT)
References: <7tGLdeAS6fn9EwBv@jmwa.demon.co.uk> <email@example.com> <firstname.lastname@example.org> <email@example.com>
NNTP-Posting-Date: Fri, 6 Dec 2002 08:45:45 +0000 (UTC)
User-Agent: Pluto/1.14i (RISC-OS/3.60)
In article ,
Spehro Pefhany wrote:
> On Thu, 05 Dec 2002 16:33:44 +0000 (GMT), the renowned Tony Williams
> > 20mA
> > +Supply---->----/\/\---+-----|>|---- 0v.
> > | LED
> > PIC port pin-----------+
> > Had this brilliant idea that could could turn
> > the LED On/Off by toggling the port pin from an
> > input, to an output at logic 0.
> Aside from the obvious worry if TRIS or PORT latches
> get flipped by noise, it should work, assuming
> +Supply <= Vdd + 0.3 (except for the funky open
> drain output w/o protection diodes that some of them
It's that warning in every PIC data sheet Speff.
An output pin that is driven to 0/1 must be allowed
to reach the correct 0/1 voltage. If not, undefined
things happen during subsequent writes to that o/p.
> Though I don't think Vout(low) is guaranteed at
> 20mA, it should be low enough even for a red LED,
> shouldn't it? (at least with the current crop)
*cough* To compound the perp I see that I actually
had 4x pins in parallel to short the LED to 0v.
In the original software, the sequence of "set port-
pins to logic 0, then set port-pins to outputs"
resulted in the pins being set to logic 1, the LED
lit up like a searchlight, with 130mA drawn off the 5v.
Fortunately that 20mA could be gated-Off for a few uS.
If that was done, then the original sequence worked