Searching \ for '[PIC's] Some Explanations please' 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/devices.htm?key=pic
Search entire site for: 'Some Explanations please'.

Exact match. Not showing close matches.
PICList Thread
'[PIC's] Some Explanations please'
1999\10\11@170544 by John De Villiers

flavicon
face
I've gone through the picNpoke tutorials, and now i have a few questions.

1) What does open collector output mean. What should i consider in the
circuit diagram for this pin.
2) What does weak pull-ups mean.
3) Is there a latency between setting a pin to high and when it actually
does go high, and if there is, what should my minimum time delay be if i
want to take it high and low very fast - ie 400ns ( 10 MHZ low instuction
immediately after a high )
4) if RB7:4 is set to interrupt and RB5&4 are to outputs, will i
inadvertently generate an intterupt when i write to bits 4 and 5.
5) does anyone have a 5digit bcd to 16bit binary routine please. My mind is
going numb trying to work that one out. i can do it on paper though

6) I want to use a pic for a dimmer switch. what is the easiest way to tap
5vdc from a 220vac line. I want to mount it inside the light switch cover if
at all possible.

thats all for now

thanx in advance

John

1999\10\11@191202 by Tony Nixon

flavicon
picon face
John De Villiers wrote:
>
> I've gone through the picNpoke tutorials, and now i have a few questions.
>
> 1) What does open collector output mean. What should i consider in the
> circuit diagram for this pin.
> 2) What does weak pull-ups mean.

These subjects are covered in PicNPort under [Open Collector] and
[Pullups].

You can think of an open collector output as a transistor switch
connected to ground. When the output is set to logic 1, the switch is
OFF and the pin is in a high impedance state. Logic 0 turns the switch
on and a current path to ground is produced. This means an open
collector pin can only sink current into the pin. It cannot source
current out of the pin.

> 3) Is there a latency between setting a pin to high and when it actually
> does go high, and if there is, what should my minimum time delay be if i
> want to take it high and low very fast - ie 400ns ( 10 MHZ low instuction
> immediately after a high )

Looking at the AC characteristics in the data sheet is a bit vague. It
appears there is a delay for the port pin to react which seems to be
TosH2ioV, but no timing figures are mentioned. A lot also depends on
what is connected to the pin.

> 4) if RB7:4 is set to interrupt and RB5&4 are to outputs, will i
> inadvertently generate an intterupt when i write to bits 4 and 5.

According to the data sheet, the interrupt on change feature is only
active on pins set as inputs. There is an AND gate controlled by the
TRIS latch which masks the port change.

> 5) does anyone have a 5digit bcd to 16bit binary routine please. My mind is
> going numb trying to work that one out. i can do it on paper though

A simple but perhaps long method is..

while X is positive (subtract 10000 - increment 10000 counter) else add
10000
while X is positive (subtract  1000 - increment  1000 counter) else add
1000
while X is positive (subtract   100 - increment   100 counter) else add
100
while X is positive (subtract    10 - increment    10 counter) else add
10
while X is positive (subtract     1 - increment     1 counter)

> 6) I want to use a pic for a dimmer switch. what is the easiest way to tap
> 5vdc from a 220vac line. I want to mount it inside the light switch cover if
> at all possible.

Can't help there, I haven't tried it, but be careful or you may be the
XMAS tree lights this year.

--
Best regards

Tony

http://www.picnpoke.com
Email spam_OUTsalesTakeThisOuTspampicnpoke.com

1999\10\11@193654 by Thomas Brandon

flavicon
picon face
I'm by no means an expert but I think I can cover these.
----- Original Message -----
From: John De Villiers <.....jd62KILLspamspam@spam@PIXIE.CO.ZA>
To: <PICLISTspamKILLspamMITVMA.MIT.EDU>
Sent: Tuesday, October 12, 1999 7:03 AM
Subject: [PIC's] Some Explanations please


> I've gone through the picNpoke tutorials, and now i have a few questions.
>
> 1) What does open collector output mean. What should i consider in the
> circuit diagram for this pin.
Open collector was used for bus interfacing before 3 state outputs came
around. 3 state ouputs (like the normal PIC pins) have (surpisingly) 3
states, high (+5V), low (GND) and High impedance (a.k.a High-Z, Z etc). The
high and low states are used when the pin is an output, the High impedance
when the pin is an input. This means multiple devices can be connected and
inactive devices simply go High-Z.
Open collector provides a similar end result with a different method.
Unfortunately you'll have to get someone else to explain exactly what it is.
If your using it as an input pin then noi modifications are needed. If
you're using it as an ouput you need a pullup resistor. A pullup resistor is
a resistor placed between the pin and +5V, this means that when the pin is
high it w3ill be "pulled up" to a full +5V, otherwise it's simply low.

