Searching \ for 'Completely stupid question - flame away!!' 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/index.htm?key=completely+stupid
Search entire site for: 'Completely stupid question - flame away!!'.

Truncated match.
PICList Thread
'Completely stupid question - flame away!!'
1998\05\10@121958 by Catch-It

flavicon
picon face
Hi all,
   This is feebly easy question, but I have realized that I have got so
far, yet do not understand the basics! Perhaps somebody could check out
these assumptions and questions for me... i've been thinking about it so
much for the past few days I'm not sure why anything works!!

This is to do with the electrical properties of the i/o pins (told ya it was
basic)..

first the assumption:
In output mode, setting the corresponding bit in the SFR does the equivalent
of connecting the I/O pin to the supply voltage, correct?
In output mode, clearing the corresponding bit in the SFR does the
equivalent of connecting the I/O pin to the ground rail, correct?
If this is so I could connect an LED through a diode to the i/o pin from the
supply voltage, and the state of the diode would be the inverse of the bit
in the SFR, right?

Now the question:
What is the pin doing in input mode? Is it high impedance or something? Is
there any electrical difference between the pin being in input mode or the
pin being in ouput mode with a '0' in the SFR?

Also, what does Input/Ouput Clamp Current mean in the specs?

Sorry 'bout this
Catchy....

1998\05\10@130220 by Sean Breheny

face picon face
Hello,

At 05:17 PM 5/10/98 +0100, you wrote:
>Hi all,
>    This is feebly easy question, but I have realized that I have got so
>far, yet do not understand the basics! Perhaps somebody could check out
>these assumptions and questions for me... i've been thinking about it so
>much for the past few days I'm not sure why anything works!!
>
>This is to do with the electrical properties of the i/o pins (told ya it was
>basic)..
>
>first the assumption:
>In output mode, setting the corresponding bit in the SFR does the equivalent
>of connecting the I/O pin to the supply voltage, correct?
>In output mode, clearing the corresponding bit in the SFR does the
>equivalent of connecting the I/O pin to the ground rail, correct?
>If this is so I could connect an LED through a diode to the i/o pin from the
>supply voltage, and the state of the diode would be the inverse of the bit
>in the SFR, right?
>

Basically, you are correct. The pins actually get "connected" through a
MOSFET which is biased fully on, so they basically act as if they are
connected via a small resistor (I'm not sure of the value, somewhere in the
neighborhood of 30 ohms). I think that the MOSFET also limits the maximum
current that the pin can source or sink(even in addition to this virtual
resistance). You should not depend upon this limit, anything connected to
the pin should have an external current limiting resistor if it might
otherwise draw more than 20mA (or whatever the limit is for the pin).

>Now the question:
>What is the pin doing in input mode? Is it high impedance or something? Is
>there any electrical difference between the pin being in input mode or the
>pin being in ouput mode with a '0' in the SFR?
>

Yes, it is in a high impedance state. It is connected to the gates of a
couple of mosfets. So, then, there certainly is a difference between this
and the pin being in output "low" state, or "high" state, for that matter.
Actually, the output driver consists of a pair of mosfets (one P channel to
the ground rail, the other N channel to the supply rail, hence the term
CMOS, the C stands for Complementary), and when the pin is in
high-impedance state, neither of these fets is turned on. The gates of the
fets which read the pin are always connected, so that the pin reads as its
actual output state. So, a pin in input mode "looks" electrically like a
capacitor of about 10pF or so. This is why if you leave a CMOS input
floating, touching it with your finger will often change its state, or any
*small* stray charge will change it, because it is a very small capacitance
with very little parallel resistance.


>Also, what does Input/Ouput Clamp Current mean in the specs?
>

