🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: sci.electronics.components
Article #85

Re: Best way to power array of LEDs?

#85
From: Spehro Pefhany
Date: Fri, 06 Dec 2002 10:58
46 lines
3773 bytes
On Fri, 06 Dec 2002 08:41:57 +0000 (GMT), the renowned Tony Williams
<tonyw@ledelec.demon.co.uk> wrote:

>
> 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.

The RMW issue can be gotten around with software- 
avoid BCF/BSF to the port under conditions like that,
 since read-modify-write instructions use the values 
read from the port pins (NOT the latch). If you write 
the entire latch, the issue doesn't arise
(the values may in fact be read, but they are 
discarded). Sometimes it's convenient to maintain a 
shadow register, update that, then slap it out to 
the real port latch. 

By the way, the 18F series have an alternate PORTx 
address called LATx that uses latch values rather
than pin levels. 

> 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.

Hmm.. so the voltage  must have been high enough at 
the inputs to read as a "1", since most of the PIC
inputs are TTL levels, it doesn't take much. I'll bet
you wished you put a little transistor in there. ;-)
Must have been written as a series of BSFs.  

> Fortunately that 20mA could be gated-Off for a few uS.
> If that was done, then the original sequence worked
> correctly.

Hardware solutions work too. ;-) 

Best regards, 
Spehro Pefhany
-- 
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.co
Technical Details
Message-ID: <7nu0vukai3nr6l25rh99vjrlhgegbc519a@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!news-out.visi.com!hermes.visi.com!newsfeeds-atl2!news.webusenet.com!news03.bloor.is.net.cable.rogers.com!news04.bloor.is.net.cable.rogers.com.POSTED!not-for-mail
References: <KVdHjAAjM3w9Ew8l@jmwa.demon.co.uk> <aq17gb$7ut$1@reader1.panix.com> <slrnasg1o7.1t5.Znospam+noZs_0211@hpb13799Z.Zboi.hpZ.com.invalid> <aseln1$jbb$1@reader1.panix.com> <Rm2H9.4457$5P3.213056@newsfeed.slurp.net> <4dqpuugil5jens3iu7uprml0hdjl5e5dqs@4ax.com> <4ba01ef90etonyw@ledelec.demon.co.uk> <c9ruuu87bn6t539n1se6ejueb1u1lia0j6@4ax.com> <4ba0275featonyw@ledelec.demon.co.uk> <h48vuuordbt547u37tb38vpfivfqm2t0at@4ax.com> <4ba080045etonyw@ledelec.demon.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 112d1e,4ef4c9d4aea85e1f
X-Google-Attributes: gid112d1e,public
X-Google-Thread: 103407,4ef4c9d4aea85e1f
X-Google-Attributes: gid103407,public
X-Google-Thread: 1118be,4ef4c9d4aea85e1f
X-Google-Attributes: gid1118be,public
X-Google-Thread: 10d137,4ef4c9d4aea85e1f
X-Google-Attributes: gid10d137,public
X-Google-Thread: 1131b0,4ef4c9d4aea85e1f
X-Google-Attributes: gid1131b0,public
X-Google-ArrivalTime: 2002-12-06 02:58:37 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!news-out.visi.com!hermes.visi.com!newsfeeds-atl2!news.webusenet.com!news03.bloor.is.net.cable.rogers.com!news04.bloor.is.net.cable.rogers.com.POSTED!not-for-mail
From: Spehro Pefhany <speff@interlog.com>
Newsgroups: sci.electronics.components,sci.electronics.design,alt.engineering.electrical,aus.electronics,sci.electronics.repair
Subject: Re: Best way to power array of LEDs?
Organization: Rather
Message-ID: <7nu0vukai3nr6l25rh99vjrlhgegbc519a@4ax.com>
References: <KVdHjAAjM3w9Ew8l@jmwa.demon.co.uk> <aq17gb$7ut$1@reader1.panix.com> <slrnasg1o7.1t5.Znospam+noZs_0211@hpb13799Z.Zboi.hpZ.com.invalid> <aseln1$jbb$1@reader1.panix.com> <Rm2H9.4457$5P3.213056@newsfeed.slurp.net> <4dqpuugil5jens3iu7uprml0hdjl5e5dqs@4ax.com> <4ba01ef90etonyw@ledelec.demon.co.uk> <c9ruuu87bn6t539n1se6ejueb1u1lia0j6@4ax.com> <4ba0275featonyw@ledelec.demon.co.uk> <h48vuuordbt547u37tb38vpfivfqm2t0at@4ax.com> <4ba080045etonyw@ledelec.demon.co.uk>
X-Newsreader: Forte Agent 1.92/32.572
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 46
Date: Fri, 06 Dec 2002 10:58:35 GMT
NNTP-Posting-Host: 24.112.151.88
X-Complaints-To: abuse@rogers.com
X-Trace: news04.bloor.is.net.cable.rogers.com 1039172315 24.112.151.88 (Fri, 06 Dec 2002 05:58:35 EST)
NNTP-Posting-Date: Fri, 06 Dec 2002 05:58:35 EST