Searching \ for '[PIC]: Simple PIC Frequency Counter' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/time.htm?key=count
Search entire site for: 'Simple PIC Frequency Counter'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Simple PIC Frequency Counter'
2004\02\04@132845 by Mccauley, Daniel H

flavicon
face
I currently have a circuit which uses a SN74LS628 Voltage Controlled
Oscillator (VCO) as a square wave generator.  I'd like to buffer the
output of this and
feed it back into a PIC to and calculate the frequency.  Frequency range
will be anywhere from about 50kHz to 500kHz.  PIC clock frequency could
be
somewhere around 4MHz to 20MHz.

Does anyone have a simple way to implement this with a PIC?

Thanks


--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

2004\02\04@155530 by Vincent Vega

picon face
Feed the output of your buffer to the timer/counter input of your
preferred PIC, count the amount of pulses in a fixed period of
time (gate time) and make the math. Take for instance your 500kHz, count
the incoming pulses for 1mS and you'll have a count of 500. Using
a 16-bit timer should be straight forward, for higher accuracy use
longer gating times. I have measure up to 3MHz in that way without
any extra counters. Check the external clock requirements for
the timer/counter input of the PIC of your choice.You'll find that
under the "electrical specifications" in the datasheet.
Best regards
VV


"Mccauley, Daniel H" <.....daniel.h.mccauleyKILLspamspam@spam@LMCO.COM> wrote:
{Quote hidden}

---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body

2004\02\05@052435 by Russell McMahon

face
flavicon
face
> > I currently have a .... square wave generator. I'd like to buffer the
> > output of this and feed it back into a PIC to and calculate the
> > frequency.

There was a clever frequency counter design around a few years ago which
specs and program are probably still available for, but you could do it
yourself. ?Original? was Popular Electronics, November  1994 around page 34.

Ah - plot thickens.
Terry J Wheeder 1993

ported to 16F84 by Peter Cousens 1998 (his last post here was on 14th
January).
Program is WCT5.ASM

And Google says

       http://www.piclist.com/techref/piclist/weedfreq.htm

On James's own PICLIST.COM site
Always search the archives first :-)


Original was from http://www.weedtech.com but there's no mention there now.


_________________________________


There are 2 tricks.

1.    The timer prescaler is faster than the PIC proper so 3 MHz is easy
indeed.

2.    Usually a prescaler outputs a half pulse for every N input pulses. At
the end of a sequence you may be part way through the prescaler rolling over
to the next output change and the part count adds inaccuracy to your result.

So - after the timing period the input signal is gated off and the prescaler
is fed with input signals BY THE PIC until it "rolls over" - you can thereby
determine how many counts were in the prescaler.








       RM

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu

2004\02\06@014349 by Anand Dhuru

flavicon
face
There is a nifty little instrument at
http://members.cox.net/berniekm/super.html ; very simple hardware too.

Besides a frequency counter, it has 15 other functions at the last count!
The only issue is its only 4 digits, might not be enough resolution for some
apps.

Regards,

Anand Dhuru

{Original Message removed}

2004\02\06@030429 by Jinx
face picon face
> There is a nifty little instrument

Yes, it is. Looks pretty handy

> http://members.cox.net/berniekm/super.html

> The only issue is its only 4 digits, might not be enough resolution
> for some apps

The author says it will do 8 digits -

"In the frequency counter mode, hitting button #1 switches the
display to the next 4 digits of the count.  For instance, the display
shows '12.57' for a frequency of 12,576 hz.  Holding down button
#1 shows '2576' - the lowest 4 digits.  If a decimal point shows,
the value is in Khz, if the decimal is flashing, the value is in Mhz.
Hence, a frequency of 42,345,678 hz is displayed as 42.34 with
a flashing decimal.  Holding down button #1 in this case will display
5678"

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@034037 by David P Harris

picon face
Should be quite easy to change to a LCD display for nicer interface.
David

Jinx wrote:

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@035113 by Dmitriy Fitisov

flavicon
face
I was not aware PIC16F870 limits output/input to 25 mA.
Any other device?

Dmitriy.

-----Original Message-----
From: pic microcontroller discussion list
[EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU]On Behalf Of David P Harris
Sent: February 6, 2004 3:39 AM
To: PICLISTspamspam_OUTMITVMA.MIT.EDU
Subject: Re: [PIC]: Simple PIC Frequency Counter


Should be quite easy to change to a LCD display for nicer interface.
David

Jinx wrote:

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@035529 by

picon face
Dmitriy Fitisov wrote :