> 2) What does weak pull-ups mean.
Same thing as in open collector. Don't know quite whjy there weak, or when
you would use them\not use them.

> 3) Is there a latency between setting a pin to high and when it actually
> does go high, and if there is, what should my minimum time delay be if i
> want to take it high and low very fast - ie 400ns ( 10 MHZ low instuction
> immediately after a high )
Due to the instruction pipelining of the PIC, pins are written at the end of
each instruction cycle, so there is that lag, but that's transparent from a
coding point of view as all writes happen at the same point in the
instruction cycle.However, reads occur at the start of the instruction,
Hence reads  should not directly follow writes in general. There is also a
delay added to the voltage change on the actual pin. This is due to the
capacitance on the pin and can be limited by a series resistor on the output
pin. I have only seen this mentioned when the Clock Tick on external pulse
feature is used and thus sub 1 instruction rise falls are neccesary. I'm
pretty sure you should have no problems with sequential writes at only
10MHz.

> 4) if RB7:4 is set to interrupt and RB5&4 are to outputs, will i
> inadvertently generate an intterupt when i write to bits 4 and 5.
No, if a pin is set to output it will not set the appropriate interrupt
flags (I gather it just doesn't set them) and no interrupt will be
generated.

> 5) does anyone have a 5digit bcd to 16bit binary routine please. My mind
is
> going numb trying to work that one out. i can do it on paper though
Microchip Application Note 526 - PIC16CXXX Math Routines has routines for
2bit binary -> BCD and 5bit binary->BCD in both directions.
>
> 6) I want to use a pic for a dimmer switch. what is the easiest way to tap
> 5vdc from a 220vac line. I want to mount it inside the light switch cover
if
> at all possible.
This is not my area of expertise. Inside a lightswitch covber might be a bit
of a tall ask. From memory, you need a transformer to get to about 15V AC, A
bridge rectifier to get 10-15V DC and a 5V regulator (prob. need a resistor
before or lower the input). But, I could be wrong. Not sure about the
lightswitch, depends how big it is.
>
> thats all for now
>
> thanx in advance
>
>  John

1999\10\11@201300 by Reginald Neale

flavicon
face
>6) I want to use a pic for a dimmer switch. what is the easiest way to tap
>5vdc from a 220vac line. I want to mount it inside the light switch cover if
>at all possible.
>

Email me in 12 hrs, I'll be at work where my files are. There is a
suggested circuit contributed by a Yugoslav engineer and I've got the code
for it somewhere. IIRC there were three implementations - the first was
just a switch, the second used an up and a down pushbutton to set the power
level. Both of those worked with a 12C508/9. The circuit uses a primitive
power supply that operates right off the 240V 50Hz line. The third one used
a 12C671/2 and a pot.

Eduardo Rivera also did some experimenting with this circuit. He put some
info up on his website at umemphis.edu. You still around, Eduardo?

If you're only talking about a couple of hundred watt load, the circuit and
the SSR should fit into an outlet box OK.

Reg Neale

1999\10\11@202301 by hris Fanning

flavicon
face
[snipsnip]
> This is not my area of expertise. Inside a lightswitch covber might be a bit
> of a tall ask. From memory, you need a transformer to get to about 15V AC, A
> bridge rectifier to get 10-15V DC and a 5V regulator (prob. need a resistor
> before or lower the input). But, I could be wrong. Not sure about the
> lightswitch, depends how big it is.

Check out this link for small cheap mains power:
 http://www.edtn.com/scribe/reference/appnotes/md004556.htm

Before I go off and use something like this, does anyone care to tell
me how crazy I'd be?  Or is this accepted practice?