I think that this is referring to the maximum current that the input
protection diodes can handle. That's one thing I forgot to mention above.
With the exception of the "open drain" output (pin RA4 on most PICs), every
input pin has a diode to the supply rail, and a diode to the ground rail.
The purpose of these is to protect the sensitive mosfet gates from voltage
above the supply or below ground. This helps prevent static electricity
from punching holes in the extreamly thin oxide layer which separates the
fet gates from the fet's silicon channel.
These diodes are also often used when the pic needs to detect, say, a 10v
signal. If a large resistor is used between the input pin and the high
voltage signal, it is permissible to allow these diodes to conduct and drop
the voltage down from the high voltage to just the supply voltage.

>Sorry 'bout this
>Catchy....
>

No problem at all! Piclisters, please correct what I have wrong.

Sean

+--------------------------------+
| Sean Breheny                   |
| Amateur Radio Callsign: KA3YXM |
| Electrical Engineering Student |
+--------------------------------+
Save lives, please look at
http://www.all.org

Personal page: http://www.people.cornell.edu/pages/shb7
spam_OUTshb7TakeThisOuTspamcornell.edu
Phone(USA): (607) 253-0315

1998\05\10@142331 by Harold M Hallikainen

picon face
On Sun, 10 May 1998 17:17:13 +0100 Catch-It
<.....Catch-ItKILLspamspam@spam@FILETREK.DEMON.CO.UK> writes:

>
>first the assumption:
>In output mode, setting the corresponding bit in the SFR does the
>equivalent
>of connecting the I/O pin to the supply voltage, correct?
>In output mode, clearing the corresponding bit in the SFR does the
>equivalent of connecting the I/O pin to the ground rail, correct?

       True, though there are current limits.  I see the ideal logic
output as a SPDT switch that moves the output line between Vcc and GND.
In a tri-state output , the switch has a third position where the pin is
connected to an open circuit (the third state of tri-state).


>If this is so I could connect an LED through a diode to the i/o pin
>from the
>supply voltage, and the state of the diode would be the inverse of the
>bit
>in the SFR, right?

       You can connect an LED to the pin with a current limiting
resistor to either Vcc or GND (with the LED polarity as appropriate).  If
the LED/resistor combination is connected to ground, a high on the output
pin (or in the SFR) lights the LED.  If the LED/resistor combination is
connected to Vcc, a low on the pin makes the LED light.

>
>Now the question:
>What is the pin doing in input mode? Is it high impedance or
>something? Is
>there any electrical difference between the pin being in input mode or
>the
>pin being in ouput mode with a '0' in the SFR?


       Exactly...  It's "tri-stated" (or disconnected from the output
driver) when a TRIS bit is set.
       Note that the input circuit is ALWAYS connected to the pin, even
when TRIS is low.  In fact, I think this is why they use the term TRIS
instead of Data Direction Register.  You can still read a pin when it's
the processor itself that is setting the state of the pin.  In fact, the
slowing of the transitions of voltages on the pins due to loading can
cause problems with read-modify-write instructions (such as BSF) if the
lines are heavily loaded.

>
>Also, what does Input/Ouput Clamp Current mean in the specs?
>

       Each pin has a clamp diode to ground and Vcc to limit voltage
