Exact match. Not showing close matches.
I don't understand why people trash AN521 so much. It simply shows a PIC
interfacing to line voltage. It does not advocate human contact with the PIC when line
There are plenty of electronic devices in your world that are line connected. Compact
fluorescent lights are electronic and line connected.
There are also methods to protect devices and humans if component failure
happens. Two resistors in series is a widely used and accepted practice.
Moving to a second topic, in the United States and in all countries I know of, a certain
amount of line current is allowed to flow through human beings. A VCR, for instance,
although isolated, has a resistor and capacitor from neutral to case. Neutral and hot
frequently get reversed, but the amount of current that would flow into a grounded
human when this happens is small, acceptable, and legal.
I'm all for safety, don't get me wrong. But if someone is building something that
controls line power, such as the triac control mentioned in AN521, he/she needs to
take precautions building it and fiddling around with it. It doesn't matter whether
there's a PIC in it or not. You don't need to stop designing it when you decide to put a
PIC in it.
Thirdly, as far as applying higher than supply voltages to inputs of a PIC, there are
PICs and there are PICs. The amount of current you inject, and what polarity it is, will
affect operation at different levels depending which PIC you choose. The 16C54
allows 500uA without affecting operation. As new PICs have been introduced, that
value has decreased but is still nonzero, especially if you are not using analog
features in the PIC.
I hope I have made this clear enough that readers will not think I am starting a flame
or religious war.
Chen Xiao Fan
>I'm all for safety, don't get me wrong. But if someone is building
>controls line power, such as the triac control mentioned in AN521, he/she
>take precautions building it and fiddling around with it. It doesn't matter
>there's a PIC in it or not. You don't need to stop designing it when you
decide to put a
>PIC in it.
But AN521 does not mention a word on safety. And the worst thing is that it
claims to be more reliable than previously published methods. This is
"This application note describes a simple method for
measuring parameters from the AC power line.
Parameters such as zero crossing, frequency, and
relative phase can be measured. This method is useful
for measurements on 50, 60, and 400 Hz power
systems with voltages up to several hundred volts. The
method requires only one external component, a
resistor, and is more reliable than previously published
methods using capacitors or bulky, expensive
> Thirdly, as far as applying higher than supply voltages to inputs of
> a PIC, there are
> PICs and there are PICs. The amount of current you inject, and what
> polarity it is, will
> affect operation at different levels depending which PIC you choose.
> The 16C54
> allows 500uA without affecting operation. As new PICs have been
> introduced, that
> value has decreased but is still nonzero, especially if you are not
> using analog
> features in the PIC.
Alas, the above statement re the 16C54 is incorrect.
What the data sheet does say is that:
1. Absolute maximum ratings are:
- Maximum clamp current into any pin out of the pins included in the
set [T0CK1] = 500 uA max.
- Maximum clamp current (for the IC presumably as it does not specify
by pin) = 20 mA.
There is NO guarantee of not affecting operation at these levels - it
just guarantees that the chop won't die.
2. Operating voltages for all input pins are
- A minimum of Vss.
- A maximum of Vdd.
The above data is not stated directly but needs to be inferred by a
careful reading of the operating section of the data.
Nowhere in the operating section does it mention taking any I/O pin
outside the Vss-Vdd range. [[I'll say "nowhere" to encourage people to
prove me wrong. I didn't see it in a reasonably careful but not
painstaking look, and I'm not surprised.
Nowhere does it state an acceptable current in the protection diodes
I hammer this pont again and again and again and ... over the years
- I have a bee in my bonnet :-)
- It's very important and most newcomers try to expand what the data
sheets say to areas where they don't apply. It's good to learn early
on what a data sheet does and doesn't say and the danger of
transferring statements from one section of a datasheet to another.
Flame shields u....<too late> :-)
Make my day.
Find areas where I'm wrong - they're sure to exist, even if the
general principle of what I'm saying is correct (as it is). By all
means pore over the datasheets and decide for yourself if they say
what I say they do.
A similar discussion in Microchip Forum.
The following is the answer is from J_doin, a very experienced
electronics engineer and a PIC expert.
RE: J_doin and company, What's the ... (in reply to xiaofan)
You are completely right, of course. This thread started with many
very clear statements against AN521.
In another thread, discussion of the infamous AN954 - resistive
transformerless supply triggered a host of warnings by forum members,
pointing out the various safety hazards and reliability issues that
both ApNotes failed to mention.
I agree that both ApNotes are incredibly misleading. A complete
reliability discussion should be included in the ApNotes, and resistor
failure modes should be analysed more carefully. Actually, in the
AN521 the author seems to have no knowledge of the concept of
reliability and failure analysis. I completely agree that it should be
removed from MCP site, along with AN954.
Unexperienced developers might risk their lives, and even design
hazardous equipment that can risk the end users' lives.
Hasan A. Khan
|This was not due to AN521 but, many many years back as
a begining electronics hobbyist I almost killed myself
while building a simple power supply. I forgot the
transformer was plug in and proceeded to cut the mains
leed with a pair of metal scissors. I was badly
jolted for a few moments by 220V and then I passed out
for a few minutes. When I woke up, I saw scissors
pattern burnt into my hand too. In all that
happenings I was all alone at home...luck to be alive.
I learnt a lesson for the rest of my life.
I actually did use AN521 but having been through above
experience there was no way I was going to play with
live circuits. So, I used my power supply
transformer's low voltage side (12VAC) and connected
it to 16F84A pin via 47K resistor. That worked fine
and I could detect zero crossing.
--- Xiaofan Chen <gmail.com> wrote: xiaofanc
> RE: J_doin and company, What's the ... (in reply to
> I completely agree that it should be
> removed from MCP site, along with AN954.
> Unexperienced developers might risk their lives, and even design
> hazardous equipment that can risk the end users' lives.
That's so ridiculous. Any design put into mass production will be
looked at by qualified people.
There are many more lives put at risk from the Microchip math
libraries than any of their schematics.
The key to whether AN521 was good or not is simple.
1. Imagine designing exactly as AN521 indicated.
2. Will it pass UL or CE norms?
3. If not, it's unacceptable.
Actually, AN521 COULD be made safe. But as it is, it
is an example of very poor engineering practice, and I
am continually amazed that MicroChip keeps it in their
Xiaofan Chen wrote:
Note: To protect our network,
attachments must be sent to
engineer.cotse.net . attach
On Wed, 26 Oct 2005, Bob Blick wrote:
> I don't understand why people trash AN521 so much. It simply shows a PIC
> interfacing to line voltage. It does not advocate human contact with the PIC when line
AN521 and other such schemes are dangerous because they ignore the
circuit capacitance and real life creepage on a board, plus there is no
warning wrt. power supply pumping and real world resistor limitations.
None of those circuits should be able to pass UL compliant testing wrt
injected (conducted) RFI.
I once posted a long explanation about this on the piclist. This item
should be a permanent fixture in piclist.com or somewhere like that (not
necessarily my explanation).
Do you expect Microchip to write your code for you? No, of course not. This is the
hardware equivalent. There's nothing wrong with what they describe in AN521. It
needs to be modified to suit your application, just like any example code they give. I
really don't see the difference. You can't just take their example code and slap
together a program if you don't know how to program. If you design something to
attach to AC, you need to understand what's required to make it work.
Microchip has had bad math routines on their site forever, why should they take
AN521 down and leave the bad code up?
AN521 is an application NOTE, not a full-blown reference design. At most, Microchip
should include a disclaimer as they did with AN954. But it should stay on their
website, the ideas it contains are totally valid.
On 27 Oct 2005 at 12:49, Bob Axtell wrote:
> There's nothing wrong with what they describe in AN521. It
> needs to be modified to suit your application
Unlike code, AN521 has safety issues
> If you design something to attach to AC, you need to
> understand what's required to make it work
It might be assumed though, by someone who doesn't know
better (eg the OP, no offense), that AN521, as presented by
Microchip, is authoritative and safe
> Microchip should include a disclaimer as they did with AN954.
> But it should stay on their website, the ideas it contains are
> totally valid.
I agree it could stay although MC should add IFs ANDs BUTs.
They won't of course, unfortunately, so we'll be seeing this thread
|At 12:49 PM 10/27/2005 -0700, you wrote:
>The key to whether AN521 was good or not is simple.
>1. Imagine designing exactly as AN521 indicated.
>2. Will it pass UL or CE norms?
>3. If not, it's unacceptable.
>Actually, AN521 COULD be made safe. But as it is, it
>is an example of very poor engineering practice, and I
>am continually amazed that MicroChip keeps it in their
Sure, using a properly rated leaded high-voltage metal-glaze resistor
it could be made safe, depending on the *resistor* and the *packaging*.
The fact that "tiny SMT" appears in the text of the MCP forum at one point
indicates a total lack of respect for the potential (pun intended)
transients that can occur on the AC line, but anyone who designs stuff
to be compliant with safety standards should understand what has to be
That, of course, is in general a different question from whether it will
work reliably, since many types of failures don't represent an inherent
Spehro Pefhany --"it's the network..." "The Journey is the reward"
interlog.com Info for manufacturers: speffhttp://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
->> Inexpensive test equipment & parts http://search.ebay.com/_W0QQsassZspeff
More... (looser matching)
- Last day of these posts
- In 2005
, 2006 only
- New search...