I'm going to start a project soon that will run from mains power and this
looked simple enough.  However, I need to switch different power sources
to control various equipment (and do incandescent style dimming on a heater
element) say, 12VDC, 24VDC and 120VAC.  I'd like to set as few fires as
possible, but I'd like to use inexpensive electronic switching - TRIACs?
Because of the dimming control, relays are obviously out of the question.

I have pretty good digital background w/programming and design, but haven't
done much in the analog world.  Don't want my feet to get cut off.

I'm really asking because I figured I could just use a PIC pin and resistor
to check out zero crossing.  But after that other thread I figured it was
better to ask. :)

Chris

1999\10\11@225117 by Dave VanHorn

flavicon
face
I'll tackle the first two, and let a person more in sync with the pics do
the others.

> 1) What does open collector output mean. What should i consider in the
> circuit diagram for this pin.

This means that the output cannot by itself create a logic high. It can pull
current to ground, but it cannot output current to a load.  The output
circuit would look like an NPN transistor's collector, with the emitter tied
to ground.

> 2) What does weak pull-ups mean.

The chip has pullup resistors, which you might use with switches, such that
in the absense of any completed circuit to ground, the input reaches a high
state.  The pullups are "weak", in that they won't source much current.
Exact figures probably vary from chip to chip.

A strong pullup would be a 1 ohm resistor to VCC, a "weak" pullup might be
more like 100k.

1999\10\12@034552 by Michael Rigby-Jones

flavicon
face
       <snip>
       John De Villiers wrote:
> > 3) Is there a latency between setting a pin to high and when it actually
> > does go high, and if there is, what should my minimum time delay be if i
> > want to take it high and low very fast - ie 400ns ( 10 MHZ low
> instuction
> > immediately after a high )
>
       Thomas Brandon replied:
{Quote hidden}

I had endless troubles at only 4MHz due to driving a mosfet H-bridge which
must have had quite a high capacitance.  One NOP between consecutive bit
operations on the port cured it, but I felt worried about it so in the end I
only set bits in a shadow register and wrote the register to the port to
avoid all this.  It is very annoying to have to do this though.  It would be
great if there was an option to make the PIC read from the output latch when
TRIS=0, and from the pin when TRIS=1.  Bit manipulation of output ports is
where microcontrollers are supposed to shine, not so in the case of the PIC.
(Is the Scenix any better or the same?  I would think that it must be
improved for operation at 50+ MHz)

Mike Rigby-Jones

1999\10\18@001459 by Sean H. Breheny

face picon face
I think that the Scenix works the same way,but I was very impressed with
its ability to drive a capcitive load on a pin. I had a test circuit with a
Scenix at 50Mhz driving a scope probe with about 20pF of capacitance. The
waveform easily reached the full 5v between consecutive SNB/CLRB
inctructions, with no NOPs. It was a while ago, but I think the rise time
was about 10ns.

Sean

At 08:44 AM 10/12/99 +0100, you wrote:
{Quote hidden}

| 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
.....shb7KILLspamspam.....cornell.edu ICQ #: 3329174


'[PIC's] Some Explanations please'
2000\01\11@112140 by Roger Morella
flavicon
face
Reginald,

I found this response in the PIC archives.  Would it be possible to e'mail
anything you have regarding the topic below?

Thanks,

Roger

Reginald Neale wrote:

{Quote hidden}

2000\01\11@134201 by Reginald Neale

flavicon
face
<x-flowed>>Reginald,
{Quote hidden}

Roger:

The app note is Microchip Document number DS40160A-2. You can
download it from the Microchip site. It describes three different
applications, all operated direct from a 240V/50Hz line.

Not sure what you're trying to do, but note that this type of power
supply is NOT isolated from the power line. That means you have a
potentially lethal hazard for anyone contacting any part of the
circuit.

Regards,
Reg Neale

</x-flowed>

2000\01\18@162022 by Ing. Marcelo Fornaso

flavicon
face
Please Reginald: I was looking for Microchip Document number DS40160A-2, but
I can't find it at Microchip site.
Can you help me?

Thanks in advance
Best regards to the entire Piclist

Marcelo M. Fornaso, E.E.
Argentina





{Original Message removed}

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