excursions to that which the chip will tolerate.  As long as you are
using resistive loads that only connect to +5V and GND, you'll not get
any current through the clamp diodes.  A favorite example of using the
clamp diodes is to put a current limit resistor between the clamped pin
and some higher AC voltage.  I typically connect a 10K between the INT
pin and 12VAC to detect AC line zero crossings (see the Shoebox dimmer at
http://www.dovesystems.com).  Microchip has an application note where
they do this to detect zero cross by running a resistor directly to the
120 VAC line.


       Have fun with it!


Harold




_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

1998\05\10@182122 by Harold M Hallikainen

picon face
On Sun, 10 May 1998 16:53:43 EDT FScalini <FScalinispamKILLspamAOL.COM> writes:
>I've seen zero crossing detection of AC currents come up frequently on
>this
>list lately, especially with respect to dimming applications.  What is
>the
>practicality of zero crossing detection?
>


       Works well!  In the Shoebox dimmer (at
http://www.dovesystems.com), I have a 10K resistor from the power
transformer secondary to the INT pin on a 16c74a.  The chip generates an
INT on the negative edge (which is just before zero crossing).  The INT
then resets a timer and the number of clock ticks into the half cycle we
want to turn on the first lamp (the brightest) is loaded into the
capture-compare register.  The CCP then generates an interrupt, turning
on the appropriate triac and reloading the CCP with the next brightest
lamp.  After the last lamp is turned on, the CCP is loaded with a number
corresponding to the length of a half-cycle.  When this interrupt occurs,
the timer is reset and the brightest lamp value put in the CCP, since we
are then at the positive zero-crossing.
       Note that I only detect the negative zero-crossing.  The INT
input is a schmitt input that has its trigger points somewhere around 2
and 3 volts.  If we generate an interrupt based on a positive edge, this
would be AFTER the zero-crossing.  That doesn't do much good in
controlling triacs.  Therefore, I used the negative edge and timed to the
positive zero crossing.
       On three phase systems, it gets more complicated.  Since we
probably don't want the expense of three power transformers, we use opto
couplers like the H11AA1.  This could be used to drive the INT input on
three PICs, like above, but that gets a little expensive.  The design I'm
currently working on uses a PIC to decode 24 channels of DMX out to 0 to
5 volt analog (using the PWM output), then putting this into analog
comparators driven by analog ramps that are synchronized with three
phases of power line zero-crossing.


Harold


_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

1998\05\11@024726 by White Horse Design

flavicon
face
>and some higher AC voltage.  I typically connect a 10K between the INT
>pin and 12VAC to detect AC line zero crossings (see the Shoebox dimmer at
>http://www.dovesystems.com).  Microchip has an application note where
>they do this to detect zero cross by running a resistor directly to the
>120 VAC line.

Had a quick look at your 3 shoebox dimmer's and the manual for the first
one. I don't see any circuits!

Regards

Adrian

WWW    WWW   Adrian Gothard
WWW WW WWW   White Horse Design
WWWWWWWWWW   +44-385-970009 (Mobile/SMS), +44-118-962-8913/4 (voice/fax)
WWWW  WWWW   .....whdKILLspamspam.....zetnet.co.uk, http://www.users.zetnet.co.uk/whd
---
Developers of GPS satellite-based tracking systems

1998\05\11@030633 by David VanHorn

flavicon
face
>>and some higher AC voltage.  I typically connect a 10K between the INT
>>pin and 12VAC to detect AC line zero crossings (see the Shoebox dimmer at
>>http://www.dovesystems.com).  Microchip has an application note where
>>they do this to detect zero cross by running a resistor directly to the
>>120 VAC line.


Man I hope no humans can come into contact with that!

1998\05\11@132038 by Harold Hallikainen

picon face
On Mon, 11 May 1998 07:45:28 +0100 White Horse Design <EraseMEwhdspam_OUTspamTakeThisOuTZETNET.CO.UK>
writes:

>
>Had a quick look at your 3 shoebox dimmer's and the manual for the
>first
>one. I don't see any circuits!
>


       Yeah... sorry about that.  At this point, I'm only comfortable
describing the circuits since they belong to my employer.  It's really
just a 16c74a with the previously described resistor between INT and
12VAC, an interface chip between the DMX lines and the serial input, a
thumbwheel channel select connected to some port lines, 0-10volt analog
inputs (thru voltage dividers) to analog inputs, and a few more port
lines driving opto-triacs.  The rest is software!

Harold


_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

1998\05\11@150306 by White Horse Design

flavicon
face
At 13:18 11/05/98 EDT, you wrote:
>On Mon, 11 May 1998 07:45:28 +0100 White Horse Design <whdspamspam_OUTZETNET.CO.UK>
>writes:
>
>>Had a quick look at your 3 shoebox dimmer's and the manual for the
>>first
>>one. I don't see any circuits!
>
>        Yeah... sorry about that.  At this point, I'm only comfortable
>describing the circuits since they belong to my employer.  It's really
>just a 16c74a with the previously described resistor between INT and
>12VAC, an interface chip between the DMX lines and the serial input, a
>thumbwheel channel select connected to some port lines, 0-10volt analog
>inputs (thru voltage dividers) to analog inputs, and a few more port
>lines driving opto-triacs.  The rest is software!

5 out of 10 for marketing then - saying "here's how you do it", now look at
our web site! :-) Congratulations you are well on your way to being a full
blown salesman (or rep(tile)!)

More seriously I contribute to CVu a newsletter by the ACCU (Association of
C and C++ Usrs) (International BTW) - that's my plug - and one person who
write a column has to post it anonymously ("The Harpist") because of the
views of his employer on this matter.

I think the point is that if some knowledge is in the public domain, there
would seem to be no reason to not make it available should you wish to dos.
Sometimes of course, the circuit is useless without the software (to make a
competing product I mean).

Most companies I have worked for either wholly permit out of working hours
activities involving information gathering / giving, some turn a blind eye
to information given which might actually take some time to amass by other
means but which is certainly obtainable with some effort, some threaten
dire retribution if you talk to anyone about electronics - even if not even
in the same field as that of your employer, and some, probably fairly sane,
just ask that you show them your proposed submission and simply vet it on
it's merits (mostly on the generous side). I should emphasise that we are
not talking about proprietary secrets here, just information that can be
found out by someone determined (even at some length) to do so.

Regards

Adrian

WWW    WWW   Adrian Gothard
WWW WW WWW   White Horse Design
WWWWWWWWWW   +44-385-970009 (Mobile/SMS), +44-118-962-8913/4 (voice/fax)
WWWW  WWWW   @spam@whdKILLspamspamzetnet.co.uk, http://www.users.zetnet.co.uk/whd
---
Developers of GPS satellite-based tracking systems

1998\05\12@073452 by Caisson

flavicon
face
> Van: David VanHorn <KILLspamdvanhornKILLspamspamCEDAR.NET>
> Aan: RemoveMEPICLISTTakeThisOuTspamMITVMA.MIT.EDU
> Onderwerp: Re: Completely stupid question - flame away!!
> Datum: maandag 11 mei 1998 9:00
>
> >>and some higher AC voltage.  I typically connect a 10K between the INT
> >>pin and 12VAC to detect AC line zero crossings (see the Shoebox dimmer
at
> >>http://www.dovesystems.com).  Microchip has an application note where
> >>they do this to detect zero cross by running a resistor directly to the
> >>120 VAC line.
>
>
> Man I hope no humans can come into contact with that!

The Zero (of the pic) has to be connected also.  taking 2 resistors of 10K
will give a current of 6 mili-ampere.  That is well below the human
death-treshold of 30 mili's.  So it _should_ be ok to tuch anything on this
(the pic's) side of the construction.

But _I_ would not bet my life on it either !

Greetz,
 Rudy Wieser

1998\05\12@104232 by David VanHorn

flavicon
face
>> >>http://www.dovesystems.com).  Microchip has an application note where
>> >>they do this to detect zero cross by running a resistor directly to the
>> >>120 VAC line.
>>
>>
>> Man I hope no humans can come into contact with that!
>
>The Zero (of the pic) has to be connected also.  taking 2 resistors of 10K
>will give a current of 6 mili-ampere.  That is well below the human
>death-treshold of 30 mili's.  So it _should_ be ok to tuch anything on this
>(the pic's) side of the construction.
>
>But _I_ would not bet my life on it either !
>
>Greetz,
>  Rudy Wieser


Exactly.  The failure of a  $0.001 component is not something I would bet my
life on.
Even without a component failure, this circuit sounds like one colossal
safety hazard.

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