> I was not aware PIC16F870 limits output/input to 25 mA.
> Any other device?
>
> Dmitriy.


Isn't that the most common limit on the PICs ?
Or did I misunderstand your question ?

Jan-Erik.


This communication is confidential and intended solely for the addressee(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify the sender by replying to this transmission and delete the message without disclosing it. Thank you.

E-mail including attachments is susceptible to data corruption, interruption, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@035738 by Rob Hamerling

flavicon
face
David P Harris wrote:
> Should be quite easy to change to a LCD display for nicer interface.
> David

There is already one in the PIClist archive, see:

http://www.piclist.com/techref/piclist/weedfreq.htm

Migration to a current PIC may not be that difficult

Regards, Rob.

--
Rob Hamerling, Vianen, NL phone +31-347-322822
homepage: http://www.robh.nl/

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@040606 by Dmitriy Fitisov

flavicon
face
I thought it does not have any special schematics inside to limit the
curent.
Max input/output current in my understanding is the current which shouuld be
allowed to flow by external schematic at max, but is not limited by the chip
itself
to this limit.

Dmitriy.

{Original Message removed}

2004\02\06@042511 by

picon face
Dmitriy Fitisov wrote :

> I thought it does not have any special schematics inside to
> limit the curent.
> Max input/output current in my understanding is the current
> which shouuld be allowed to flow by external schematic at max,
> but is not limited by the chip itself to this limit.
>
> Dmitriy.

OK, I see. That's how I understand things also.

I just browsed the data sheet, and I can not find anything
about some *active* current limiting from the PIC side.

Jan-Erik.


This communication is confidential and intended solely for the addressee(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify the sender by replying to this transmission and delete the message without disclosing it. Thank you.

E-mail including attachments is susceptible to data corruption, interruption, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@043131 by Russell McMahon

face
flavicon
face
> I thought it does not have any special schematics inside to limit the
> curent.
> Max input/output current in my understanding is the current which shouuld
be
> allowed to flow by external schematic at max, but is not limited by the
chip
> itself
> to this limit.

I ASSUME you are saying that you thought the PIC did not have any current
limit per pin and that nothing internal to the PIC limits current.

If so, then you need to read the PIC data sheets.
ALL processors have a maximum allowable current limit per pin and ALL
processors internally limit the current able to be drawn due to internal
circuitry.

Most PICs allow about 20 mA maximum per pin source or sink. Check the data
sheet for your PIC of interest to be sure. Above this guaranteed current
Microchip do not guarantee proper PIC operation AND you may damage the PIC.
See the data sheet maximum allowable values for damage limits. As well as
per-pin current limits there are also liable to be per port and per
processor maximum allowable currents.


       RM

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@044209 by Russell McMahon

face
flavicon
face
> Dmitriy Fitisov wrote :
>
> > I thought it does not have any special schematics inside to
> > limit the curent.
> > Max input/output current in my understanding is the current
> > which shouuld be allowed to flow by external schematic at max,
> > but is not limited by the chip itself to this limit.

> OK, I see. That's how I understand things also.
>
> I just browsed the data sheet, and I can not find anything
> about some *active* current limiting from the PIC side.

This is not completely correct.

OUTPUTS:    Data sheets often give values for the voltage at an output pin
for several sourced currents. You will find that for eg a low output, at
very low currents the voltage is approximately zero volts (as you'd expect)
and as current increases the guaranteed low voltage increases. This is due
to the drop across the effective resistance of the internal driver. While a
PIC will drive more current than the maximum allowed into a low (or zero)
impedance load a low output will then be well above zero and a high output
well below Vdd. Even at short circuit the current will probably not be more
than about double the maximum allowed current.ie the PIC does not limit the
output current at exactly the guaranteed maximum rating but it DOES limit it
to a value somewhat above that if you insist on violating its
specifications. .

Running the PIC in this mode may well be dangerous to its health.

INPUTS    PIC input currents, when the input voltages are within the
allowable input range (typically Gnd-0.2v < Vin < Vdd+0.2v) will very
largely be controlled by the PIC"input leakage current"s and is not a major
function of external circuitry.


       RM

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@045700 by Wouter van Ooijen

face picon face
> ALL processors internally limit the current able
> to be drawn due to internal circuitry.

I don't believe that is true. Could you convince me with a reference to
a paricular datasheet page?

And note that such an internal limit is of course only relevant (for
survival) if it falls within the 'allowable maxima', or (for normal
operation) if it falls within the other electrical specifications.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@045907 by Dmitriy Fitisov

flavicon
face
{Quote hidden}

it
>to a value somewhat above that if you insist on violating its
>specifications. .

>Running the PIC in this mode may well be dangerous to its health.

>INPUTS    PIC input currents, when the input voltages are within the
>allowable input range (typically Gnd-0.2v < Vin < Vdd+0.2v) will very
>largely be controlled by the PIC"input leakage current"s and is not a major
>function of external circuitry.

1. That's understandable that eventually there is a limit on current per
pin,
the point was it does not much max rating. If you see the link above in this
thread -
there is no limit resistors, "because current may be only 25 ma" in the
schema.

1. Sorry my mistake - I did not mean INPUT/OUTPUT mode, I meant IN/OUT
current in OUTPUT mode

       RM

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@051357 by Jake Anderson

flavicon
face
I think we have a mixup here
as i understand it.
there is no "current limiting" circutry in a pic.
there is a "limit" to the ammount of current that can be drawn safely, and
that is 20ma or so.

If there were current limiting circutry you could tie the outputs to ground
and drive them high all day long.
doing that is however a good way to splodificate ur pic.

when the OP said limit he meant that the pic has no current limiting
circutry within itself and it was the job of the outside stuff to make sure
it dosent excede the spec.

> {Original Message removed}

2004\02\06@052641 by Russell McMahon

face
flavicon
face
> > ALL processors internally limit the current able
> > to be drawn due to internal circuitry.

> I don't believe that is true. Could you convince me with a reference to
> a paricular datasheet page?

Yes :-) * (results given at end appear very surprising)

> And note that such an internal limit is of course only relevant (for
> survival) if it falls within the 'allowable maxima', or (for normal
> operation) if it falls within the other electrical specifications.

I largely agree and wasn't meaning to suggest otherwise.
The comments were aimed not at experts, but at taking a step towards
educating people who seemed to believe that the PIC was a semi infinite
current source rather than a strictly limited one.

* As I know you know, all microprocessor output drivers are non ideal
switches and have an effective resistance. This necessarily limits maximum
available current. In practice this is far from linear and they often pretty
much refuse to supply more than a few times more than the maximum rated
operating current.

For chapter and verse on this (not for Wouter's edification but for other
people's)
(Although, the results I have just found are surprising and suggest that the
PIC may in fact self limit its output current for Vout high with pin shorted
to ground to below its guaranteed max safe (non operating) value !

16F87X:

BACKGROUND:

Absolute maximum ratings

25 mA source sink abs max allowed
300 mA Vss
250 mA Vdd
Max source or sink all 3 ports A B E 200 mA
Max C D combined 200 mA

PORT PINS

Vout-low Vdd=4.5v, Iout = 8.5 mA = 0.6V
SUGGESTS Reffective = 0.6/.0085 = 70 ohms.
Or Isc = 5/70 =~~~ 70 mA with 5v connected to a low output pin.
In practice it will be less.

For a high output
Vout = Vdd-0.7v at 3 mA at Vdd = 4.5v
THIS SHOWS CURRENT LIMITING IN ACTION.
The Reffective here is unlikely to DECREASE as current increases.
Reffective = 0.7/.003 =~~ 230 ohms
Giving Isc = ~~~ 21 mA !!!!!!!!!!!!
This is truly a pathetic drive level, if true.

The above is for 16F873/4/6/7 -04 & -20 commercial industrial over relevant
temperature ranges.

A quick glance doesn't reveal guaranteed max OPERATING Iout and the pathetic
3 mA / Vdd-0.7 V for Vout high is so far away from the 25 mA max damage
limit that it may indeed be possible to short the high output pin to ground
and STILL not exceed the damage spec. There is no apparent guaranteed
operating output current spec apart from the wimpy one above.

Someone by all means please read data sheet in more detail and prove me
wrong. (PDF skimming is not the ideal way to gather good data but I don't
want to print this datasheet at present.



RM

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@053512 by Russell McMahon

face
flavicon
face
> I think we have a mixup here
> as i understand it.
> there is no "current limiting" circutry in a pic.
> there is a "limit" to the ammount of current that can be drawn safely, and
> that is 20ma or so.
>
> If there were current limiting circutry you could tie the outputs to
ground
> and drive them high all day long.
> doing that is however a good way to splodificate ur pic.

I think we're all on about the same wavelength.
However, see my post just before this one.
There is SOME current limiting - the question is, is it enough to keep you
within abs max limits. I would have said no. However, it APPEARS that with a
16F87x you may be able to short a high output pin to ground and not exceed
spec. It would be interesting to know how low (while not below ground) in
fact you have to pull a 16F87X high output before you get 25 mA (if ever)


       RM

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@075929 by Wouter van Ooijen

face picon face
> A quick glance doesn't reveal guaranteed max OPERATING Iout
> and the pathetic
> 3 mA / Vdd-0.7 V for Vout high is so far away from the 25 mA
> max damage
> limit that it may indeed be possible to short the high output
> pin to ground
> and STILL not exceed the damage spec. There is no apparent guaranteed
> operating output current spec apart from the wimpy one above.

But there is also no guaranteed upper limit on the current, so without
external current limit you will be outside the specs. This of course
does not guarantee that there will be any trouble, it is just that:
outside the specs. Just like overclocking, current through the
protection diodes, and numerous other abuses which you must avoid for a
guaranteed working design, or might apply as a design optimisation at
the expense of some (unspecified amount of) uncertainty.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@082248 by Olin Lathrop

face picon face
Russell McMahon wrote:
> ALL processors have a maximum allowable current limit per pin and ALL
> processors internally limit the current able to be drawn due to
> internal circuitry.

Right, but I think the point was that PICs don't contain deliberate current
limit circuitry that keeps the pin current within the absolute maximum
ratings of the data sheet.  The current is only limited as an artifact of
the circuitry, and is never supposed to get that high.  In other words, it
is up to the external circuitry to make sure the maximum pin current is not
exceeded.

If you tie a PIC pin to Vdd then drive it low, the current will be finite
due to the limitations of the FET, but will most likely exceed the maximum
rating and cause damage.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@084328 by Jack Smith

picon face
>Right, but I think the point was that PICs don't contain deliberate current
>limit circuitry that keeps the pin current within the absolute maximum
>ratings of the data sheet.  The current is only limited as an artifact of
>the circuitry, and is never supposed to get that high.  In other words, it
>is up to the external circuitry to make sure the maximum pin current is not
>exceeded.

A few months ago, I measured the E/I characteristics for a 16F877 pin in
output mode.
The manual does not say that current limiting is applied, but the E versus
I plot looks like it has current limiting when sourcing
current. Into a short circuit, I measured a maximum of 28mA with a
distinct break point the E/I slope around 18mA. In the range 0...18mA, the
pin
looks like 80 ohms R in series with an ideal 5V supply. When you get to
28mAm,
the equivalent series R looks like about 700 ohms.


I certainly agree that it's not good practice to source current into a
short circuit.

>If you tie a PIC pin to Vdd then drive it low, the current will be finite
>due to the limitations of the FET, but will most likely exceed the maximum
>rating and cause damage.

The E/I plot for a PIC pin driven low looks exactly like a 30 ohm resistor,
up to 30mA. At that point, I finished taking data points. But the plot is
exceedingly linear over the range 0...30mA. If you applied 5V to it, you
would
see 167mA, assuming the equivalent series R stays at 30 ohms, way over the
maximum safe current.


Jack Smith

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@101305 by Herbert Graf

flavicon
face
> I was not aware PIC16F870 limits output/input to 25 mA.
> Any other device?
>
> Dmitriy.

       That is a limit of pretty much all PICs. TTYL

----------------------------------
Herbert's PIC Stuff:
http://repatch.dyndns.org:8383/pic_stuff/

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@101309 by Herbert Graf

flavicon
face
> I thought it does not have any special schematics inside to limit the
> curent.
> Max input/output current in my understanding is the current which
> shouuld be
> allowed to flow by external schematic at max, but is not limited
> by the chip
> itself
> to this limit.
>
> Dmitriy.

       The max allowable current per PIC pin is 25mA, but you are correct, there
is nothing in the PIC that limits it to that current it is very easy to
sink/source more current,, but since you are then operating out of spec the
results are not guaranteed.

       Where did you here that PICs limit the current to what is "safe"? TTYL

----------------------------------
Herbert's PIC Stuff:
http://repatch.dyndns.org:8383/pic_stuff/

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@102508 by User DmitriyDmitriy Fitisov

flavicon
face
>> I thought it does not have any special schematics inside to limit the
>> curent.
>> Max input/output current in my understanding is the current which
>> shouuld be
>> allowed to flow by external schematic at max, but is not limited by
>> the chip
>> itself
>> to this limit.
>>
>> Dmitriy.
>
>         The max allowable current per PIC pin is 25mA, but you are
> correct, there
> is nothing in the PIC that limits it to that current it is very easy to
> sink/source more current,, but since you are then operating out of spec
> the results are not guaranteed.
>
>         Where did you here that PICs limit the current to what is
> "safe"? TTYL

"Usually, separate resistors need to be used in series with each segment
drive in order to evenly drive the display.   The PIC chip, however,
limits the current flow to about 25 ma per line."

http://members.cox.net/berniekm/super.html



> ----------------------------------
> Herbert's PIC Stuff:
> http://repatch.dyndns.org:8383/pic_stuff/
>
> --
> http://www.piclist.com hint: PICList Posts must start with ONE topic:
> [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@110529 by M. Adam Davis

flavicon
face
It doesn't 'limit' so much as it 'overheats' with an increase in
resistance due to the overheating, which does indeed limit the current.
This is not a 'feature' but a side effect of using CMOS.

Not recommended for production work.

In this case, the pulses to the LED are so short that the overcurrent
probably doesn't overheat the PIC, and I'm sure that much more than 25mA
is being delivered to the displays.  Makes for a bright display.  Will
probably last forever.  Still wouldn't trust it for more than a few one
offs.

-Adam

Dmitriy Fitisov wrote:

>I was not aware PIC16F870 limits output/input to 25 mA.
>Any other device?
>
>Dmitriy.
>
>{Original Message removed}

2004\02\06@141121 by Herbert Graf

flavicon
face
> >         The max allowable current per PIC pin is 25mA, but you are
> > correct, there
> > is nothing in the PIC that limits it to that current it is very easy to
> > sink/source more current,, but since you are then operating out of spec
> > the results are not guaranteed.
> >
> >         Where did you here that PICs limit the current to what is
> > "safe"? TTYL
>
> "Usually, separate resistors need to be used in series with each segment
> drive in order to evenly drive the display.   The PIC chip, however,
> limits the current flow to about 25 ma per line."
>
> http://members.cox.net/berniekm/super.html

       Wow, well, that's another example of why you can't trust everything you see
on the web. While, in that particular case, with that particular PIC, from
that particular batch, at that particular temperature, it may appear to be
limited to 25mA, this is NOT something you can trust. TTYL

----------------------------------
Herbert's PIC Stuff:
http://repatch.dyndns.org:8383/pic_stuff/

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@182847 by William Chops Westfield

face picon face
On Friday, Feb 6, 2004, at 05:42 US/Pacific, Jack Smith wrote:

> A few months ago, I measured the E/I characteristics for a 16F877 pin
> in
> output mode.

Real data.  Cool.

{Quote hidden}

MOS transistors are inherently current limitting, aren't they?
(Although
as everyone else has pointed out, not necessarily to current levels
that aren't damaging overall.)

In the case of this particular circuit, there is an LED between a
PIC pin sourcing current, and a pin sinking current.  Using your
data, that's "about" 120ohms equivalent series resistance, and about
3V, for ... 25mA.  Pretty neat.  And it's multiplexed 32:1 so "average
current" is much lower.  I don't think PICs have a separate spec for
pulsed current, but it makes me feel more comfortable...

BillW

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@183508 by William Chops Westfield

face picon face
On Friday, Feb 6, 2004, at 11:09 US/Pacific, Herbert Graf wrote:

>> [quoting from the "superprobe" project description]
>> "Usually, separate resistors need to be used in series with each
>> segment
>> drive in order to evenly drive the display.   The PIC chip, however,
>> limits the current flow to about 25 ma per line."
>>
Ouch.  OTOH, it's a often-recurring questions just how "ok" it is to
drive
an LED directly from a PIC pin (without a current limiting resistor.)
It's not a good idea according to the data sheets, but it's pretty
common,
even in the ap-notes that microchip publishes.  In this case, the PIC is
both the source and sink for the current, the LED imposes a substantial
voltage drop, and the pins are multiplexed, so it's probably safer all
around than many circuits.

For non-power circuits, the absolute max pin current ratings might be
the point at which the pin voltage no longer meets THAT spec, rather
than a power dissipation/damage sort of thing.  I'm not sure whether
the PIC qualifies as a "non-power" circuit here, though; relatively
high current drivers ARE a touted and valuable feature of PICs.

It IS a near project, though.  Four resistors more and it would have
been entirely unobjectionable.  In this area, anyway...

BillW

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\02\06@185204 by Olin Lathrop

face picon face
William Chops Westfield wrote:
> In the case of this particular circuit, there is an LED between a
> PIC pin sourcing current, and a pin sinking current.  Using your
> data, that's "about" 120ohms equivalent series resistance, and about
> 3V, for ... 25mA.

For that PIC at that temperature.  This is not something specified by
Microchip and could vary widely from PIC to PIC.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

More... (looser matching)
- Last day of these posts
- In 2004 , 2005 only
- Today
- New search...