Searching \ for 'unused' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/index.htm?key=unused
Search entire site for: 'unused'.

No exact or substring matches. trying for part
PICList Thread
'The unused 40pin socket on the PIC Start programme'
1994\06\15@072115 by IDH

flavicon
face
Could 40 pin PIC variants be programmed by PIC Start if a Socket is
placed in the unused 40 pin placement?.

                                   Ian H.
                                   

'The unused 40 pin pickstart socket.'
1994\06\15@073342 by IDH

flavicon
face
Can the unused 40 pin pickstart socket be used forprogramming 40 pin
PIC chips?.
                       Ian H.
                       

1994\06\15@074540 by byron

face picon face
>
> Can the unused 40 pin pickstart socket be used forprogramming 40 pin
> PIC chips?.

Don't know. What revision do you have? I have the 16B. No 40pin
socket at all.

Both of the 40 pin offerings can be programmer serially. Maybe it's
possible to create the 5 pin interface necessary to do that on a
daughterboard?

BTW can someone make the MPSTART.EXE software (V3.04) available to me?
I went to the Microchip seminar yesterday and got a PICSTART 16B but
I don't have a 1.44 3.5" floppy at home and of course the software is
on a disk of that format. Bummer. The BBS has the assembler and the simulator
but not the MPSTART software. I can get it ftp or you can mail it to me
in most any format. THe former would be preferable.

Thanks,

BAJ

1994\06\15@080137 by rca

flavicon
face

> spam_OUTbyronTakeThisOuTspamcc.gatech.edu (Byron A Jeff)
>
>>BTW can someone make the MPSTART.EXE software (V3.04) available to me?
>
>You can ftp it from ftp.sics.se in the pub/mchipsoft/picstrt16 directory or
similar.
>
>Hope that helps.
>
>Rafe
>

----------------------------------------------------------------
Rafe Aldridge - .....rcaKILLspamspam@spam@sirius.tn.rl.ac.uk
R65, Rutherford Appleton Lab,                      wwWWww
Chilton, Oxon, OX11 OQX, UK.                        o  o
------------------------------------------------ooO--(__)--Ooo--


1994\06\15@091502 by IDH
flavicon
face
> >
> > Can the unused 40 pin pickstart socket be used forprogramming 40 pin
> > PIC chips?.
>
> Don't know. What revision do you have? I have the 16B. No 40pin
> socket at all.
>
> Both of the 40 pin offerings can be programmer serially. Maybe it's
> possible to create the 5 pin interface necessary to do that on a
> daughterboard?

My board is marked 04-01315 rev2.  The Firmware chip is marked
Picstart-16B firmware rev 1.4.  The copyright is  1992.  The location
of the 40pin socket is market u8.  Can serial programming be done
using the Picstart Board as the programmer?. (Perhaps this is
refrasing your last question).

                           Ian H.

'The unused 40 pin pickstart socket. '
1994\06\15@175723 by eric

flavicon
face
> Can the unused 40 pin pickstart socket be used forprogramming 40 pin
> PIC chips?.

Based on partially tracing the connections, it appears that the extra 40 pin
footprint on the PICSTART-16B was intended for use in programming the 17C42.
The firmware on the board probably doesn't support it, and the MPSTART program
on the PC certainly doesn't.  They probably planned to sell a board with the
40 pin socket as a PICSTART-17, but they haven't done so (yet).

The 40 pin pads would not work at all for programming the 16C64 and 16C74.
You might be able to wire an adapter to program these parts, and tell the
software that you're programming a 16C71.  You would only be able to use the
first 1K words of program though.

The PICSTART-16B1 doesn't have the extra 40 pin pads at all.

The PICSTART-16C will program the 16C64 and 16C74, and is rumored to program
the forthcoming 28-pin 16C63 and 16C73 as well.

By the way, the latest firmware for the PICSTART-16B and PICSTART-16B1 is
version 1.7.  If you use the 16C84 I would strongly recommend upgrading, and
if you use the 16C58A you _must_ upgrade.  The upgrade should be available
free from your Microchip representative.

Eric


'unused data lines on pic16c5x '
1994\07\27@120650 by mycal
flavicon
face


Hi,

I've done a project where I use only one data line on a pic16c54, it
is RA0 and it is set to output.  All other pins are set to input (default),
as I set port_a by :
       movlw 0eh
       tris  port_A

and don't init port_b.  Ok everything is fine here.  I am generating
a repeating pattern out of RA0, but the output is very dirty.  Then I
tied RA1 to +5 through a 5k resistor and all my problems went away,
RA0's output cleaned up.

In the book it says for lowest current consumption in sleep mode all I/O
pins should be at VDD or VSS.  I don't use sleep mode, but should I tie
all my unused pins to VDD or VSS?  Do I need the resistor if I tie them
to VDD?  Any other thoughts on what to do with unused pins?

Thanx,

mycal



1994\07\27@173253 by dpalmer

flavicon
face
Are you sure that you are not trying to source to much out of the output
pin?  I sometimes only use the lower 2 pins on port A, because I try
to make port A always RS232 pins, and I have no problems at all.  
Try to put a pull-up resistor on the output pin and see if it works.
Check to make sure you are not trying to pulse the lines too fast, once
I tried to generate a 2 mhz clock from an output pin until I very
carefully figured out the capacitance in my 22 awg hook-up wire that was
7 inches long. :)

Darryl Palmer

1994\07\28@000401 by dthomas

flavicon
face
That's easy.  Make all unused pins outputs.  Then you can let them
float.  Leaving inputs floating is definitely "considered harmful".
;^)

David


'unused pins'
1997\10\21@180140 by stephen mcalonan
picon face
I am developing a small application around the PIC16C73.  Is there
anything that I need to do with the unused pins (pullups, etc)?
Thanks in advance,
Steve McAlonan

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

1997\10\21@182958 by ndie Ohtsji [4555]

flavicon
face
Hi Steve,

I'm not too familiar with the 16C73 so whatever I say may be false
.... but I'm sure others will flame me if I'm wrong.

I assume you mean all the unused port pins.....if so then, make them
outputs and set them to a know state, then you don't have
to do anything......err you may want to check your data sheet
as some may have an open drain.  In this case you may want to set
them low instead of high....then you don't have to do anything.

If you want the outputs high (for whatever reason), some have internal
pullups you can enable.  For the open drain pin(s), you need to connect
a pullup.

If you make them inputs, then use pullups (10K) to prevent them from
floating around.

Regards,

-Randie

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/
*/ Randie Ohtsji                                                     /*
/* Glenayre R&D, Vancouver, BC  CANADA   Phone: (604) 293-1611 x4555 */
*/ Email: rohtsjispamKILLspamglenayre.com           Fax:   (604) 293-4317       /*
*/                ________                                           /*
/*               / ____/ /__  ____  ____ ___  _________              */
*/              / /___/ / _ \/ __ \/ __ `/ / / / __/ _ \             /*
/*             / /_\ / /  __/ / / / /_/ / /_/ / / /  __/             */
*/             \____/_/\___/_/ /_/\__,_/\__  /_/  \___/              /*
/*                ________________________/ /                        */
*/               /_________________________/                         /*
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/



{Quote hidden}

1997\10\21@191758 by DREITEK

picon face
In a message dated 97-10-21 18:02:42 EDT, you write:

<<
I am developing a small application around the PIC16C73.  Is there
anything that I need to do with the unused pins (pullups, etc)?
Thanks in advance,
Steve McAlonan >>

Steve,
It is a good idea to make unused I/O pins into outputs.  If they are left as
inputs they can oscillate causing your power consumption to go up.  If you
want, you can tie them to either +5 or GND through a high value resistor (10K
- 100K).  Don't tie them directly to either rail.  If your software goes nuts
or you forget and set a pin to an output and it is driven hard to the oposite
rail you can damage the I/O pin.

Hope this helps
Dave Duley
V.P. DreiTek Inc.
http://www.dreitek.com

1997\10\21@194109 by John Payson

picon face
> Steve,
> It is a good idea to make unused I/O pins into outputs.  If they are left as
> inputs they can oscillate causing your power consumption to go up.  If you
> want, you can tie them to either +5 or GND through a high value resistor (10K
> - 100K).  Don't tie them directly to either rail.  If your software goes nuts
> or you forget and set a pin to an output and it is driven hard to the oposite
> rail you can damage the I/O pin.

I prefer to leave them unconnected and program them for outputs (or enable
the PORTB/PORTC pullups); this saves parts versus resistors, and it's more
versatile as well.  During debugging, it's often useful to have unused pins
available for "test" outputs (e.g. if you want to know how much time the PIC
is spending in an interrupt, you can set a pin at interrupt entry and clear
it on exit).  You should also note that wiring many I/O pins together to a
common pullup resistor is not necessarily safe, since the PIC may try to out-
put high on some and low on others.  In addition, doing that makes it much
harder to use spare pins for "debug output".

1997\10\25@094353 by paulb

flavicon
face
John Payson quoted:

>> If you want, you can tie them to either +5 or GND through a high
>> value resistor (10K - 100K).  Don't tie them directly to either rail.
>> If your software goes nuts or you forget and set a pin to an output
>> and it is driven hard to the oposite rail you can damage the I/O pin.

 And wrote:

> You should also note that wiring many I/O pins together to a common
> pullup resistor is not necessarily safe, since the PIC may try to out-
> put high on some and low on others.

 Which should be self-evident.  I am sure the first poster had every
intention that separate terminating resistors be used.

 What this comment brought to mind was a curious practice way back in
the days of raw TTL, of pulling unused (NAND) inputs high via a resistor
which may have been commoned to many devices.  The supposed reason was
a defect in some early chips with inputs which might break down if the
supply voltage was applied directly.  It never really made sense, and
was largely forgotten by the time LS arrived.

 A comment on this thread suggested that unterminated inputs might
"oscillate".  This seems equally implausible, the correct reason (and
quoted in the data sheets) being that inputs floating in the "no man's
land" between valid logic states induce significant bias current in the
CMOS input stage, defeating most user's efforts to minimise current
consumption.

 And you wouldn't leave a port B line to float with RBIE enabled, would
you now?

 Cheers,
       Paul B.

1997\10\25@174612 by Harold M Hallikainen

picon face
       On PIC's, how about just leaving unused pins open and programming
them to be outputs?

Harold

1997\10\27@122242 by David W. Duley

picon face
In a message dated 97-10-25 17:47:02 EDT, you write:

<<
        On PIC's, how about just leaving unused pins open and programming
them to be outputs?

Harold >>

Harold,
That works great and is a common technique.

Dave Duley


'Question on unused AINS'
1997\12\05@163020 by Chris Eddy
flavicon
face
Steve:
First comment, your 2.5V reference is below the book minimum.  But then, I
do have one production product that uses 2.5, and I don't have a problem
with it.

To protect pins, you can clamp a pin to a rail, with diodes, but I am never
too confident, as the diodes typically have a higher bias than the max volts
on the pin.  So your zener may clamp OK at 3.3 or whatever you use, but
going negative, it will be at 0.7, which is too far low.  AND you cannot
forget that a generic zener has a prety good leakage, and will modify your
readings if you have any series resistance in the line.

The other approach that I have seen, and I think it relies on the family of
parts in use, is to add a series resistor in the line, allow the voltage to
climb over the rail, and limit current with the value that keeps the current
below absolute max, which relates to the value that causes migration in the
chip.  But based upon family, this method may cause latchup.  I don't know
enough about all of the families to know which ones latch up.

But, Motorola makes a part that comes in 8 pins, and acts to clamp the
line.  Cant remember a whole lot about it, but it's part number is TCF6000.

In other words, I haven't got a real good answer.  Gluck.

Chris Eddy

stephen mcalonan wrote:

> Hello everyone!
> I am using the 5 channel A/D on the PIC16C73A running at 5V.  I am using
> an external voltage reference of 2.5V on pin RA3/AN3/Vref.  My question
> is: Should I use a zener diode, etc. to protect the port from voltages
> from 2.5V to Vdd+.6 or will this just give me a full scale reading?  Are
> there any other thought on protecting A/D inputs?  Thanks in advance.
> Steve McAlonan
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com

'[OT] Unused parts in stock'
1997\12\22@033024 by Luis Fernandez

flavicon
face
Hi list,

>> I have used it before with no purchasing problems, but when I
>> contacted my local distributor yesterday I was given a 16 week
>> lead time and told that Ramtron's lead times are extending all
>> the time.
>
>I have 40 piece of FM24C16-SO8 that I don't need anymore.  They are
>purchased 4 months ago not used yet.

Is there is any forum to buy/offer unused parts in stock. Probably many
times one needs something that others keep stocked with no plans to use.



Luis Fernandez Cormenzana
RadioBit Sistemas, S.L.
       Vehicle fleet control systems
       Patrol presence controllers

Fax/Tel:+34-6-585 64 57
       +34-6-680 26 33
e-mail: @spam@radiobitKILLspamspamdragonet.es
http://www.dragonet.es/users/radiobit


'unused A/D pins as outputs'
1998\04\15@175453 by Bob Blick
face
flavicon
face
I'm using a 16C74A with two analog inputs. ADCON1 is set 04h, so I
actually have three analog inputs. Is it OK to use the extra analog pin as
an output, as long as I set TRISA accordingly? I recall this is the case,
and looking at the block diagram of the innards of the chip it looks like
that's OK to do.

While looking for the answer to this in AN546, I noticed something
unusual. On page 4 it says(remember this document relates to a 16C71) "If
only one A/D channel is required, program ADCON1 to 03h. This configures
the A/D pins as digital I/O"

That says to me that the input buffer is enabled and what they are not
saying is that the input buffer is going to make the chip draw a little
extra current when the pin is near 1.2 volts, or whatever the transition
point is. Correct?


Thanks,

Bob

1998\04\15@182519 by Andrew Warren

face
flavicon
face
Bob Blick <KILLspamPICLISTKILLspamspamMITVMA.MIT.EDU> wrote:

> I'm using a 16C74A with two analog inputs. ADCON1 is set 04h, so I
> actually have three analog inputs. Is it OK to use the extra analog
> pin as an output, as long as I set TRISA accordingly?

Bob:

Yes, it's ok... Just remember that the PORTx bit corresponding to
that pin will always read "0", so read-modify-write instructions to
that port (including "BSF" and "BCF" instructions) will make that
pin pull low.

-Andy

=== Andrew Warren - RemoveMEfastfwdTakeThisOuTspamix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

1998\04\15@184257 by Sean Breheny

face picon face
At 03:17 PM 4/15/98 -0800, you wrote:
>Bob Blick <spamBeGonePICLISTspamBeGonespamMITVMA.MIT.EDU> wrote:
>
>> I'm using a 16C74A with two analog inputs. ADCON1 is set 04h, so I
>> actually have three analog inputs. Is it OK to use the extra analog
>> pin as an output, as long as I set TRISA accordingly?
>
>Bob:
>
>Yes, it's ok... Just remember that the PORTx bit corresponding to
>that pin will always read "0", so read-modify-write instructions to
>that port (including "BSF" and "BCF" instructions) will make that
>pin pull low.
>
>-Andy

Andy,

When you say "will make that pin pull low", you mean if and when it is set
to a digital output, right? In other words, that pin will not attempt to
output a low when it is configured as an ADC input.

Just making sure that my idea of how read-modify-write works is correct.

Thanks,

Sean


+--------------------------------+
| Sean Breheny                   |
| Amateur Radio Callsign: KA3YXM |
| Electrical Engineering Student |
+--------------------------------+
Fight injustice, please look at
http://homepages.enterprise.net/toolan/joanandrews/

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

1998\04\15@193315 by Andrew Warren

face
flavicon
face
Sean Breheny <RemoveMEPICLISTspamTakeThisOuTMITVMA.MIT.EDU> wrote:

> >> I'm using a 16C74A with two analog inputs. ADCON1 is set 04h, so I
> >> actually have three analog inputs. Is it OK to use the extra analog
> >> pin as an output, as long as I set TRISA accordingly?
> >
> > Yes, it's ok... Just remember that the PORTx bit corresponding to
> > that pin will always read "0", so read-modify-write instructions to
> > that port (including "BSF" and "BCF" instructions) will make that
> > pin pull low.
>
> When you say "will make that pin pull low", you mean if and when it
> is set to a digital output, right?

   Right, Sean.

> In other words, that pin will not attempt to output a low when it
> is configured as an ADC input.

   Correct; if the pin's TRIS bit is set to "1" (input), it will not
   pull low (whether or not it's configured as an analog input via
   ADCON1).

   -Andy

=== Andrew Warren - fastfwdEraseMEspam.....ix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

1998\04\15@201435 by Bob Blick

face
flavicon
face
On Wed, 15 Apr 1998, Andrew Warren wrote:
> Bob Blick <EraseMEPICLISTspamMITVMA.MIT.EDU> wrote:
> > I'm using a 16C74A with two analog inputs. ADCON1 is set 04h, so I
> > actually have three analog inputs. Is it OK to use the extra analog
> > pin as an output, as long as I set TRISA accordingly?
>
> Bob:
>
> Yes, it's ok... Just remember that the PORTx bit corresponding to
> that pin will always read "0", so read-modify-write instructions to
> that port (including "BSF" and "BCF" instructions) will make that
> pin pull low.

Good point. I imagine a BSF or BCF on that pin would be OK, but not on any
other pin on that port. I'll juggle them around so the rest will be
inputs. Thanks again!

-Bob

1998\04\15@231914 by Andrew Warren

face
flavicon
face
Bob Blick <RemoveMEPICLISTEraseMEspamEraseMEMITVMA.MIT.EDU> wrote:

> > Yes, it's ok... Just remember that the PORTx bit corresponding to
> > that pin will always read "0", so read-modify-write instructions to
> > that port (including "BSF" and "BCF" instructions) will make that
> > pin pull low.
>
> Good point. I imagine a BSF or BCF on that pin would be OK, but not
> on any other pin on that port.

   Correct.

> I'll juggle them around so the rest will be inputs.

   Good idea.

   -Andy

=== Andrew Warren - RemoveMEfastfwdspam_OUTspamKILLspamix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

1998\04\16@004134 by tjaart

flavicon
face
Andrew Warren wrote:

> Bob Blick <RemoveMEPICLISTTakeThisOuTspamspamMITVMA.MIT.EDU> wrote:
>
> > > Yes, it's ok... Just remember that the PORTx bit corresponding to
> > > that pin will always read "0", so read-modify-write instructions to
> > > that port (including "BSF" and "BCF" instructions) will make that
> > > pin pull low.
> >
> > Good point. I imagine a BSF or BCF on that pin would be OK, but not
> > on any other pin on that port.
>
>     Correct.
>
> > I'll juggle them around so the rest will be inputs.
>
>     Good idea.

Another way around it is to use a shadow register for port a.If you want to change any output on
that port, you change it
in the shadow register. Load the shadow into port a, and
presto! No read-modify-write problems!

--
Friendly Regards

Tjaart van der Walt
EraseMEtjaartspamspamspamBeGonewasp.co.za

|--------------------------------------------------|
|                WASP International                |
|R&D Engineer : GSM peripheral services development|
|--------------------------------------------------|
|SMS RemoveME0832123443KILLspamspamwasp.co.za  (160 chars max)|
|     http://www.wasp.co.za/~tjaart/index.html     |
|Voice: +27-(0)11-622-8686  Fax: +27-(0)11-622-8973|
|          WGS-84 : 26¡10.52'S 28¡06.19'E          |
|--------------------------------------------------|

1998\04\16@105546 by lilel

flavicon
face
> Tjaart wrote:

> Another way around it is to use a shadow register for port a.If you
> want to change any output on that port, you change it in the shadow
> register. Load the shadow into port a, and presto! No
> read-modify-write problems!

I have started doing this as a standard habit.  There are several
other situations where BSF PORTX, PIN will not give you what you
expect, like capacitive loads on pins, external sources trying to
drive pins, etc.  Usually when I modify a port output I will
do this:

BSF MIRROR, PIN
MOVF MIRROR, W
MOVWF PORTx

Can anyone think of a reason NOT to do this?


Best Regards,

Lawrence Lile

1998\04\16@165859 by Alex Torres

picon face
> From: Bob Blick <bobSTOPspamspamspam_OUTTED.NET>

> I'm using a 16C74A with two analog inputs. ADCON1 is set 04h, so I
> actually have three analog inputs. Is it OK to use the extra analog pin
as
> an output, as long as I set TRISA accordingly? I recall this is the case,
> and looking at the block diagram of the innards of the chip it looks like
> that's OK to do.

Yes, its work.
But don't try to use this pin as digital input!
You are always read "0", and not use BCF/BSF instruction - use a mirror
register.

==============
Alex Torres, Kharkov, Ukraine (exUSSR)
spamBeGonealtorSTOPspamspamEraseMEgeocities.com
2:461/28 FidoNet
http://www.geocities.com/SiliconValley/Lab/6311


'Unused I/O pins'
1998\05\03@033502 by Dave Celsnak
flavicon
face
Piclisters!
My next question deals with unused PIC I/O pins.  Should they be made
either an input or output (software), left floating or tied to gnd or +5v?

I am unfortunately using a 28 pin 16c63 dedicated to oscillating a single
pin via hardware USART.  Quick additional other question:  Are there any
other PICs available that have hardware USART?

Cya-
                        6500
                             7000
Dave Celsnak                    ___7500
                              / /     8000     (Shift!)
                            /-/
                          / /              RPM
                        / /
                      / /

1998\05\03@060300 by White Horse Design

flavicon
face
At 03:33 03/05/98 -0400, you wrote:

>I am unfortunately using a 28 pin 16c63 dedicated to oscillating a single
>pin via hardware USART.  Quick additional other question:  Are there any
>other PICs available that have hardware USART?

PIC16C74A does, as do many others.

(And I'm not going to write them all down for you! Get a databook from your
nearest distributor!)

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   KILLspamwhdspamBeGonespamzetnet.co.uk, http://www.users.zetnet.co.uk/whd
---
Developers of GPS satellite-based tracking systems

1998\05\03@065821 by Morgan Olsson

picon face
At 03:33 1998-05-03 -0400, you wrote:
>Piclisters!
>My next question deals with unused PIC I/O pins.  Should they be made
>either an input or output (software), left floating or tied to gnd or +5v?

As output.

(Floating input may cause input cirquit to draw current if between high and
low, and if you tie an input it might get damaged if there is any program
error that makes it an output)

/Morgan
/  Morgan Olsson, MORGANS REGLERTEKNIK, SE-277 35 KIVIK, Sweden \
\  EraseMEmrtspamEraseMEiname.com, ph: +46 (0)414 70741; fax +46 (0)414 70331    /

1998\05\03@111705 by David VanHorn

flavicon
face
>Piclisters!
>My next question deals with unused PIC I/O pins.  Should they be made
>either an input or output (software), left floating or tied to gnd or +5v?


I always make them outputs. This is more flexible than making them inputs,
which would require tying them to one logic state or the other. Cmos inputs
left unterminated can draw lots of power, and make transitions whenever they
feel like it, (Just say no)  Since the outputs don't have to be tied, it's
marginally less expensive, and if I have an "oops" and need a pin, it's
right there waiting for me :)

'Comparing PIC Features (was Unused I/O pins)'
1998\05\04@013621 by Michael Ghormley

flavicon
face
There is a nifty comparison chart of PIC's at:

       http://www.brouhaha.com/~eric/pic/chips.html

The ones with a UART have '*'s in the SCI column.  I find it handy.

Michael

REMOVE THE .NS (NO SPAM) FROM MY ADDRESS TO REPLY
*************************************************************************When th
e way of the Tao is forgotten, kindness and ethics must be taught.
Men must learn to pretend to be wise and good.  --  Lao Tzu
*************************************************************************

1998\05\04@183834 by Eric Smith

flavicon
face
Michael Ghormley <@spam@mikeg@spam@spamspam_OUTBLACKSAND.NS.COM> wrote:

> There is a nifty comparison chart of PIC's at:
>
>         http://www.brouhaha.com/~eric/pic/chips.html
>
> The ones with a UART have '*'s in the SCI column.  I find it handy.

Alas, it is rather dated.  These days I should just refer people to the
Microchip web page, as they finally have pretty good charts themselves.
(Click "PICmicro(tm) Devices" on the navigation bar on the left.)

Cheers,
Eric


'Unused PIC Pins tied to GROUND?'
1998\11\04@193340 by enpassant
picon face
I read in a book somewhere that unused microchip pins should be grounded
to prevent them from "floating".  In the case of the PIC (16F84) should
unused I/O pins and any other unused pins be tied to ground???  Being
new with this stuff I'm not sure.  Thanks.

1998\11\04@200858 by James Cameron

flavicon
face
enpassant wrote:
> I read in a book somewhere that unused microchip pins should be
> grounded to prevent them from "floating".

I've seen that to.  Unused inputs I thought it said.  Outputs don't
float, but are driven.

> In the case of the PIC (16F84) should unused I/O pins and any other
> unused pins be tied to ground???

On the PIC 16F84, the only possible unused pins are I/O pins.  Set them
as outputs, and you will not need to attach them to anything.

The problem with grounding them is that your software may attempt to
raise them to a high level, in which case current may flow.

--
James Cameron                                      (spamBeGonecameronspamKILLspamstl.dec.com)

OpenVMS, Linux, Firewalls, Software Engineering, CGI, HTTP, X, C, FORTH,
COBOL, BASIC, DCL, csh, bash, ksh, sh, Electronics, Microcontrollers,
Disability Engineering, Netrek, Bicycles, Pedant, Farming, Home Control,
Remote Area Power, Greek Scholar, Tenor Vocalist, Church Sound, Husband.

"Specialisation is for insects." -- Robert Heinlein.

1998\11\04@200913 by Harold Hallikainen

picon face
On Wed, 4 Nov 1998 19:33:31 -0500 enpassant <.....enpassantspam_OUTspamAMERITECH.NET>
writes:
>I read in a book somewhere that unused microchip pins should be
>grounded
>to prevent them from "floating".  In the case of the PIC (16F84)
>should
>unused I/O pins and any other unused pins be tied to ground???  Being
>new with this stuff I'm not sure.  Thanks.
>

Unused input pins should not be allowed to float  (at mid-voltage the
chip draws more current).  For maximum flexibility, I program unused pins
as outputs, which can then be left unconnected.  I can then later decide
to use the pins without cutting wires or traces.

Harold



Harold Hallikainen
TakeThisOuTharold.....spamTakeThisOuThallikainen.com
Hallikainen & Friends, Inc.
See the FCC Rules at http://hallikainen.com/FccRules and comments filed
in LPFM proceeding at http://hallikainen.com/lpfm

___________________________________________________________________
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/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]

1998\11\04@201305 by Dmitry Kiryashov

flavicon
face
enpassant wrote:
>
> I read in a book somewhere that unused microchip pins should be grounded
> to prevent them from "floating".  In the case of the PIC (16F84) should
> unused I/O pins and any other unused pins be tied to ground???  Being
> new with this stuff I'm not sure.  Thanks.

I think you may leave it untied but you should program this pins
as output to avoid current leakage. (in input state this pins are
able to floating and this result to current leakage ability)

You may damage the PIC if you'll tied pins _directly_ to ground and
after that trying to set it output=high (for instance due to mistake
in code)

WBR Dmitry.

'Unused PIC Pins tied to GROUND? - somewhat OT'
1998\11\05@085244 by Harrison Cooper

flavicon
face
By standard practice, you want to minimize current flows AND
oscillations.  So, all unused inputs to simple gates, I will tie to
ground, or disable it if its a tri-state buffer or that type of device.
You don't want the output gates switching.

Programmable logic, ie, PIC's, are a different story. In some cases,
such as Altera, you don't do anything with them because they take care
of them in the burn file.  Micro's, who's ports can be either way,
should not be grounded.  Its been stated before, that since its a
programmable I/O, it might be set to be an output and drive current
direct to ground. Not real good on the system to do this.  As suggested,
but default, program these to be outputs, and don't drive them.

Problem is on the development of a system, not just PIC's, but in
general, is not enough thought is taken to the simple things, like
decoupling, routing of clocks, parallelism of traces, ground planes,
power planes.  The list goes on.

I'm doing a board now, 12 layers, 99.99% surface mount, 4 clock domains
(including 100 MHz).  Management says hurry up, get it done.  I tell em
to cool off, ask if they would rather have me spend a week extra to make
sure we don't have to turn the card again, or just hurry and do it.
They shut up pretty quick.

If you don't have time to do it right the first time, how do you have
time to do it a second time?

Sorry for being a little off topic...but it might help someone out
there.

1998\11\06@123228 by John Payson

flavicon
face
|> I read in a book somewhere that unused microchip pins should be
|> grounded to prevent them from "floating".

|I've seen that to.  Unused inputs I thought it said.  Outputs don't
|float, but are driven.

True.  One caveat here is that until the PIC manages to start up its outputs
will all be floating.  In most cases this shouldn't be a problem, but it may
cause the PIC to draw extra current while held in reset.

|> In the case of the PIC (16F84) should unused I/O pins and any other
|> unused pins be tied to ground???

|On the PIC 16F84, the only possible unused pins are I/O pins.  Set them
|as outputs, and you will not need to attach them to anything.

|The problem with grounding them is that your software may attempt to
|raise them to a high level, in which case current may flow.

Port pin RA4 may safely be connected to ground, since it's an open-collector
output.  Other port pins may be tied to either VDD or VSS through INDIVIDUAL
pullup or pulldown resistors, but in case of errant program execution pins which
are tied directly to VDD, ground, or each other could (in theory) be damaged or
(in practice) cause extremely high levels of current to be drawn (50+mA).

Note also that on the 16C5x, there's no way to set the RTCC pin as an output
and it's almost useless as an input, but it may be very conveniently tied to the
/MClr pin.

ObTrivialQuestion: In what fraction of 16C5x applications is the RTCC pin used
for any purpose?  If there were any way to use the pin without giving up the onl
y
timer it'd be handy, but there isn't.  I wonder how hard it would be to allow th
e pin
to be read as an input at address [5.4] and whether any existing software would
have a problem with that (the pin is spec'd to read as zero, unconditionally).



Attachment converted: wonderland:WINMAIL.DAT (????/----) (0001C63C)

'Unused bits of I/O ports'
1998\11\24@023047 by aureo

flavicon
face
I am using PIC16C84

Should unused bits of I/O ports be programed as inputs or outputs?

Should they be tied high, low or left to float?

TIA
--
Seth Fischer
Auckland, New Zealand

1998\11\24@025128 by Regulus Berdin

picon face
Hi,

As discussed few weeks ago, unused ports can be programmed as output and
be left unconnected.  Connecting it to ground or Vcc and making it as
input may destroy your PIC if some erronous instructions is executed by
making them (accidentally) as outputs.

regards,
Reggie


Seth Fischer wrote:
{Quote hidden}

1998\11\24@164739 by Tony Nixon

flavicon
picon face
>
> As discussed few weeks ago, unused ports can be programmed as output


Just be careful when protoyping with I/O ports set as outputs because it
is easy to short wires/tracks/pins etc while experimenting.

The 16C84 is a pretty tough chip though.


--
Best regards

Tony

Multimedia 16F84 Beginners PIC Tools.

http://www.picnpoke.com
Email TakeThisOuTpicnpokeKILLspamspamspamcdi.com.au

1998\11\24@170129 by Octavio Nogueira

flavicon
face
>Just be careful when protoyping with I/O ports set as outputs because it
>is easy to short wires/tracks/pins etc while experimenting.
>
>The 16C84 is a pretty tough chip though.
>
>
>--
>Best regards
>
>Tony

Yes they really are. I had one in my experimenter board and I
was testing something else and powered it with 12V for several
minutes. And it's still working great.

Octavio
==============================================
Octavio Nogueira - .....nogueiraspamRemoveMEpropic2.com ICQ# 19841898
  From the creator of ProPic,   ProPic 2  now much better
    New ProPic 2 homepage:    http://www.propic2.com
   PIC Programmer for Windows with down to earth price
==============================================

1998\11\24@193650 by Tony Nixon

flavicon
picon face
Octavio Nogueira wrote:
> Yes they really are. I had one in my experimenter board and I
> was testing something else and powered it with 12V for several
> minutes. And it's still working great.

I've still got the 1st one I ever bought. I don't know how many times
I've used it to experiment with. I think I mentioned ages ago about how
it has been through just about everything except run over by a truck,
although I stepped on it once. I've even had to solder some new pins
onto it, but it still keeps a going.

I don't think I'd use it in a pacemaker project though ;-)

--
Best regards

Tony

Multimedia 16F84 Beginners PIC Tools.

http://www.picnpoke.com
Email RemoveMEpicnpokespamspamBeGonecdi.com.au

1998\11\24@214552 by Eduardo R.

flavicon
face
>>The 16C84 is a pretty tough chip though.

>>Yes they really are. I had one in my experimenter board and I
>>was testing something else and powered it with 12V for several
>>minutes. And it's still working great.
Octavio


!!!!!!!Several minutes !!!!! WOW lucky man,it's really hard to believe it
would be that way a second time 'cause  same  hapenned to me  12V just for
several seconds and is gone forever to the trash can.

Eddy

1998\11\24@220835 by Brian Striggow

flavicon
face
> >>The 16C84 is a pretty tough chip though.
>

Working at getting first PIC program going on 12c509, innumerable trips
between programmer, breadboard, and eraser were made.  By the time I had
things going, it appeared that 3 output pins were dead.  Haven't tested
to see if pins work as inputs yet.

Admittedly, minimal (none) static precautions were taken.  Was the
problem likely static or some other rookie mistake?

I seem to recall breadboarding a CMOS chip once, and in my enthusiasm to
try the thing, I powered it up without tying down the spare inputs.  Chip
exploded, (post mortem indicated it was wired correctly).  Previous to
this experience, I had thought that the precaution to tie down stray
inputs was foo-for-all.  Could this happen w/ the mclr pin which can't
be configured as output??

tnx
bcs

1998\11\25@052505 by Octavio Nogueira

flavicon
face
>>>The 16C84 is a pretty tough chip though.
>
>>>Yes they really are. I had one in my experimenter board and I
>>>was testing something else and powered it with 12V for several
>>>minutes. And it's still working great.
>Octavio
>
>
>!!!!!!!Several minutes !!!!! WOW lucky man,it's really hard to believe it
>would be that way a second time 'cause  same  hapenned to me  12V just for
>several seconds and is gone forever to the trash can.
>
> Eddy

Yes it's true and I have it right in front of me not to allow me to lie. :-)

Octavio
==============================================
Octavio Nogueira - spamBeGonenogueira@spam@spamspam_OUTpropic2.com ICQ# 19841898
  From the creator of ProPic,   ProPic 2  now much better
    New ProPic 2 homepage:    http://www.propic2.com
   PIC Programmer for Windows with down to earth price
==============================================

1998\11\25@075523 by paulb

flavicon
face
Brian Striggow wrote:

> Working at getting first PIC program going on 12c509, ...  By the time
> I had things going, it appeared that 3 output pins were dead.

> I seem to recall breadboarding a CMOS chip once, and in my enthusiasm
> to try the thing, I powered it up without tying down the spare inputs.
> Chip exploded, (post mortem indicated it was wired correctly).

 I can't believe this would occur from having un-tied inputs.  Chip
inserted upside-down perhaps, but *not* un-tied inputs.  Squib maybe!

 Compared to the rest of the list, this guy sounds accident-prone! ;-)
--
 Cheers,
       Paul B.

1998\11\25@132321 by Reginald Neale

flavicon
face
No, it's not foo-for-all, though it doesn't usually result in explosions.
Unpredictable behaviour is the most likely outcome. And the
unpredictability can show up on outputs that would not normally be
conditional on the floating inputs.

Reg Neale

>I seem to recall breadboarding a CMOS chip once, and in my enthusiasm to
>try the thing, I powered it up without tying down the spare inputs.  Chip
>exploded, (post mortem indicated it was wired correctly).  Previous to
>this experience, I had thought that the precaution to tie down stray
>inputs was foo-for-all.  Could this happen w/ the mclr pin which can't
>be configured as output??
>
>tnx
>bcs

'Re : Re: Unused bits of I/O ports'
1998\11\25@154219 by Spk41q

picon face
Hello,

Excuse me for this stupid question but , if you don't worry about
consommation, why not always put a generic value in SIL package (like 20 or
30K) connected to v+. In case of input, level is near V+ and if it is an
output 20K or 30K is not a big charge.

It's right, I have a old and critical thought about CMOS. And for industrial
purpose I'm very critical.

Dan

'Unused bits of I/O ports'
1998\11\30@190030 by Marc

flavicon
face
> > I seem to recall breadboarding a CMOS chip once, and in my enthusiasm
> > to try the thing, I powered it up without tying down the spare inputs.
> > Chip exploded, (post mortem indicated it was wired correctly).
>
>   I can't believe this would occur from having un-tied inputs.  Chip
> inserted upside-down perhaps, but *not* un-tied inputs.  Squib maybe!

I have burned CMOS chips similar to poster above, too. In my case the
problem was latch-up.  The chips were custom and never sold other than
soldered onto the PCB they belong to. I think, for that reason they
didn't spend money on latchup protection.

The chips lost all their smoke that manufacturers try so hard to put
into them. Obviously they didn't work anymore without..

PICs are different - I have successfully powered one of them via
its IO pins in an experimential single sided layout (no vias, no fit).
It's not recommended design practice though :-)


'Unused PIC pins tied to ground - Input or Output?'
1999\01\13@122704 by Adam Bryant
flavicon
face
I have a PCB that I made last night that ties several unused PIC pins to
ground.  Should I set the corresponding port for these pins as input or
output?  I know that normally when the unused pins are NOT tied to V+ or
ground that the recommendation is to set the port as output and drive it
low, but in this case it would make more sense to me to set the pins as
input.

TIA,
Adam

1999\01\13@125748 by Dan Larson

flavicon
face
On Tue, 12 Jan 1999 09:05:22 -0700, Adam Bryant wrote:

>I have a PCB that I made last night that ties several unused PIC pins to
>ground.  Should I set the corresponding port for these pins as input or
>output?  I know that normally when the unused pins are NOT tied to V+ or
>ground that the recommendation is to set the port as output and drive it
>low, but in this case it would make more sense to me to set the pins as
>input.

By setting them up as ouputs and outputing a "0", you have effectively
grounded them internally with no outside connections!  This is what I do with
my unused pins.  If you leave them unconnected to the outside, then you
have the option later of making extra connections to them without having to
grind off the PC board traces that they are grounded to.

Dan


>
>TIA,
>Adam
>

1999\01\13@134729 by Ohtsji, Randie

flavicon
face
Make them inputs, then you won't  burn up your PIC when you accidentally
drive them high (this happens...it's called Murphy).

Randie
TakeThisOuTrandie.ohtsjispamspamglenayre.com
ICQ:28273278


{Original Message removed}

1999\01\13@165320 by Tony Nixon

flavicon
picon face
If you leave these pins set as inputs, then make sure you have pullup or
pull down resistors for them, or you will have floating inputs.

You may get some wierd problems.


--
Best regards

Tony

Multimedia 16F84 Beginners PIC Tools.
** NEW PicNPro Programmer and Port Interface **

http://www.picnpoke.com
Email picnpokeEraseMEspamcdi.com.au

1999\01\13@180943 by andre

flavicon
face
Adam Bryant wrote:

> I have a PCB that I made last night that ties several unused PIC pins to
> ground.  Should I set the corresponding port for these pins as input or
> output?

if the pin is grounded then you should make them input

or make them output  without grounding  them

>  I know that normally when the unused pins are NOT tied to V+ or
> ground that the recommendation is to set the port as output and drive it
> low, but in this case it would make more sense to me to set the pins as
> input.
>
> TIA,
> Adam

 Andre Abelian

1999\01\14@033707 by paulb

flavicon
face
Adam Bryant wrote:

> I have a PCB that I made last night that ties several unused PIC pins
> to ground.

 You proceed to ask the *wrong* question!  The *most important*
question is: "*Why* did you make a PCB that ties PIC port pins to
ground?"  In doing so, you have introduced a potential problem should
one or more of these pins accidentally be defined as an output (in the
TRIS register; defaults to Input) and set to "1".

> Should I set the corresponding port for these pins as input or output?

 Input, in the event.  Write a zero to the port also just in case.

>  I know that normally when the unused pins are NOT tied to V+ or
> ground that the recommendation is to set the port as output and drive
> it low, but in this case it would make more sense to me to set the
> pins as input.

 The recommendation is:  It is *safest* to NOT tie to ground or VCC,
other than through a resistor (of several if not a hundred k ohm).

 I'm sure we'd all like to know *why* you tied them?

 The *second* reason you don't tie them to ground is that they are a
valuable resource - you are *extremely* likely to want to do something
"extra" and modify the design; you have now snookered yourself.  One
more thing - unused pins are great for testing your designs with
indicator LEDs.
--
 Cheers,
       Paul B.

1999\01\16@121941 by dave vanhorn

flavicon
face
At 09:05 AM 1/12/99 -0700, Adam Bryant wrote:
>I have a PCB that I made last night that ties several unused PIC pins to
>ground.  Should I set the corresponding port for these pins as input or
>output?  I know that normally when the unused pins are NOT tied to V+ or
>ground that the recommendation is to set the port as output and drive it
>low, but in this case it would make more sense to me to set the pins as
>input.
>
>TIA,
>Adam


Input, or output low. Tying them low was a bad idea. Much better to float
them, then set them as output low or high.
If you need a pin later for something you forgot, you can then just wire to
it, and hack the software.
Setting the pins as input means that they must be tied to a logic level, or
you will draw a lot more current than normal.

'Unused PIC Pins - What to do with them?'
1999\01\16@213635 by Geoff Thornton

flavicon
face
Piclisters I have been following the thread "Unused PIC Pins tied to
Ground - Input or output" with some interest as I am new to PICs, and admit
the thread has left me somewhat confused. What exactly is the recommended
procedure for dealing with uncommited PIC pins?


Regards Geoff :)
==================
RemoveMEgeoffEraseMEspamspam_OUTtechie.com

1999\01\16@223734 by paulb

flavicon
face
Geoff Thornton wrote:

> What exactly is the recommended procedure for dealing with uncommited
> PIC pins?

 Well, firstly, the thing *not* to do is to tie them to VCC or ground.

 If you don't want to connect them to *anything*, make them outputs.
It is probably not too critical what you write to them.

 They default to inputs.  If they are on Port B and it suits you to
do so, just leave them as inputs and turn on the Port B pull-ups.  These
pull-ups only apply to inputs so if they happen to be re-defined as
outputs, there will be no current drain either way unless you connect
something else.

 If you think you *may* want to use them later as inputs, and you will
not be using port B pull-ups, you may want to tie them high with a SMD
resistor in the meantime and leave them as inputs.

 If you have one or two pins quite uncommitted, why not add a SMD LED
and series current limit resistor (4k7 or 10k).  Then you can either use
this as a COP (Computer Operating Properly) indicator flashing at 1 Hz
when the main program is executing correctly, or have it flash at
critical points, or flash codes as a diagnostic while debugging the
program.

 Have I missed anything?
--
 Cheers,
       Paul B.

1999\01\17@065033 by Andy Stephenson

flavicon
face
Leave them unconnected.

Do not connect them to VDD or VSS.

If you have room / cost add a pull up or pull down res. You don't have to
fit them in the final unit, but if you suddenly need a switch input - it's
there waiting for you.

If you choose to leave the lines totally unconnected, set them as outputs
in your software.

By doing this, you give yourself room for manouver (...spelling?) to catch
any last minute fixes.

Just my ten cents.

Rgds...

...Andy
At 12:33 17/01/99 +1000, you wrote:
{Quote hidden}

1999\01\17@070941 by Gerhard Fiedler

picon face
At 14:35 01/17/99 +1000, Paul B. Webster VK2BZC wrote:
>Geoff Thornton wrote:
>
>> What exactly is the recommended procedure for dealing with uncommited
>> PIC pins?
>
>[almost complete comments snipped :-)]
>
>  Have I missed anything?

what i usually do with a free pin (without emulator) is using it as a
serial out (which can be done pretty lowscale, if not intended for
production), and then put debugging messages out there. even if there's no
space for serial comms with the complete code, it's handy for testing parts
of the code separately and quite conveniently.

ge

1999\01\18@022809 by ruben

flavicon
face
I always leave unused pins unconnected and configured as outputs. That way
it is easy to use them for something (mostly debugging) that wasn't planed
at the beginning. This, I think, is common practice. What I also do, and
have not seen mentioned here before, is to frequently read the value of the
outport and write it back. This way the pin won't be destroyed if it is
forced low when written high (short circuit to ground or something), instead
the pin state is switched to whatever it is forced to externaly.

{Quote hidden}

==============================
Ruben Jvnsson
AB Liros Elektronik
Box 9124, 200 39 Malmv, Sweden
TEL INT +4640142078
FAX INT +4640947388
@spam@rubenspam_OUTspam.....2.sbbs.se
==============================

1999\01\18@122419 by Gabriel Gonzalez

flavicon
face
Basically, leave them unconnected, but set them as outputs in software.

Gabriel

-----Original Message-----
From: Geoff Thornton <spamBeGonegeoffEraseMEspamTECHIE.COM>
To: PICLISTspamBeGonespamMITVMA.MIT.EDU <RemoveMEPICLIST@spam@spamspamBeGoneMITVMA.MIT.EDU>
Date: Saturday, January 16, 1999 7:31 PM
Subject: Unused PIC Pins - What to do with them?


>Piclisters I have been following the thread "Unused PIC Pins tied to
>Ground - Input or output" with some interest as I am new to PICs, and admit
>the thread has left me somewhat confused. What exactly is the recommended
>procedure for dealing with uncommited PIC pins?
>
>
>Regards Geoff :)
>==================
>.....geoff@spam@spamEraseMEtechie.com

1999\01\25@140300 by John Payson

flavicon
face
|Piclisters I have been following the thread "Unused PIC Pins tied to
|Ground - Input or output" with some interest as I am new to PICs, and
|admit the thread has left me somewhat confused. What exactly is the
|recommended procedure for dealing with uncommited PIC pins?

With two caveats, typing them directly to ground is a bad idea; leaving
them open and setting them to outputs is the beast idea.

Caveat number 1: if the device will spend any significant amount of time
in a 'reset' state and is running off of batteries (or there is some
other reason why minimal-power operation is desirable) the device may use
more power than normal because of the floating port pins.  Note that this
caveat does not apply to analog-configurable pins on devices which have
them (such as the 16C62x and 16C7x).

Caveat number 2: The RTCC pin on the 16C5x is input-only, and on the other
PICs, the pin (RA4/TMR0) is open-collector and can only output a low sig-
nal.  Thus, on the 16C5x RTCC should probably be tied to either ground,
VDD, or /MClr if it's not used for anything else; on the 16Cxx you may
safely ground the pin or tie it to /MClr if you don't mind being unable to
use it for a 'debug' or future expansion.

If you are concerned about power consumption while the device is in reset,
or if pin RA4/TMR0 may be wanted as an output, using individual pull-up
resistors to VDD may be the best way to go if the cost and space are not
objectionable.  If you are using resistor packs to pull up other inputs
and you have extra resistors available, you may as well take advantage.

1999\01\26@041557 by paulb

flavicon
face
Ruben Jšnsson wrote:

> What I also do, and have not seen mentioned here before, is to
> frequently read the value of the outport and write it back.

 I would say you have not seen it mentioned before because most would
consider it a Bad Thing.  It's a rather bizarre design philosophy to
set outputs to match glitches, and the most important lesson learned
about the PIC is to avoid read-modify-write operations like the plague!

> This way the pin won't be destroyed if it is forced low when written
> high (short circuit to ground or something), instead the pin state is
> switched to whatever it is forced to externaly.

 Good design focusses on making sure that will never happen.  If you
think it *may* happen, you use current-limiting resistors.  You might
perhaps read the port and if it is stuck opposite to what was written,
TRIS it to an input and send out a fault message.

 Otherwise, your suggested read may pick up a glitch and write the
output wrongly so that it does the very thing you were trying to avoid.
--
 Cheers,
       Paul B.

1999\01\26@084554 by ruben

flavicon
face
Well, this trick has saved me many windowed PIC's when I am in the
breadboard stage of a new design. At the beginning of a new project
I usually start with only part of the complete circuit leaving me
a lot of unused I/O pins. When I have got the core of the software
working I add more hardware and software bit by bit until the whole
thing is finished. Between the first stage and the finished working
prototype is mostly a lot of testing and changing of both hardware
and software. Needless to say, it has happened more than once that
an unused or used output by accident has been connected to a low
impedance source. The read and write back, especially on unused I/O's
set as outputs, saves the PIC in this case.

Another case where the read and write back is useful is when doing
fault mode and effects analysis on some type of safety circuits. Here
it is sometimes required to test and document what is happening when
shorting every pin on one IC with every other pin on the same IC. The
read-modify-write has saved many circuits here. A current limiting
resistor wouldn't help much in this case.

Bad design philosophy, however, is to let glitches affect your program
flow. When reading I/O's I always make sure, by good circuit design,
hardware and/or software filters, that what is read is not a glitch.
(I can't say that I have ever seen a glitch affect an unused,
unconnected I/O pin set as an output anyway.)

Things to watch out for with read-modify-write:
High load on an output pin. If the load is so high that the voltage
on an high output pin is not higher than the pin is read back as low
it won't work.

Settling time. Especially with capacitive load.
If a portpin is changed and the output is read back before
it is settled there will be no change.


With these things in mind I will happily continue my
read-and-write-back scheme, which has saved me more than
it has caused me trouble.

{Quote hidden}

==============================
Ruben Jvnsson
AB Liros Elektronik
Box 9124, 200 39 Malmv, Sweden
TEL INT +4640142078
FAX INT +4640947388
.....rubenRemoveMEspam2.sbbs.se
==============================


'Unused PIC Pins - What to do with them?'
1999\02\10@080117 by electme
flavicon
face
ruben ,
where you said
"What I also do, and
have not seen mentioned here before, is to frequently read the value of the
outport and write it back. This way the pin won't be destroyed if it is
forced low when written high (short circuit to ground or something), instead
the pin state is switched to whatever it is forced to externaly."

thats a good idea.
how do you do it .for 16f84 & 12c508
glen
*******
Ruben Jšnsson wrote:

{Quote hidden}

1999\02\11@021954 by ruben

flavicon
face
Hello Glen,

This is mostly taken care of automatically (even if You want it or not)
by the read/modify/write function of I/O pins of all PIC processors.
That is, when you modify a pin in a port by clearing or seting a bit, the
whole port byte is first read, the bit is updated and the whole byte is
written back to the port. When the port value is first read it is the
logical level on the pin that is read and not the output latch in the PIC.

If You have unused output pins in a port and want them to follow what ever they
are externaly forced to just make sure You update another bit in the
port often enough without explicitly seting the unused output bit. If no bit in
port is modified often enough this can be done by MOV PORT_X,f which reads
the portvalue and writes it back again. Any forced output pins will then
change state. Be ware, though, that this may have unwanted effects on used
IO pins which shouldn't be allowed to change it's state. To overcome this,
use a shadow register in ram for the port and whenever the portvalue is to
be updated, modify it first in the shadow register, read the portvalue,
mask off the used pins, OR the result with the shadow register (which
should have the unused bits set to 0) and write it back to the port.
This way only the unused pins will change their state to whatever they are
forced to externaly.

Good luck

{Quote hidden}

==============================
Ruben Jvnsson
AB Liros Elektronik
Box 9124, 200 39 Malmv, Sweden
TEL INT +4640142078
FAX INT +4640947388
RemoveMErubenspamspamBeGone2.sbbs.se
==============================

'filling unused code space'
1999\02\16@141238 by Harold Hallikainen

picon face
On Mon, 15 Feb 1999 14:42:04 -0600 John Payson <spamBeGonesupercatKILLspamspam@spam@CIRCAD.COM>
writes:

>
>Note that on the 17Cxx parts, a blank program location corresponds
>to a CALL instruction, but on all the 12- and 14-bit parts it will
>leave the PC and related registers alone.
>

       Back when I did stuff with the MC6802, I filled all unused code
space (and initialized all RAM) to 0x3f, which was a "software
interrutp".  If the program counter ended up on one of these locations,
it would vector to the initialization code and restart the machine (the
SWI vector was set the same as the RESET vector in ROM).
       Is there a way to do something similar on the PIC (specifically a
16c61)?  It seems that perhaps high ROM locations could be filled with
nops, then the PC would just roll around to the reset vector.
       Is there a way in MPASM to tell it to fill unused ROM with a
specific instruction?

Harold



Harold Hallikainen
haroldspam_OUTspam@spam@hallikainen.com
Hallikainen & Friends, Inc.
See the FCC Rules at http://hallikainen.com/FccRules and comments filed
in LPFM proceeding at http://hallikainen.com/lpfm

___________________________________________________________________
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/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]

1999\02\16@142142 by dave vanhorn

flavicon
face
>        Back when I did stuff with the MC6802, I filled all unused code
>space (and initialized all RAM) to 0x3f, which was a "software
>interrutp".  If the program counter ended up on one of these locations,
>it would vector to the initialization code and restart the machine (the
>SWI vector was set the same as the RESET vector in ROM).
>        Is there a way to do something similar on the PIC (specifically a
>16c61)?  It seems that perhaps high ROM locations could be filled with
>nops, then the PC would just roll around to the reset vector.
>        Is there a way in MPASM to tell it to fill unused ROM with a
>specific instruction?


Wouldn't JMP Start suffice (or whatever you call the beginning of your
code), which is where the reset vector will take it anyway?

1999\02\16@162519 by Gerhard Fiedler

picon face
At 14:18 02/16/99 -0500, dave vanhorn wrote:
>Wouldn't JMP Start suffice (or whatever you call the beginning of your
>code), which is where the reset vector will take it anyway?

why not leave it unprogrammed, as somebody suggested before (so you can add
something in case you need it)? that's something like ADDLW FFh (on the
14bitters) and either it wraps around to reset, or you put a "jmp here"
endless loop at the end and let it get hit by the watch dog. which seems to
be the proper way to do it.

ge

1999\02\16@164210 by dave vanhorn

flavicon
face
At 01:17 PM 2/16/99 -0800, Gerhard Fiedler wrote:
>At 14:18 02/16/99 -0500, dave vanhorn wrote:
>>Wouldn't JMP Start suffice (or whatever you call the beginning of your
>>code), which is where the reset vector will take it anyway?
>
>why not leave it unprogrammed, as somebody suggested before (so you can add
>something in case you need it)? that's something like ADDLW FFh (on the
>14bitters) and either it wraps around to reset, or you put a "jmp here"
>endless loop at the end and let it get hit by the watch dog. which seems to
>be the proper way to do it.

Depends on the system, I can see leaving a block of codespace somewhere
blank, but you aren't going to need inbetween routines, since you can't get
there anyway.  Everything I work on at the moment is flash, so I'm not
likely to need to go burn a single byte change anywhere, that would be more
work than reloading the whole codespace.

You may not have a watchdog.. Our financial systems don't. We determined
that a watchdog couldn't possibly stop the processor before it peed all
over the data, if it wanted to, and so we used JMP 0 equivalents to force a
reset.

1999\02\16@171028 by Tony Nixon

flavicon
picon face
> 16c61)?  It seems that perhaps high ROM locations could be filled with
> nops, then the PC would just roll around to the reset vector.

That probably isn't necessary in this scenario. If the chip is properly
blank tested before programming then 12 bit chips have FFF which is
XORLW 0xFF and 14 bit chips have 3FFF which is ADDLW 0xFF.
The same thing would happen.


--
Best regards

Tony

Multimedia 16F84 Beginners PIC Tools.
** NEW PicNPro Programmer and Port Interface **

http://www.picnpoke.com
Email spamBeGonepicnpoke@spam@spamcdi.com.au

1999\02\17@072018 by Alan Nickerson

flavicon
face
"peed all over the data", Must be a technical term... :)

Alan

-----Original Message-----
From: dave vanhorn <RemoveMEdvanhornEraseMEspamKILLspamCEDAR.NET>
To: spamBeGonePICLISTspam_OUTspamRemoveMEMITVMA.MIT.EDU <.....PICLISTspamRemoveMEMITVMA.MIT.EDU>
Date: Tuesday, February 16, 1999 4:44 PM
Subject: Re: filling unused code space


>At 01:17 PM 2/16/99 -0800, Gerhard Fiedler wrote:
>>At 14:18 02/16/99 -0500, dave vanhorn wrote:
>>>Wouldn't JMP Start suffice (or whatever you call the beginning of your
>>>code), which is where the reset vector will take it anyway?
>>
>>why not leave it unprogrammed, as somebody suggested before (so you can
add
>>something in case you need it)? that's something like ADDLW FFh (on the
>>14bitters) and either it wraps around to reset, or you put a "jmp here"
>>endless loop at the end and let it get hit by the watch dog. which seems
to
{Quote hidden}

1999\02\17@094030 by dave vanhorn

flavicon
face
At 07:19 AM 2/17/99 -0500, Alan Nickerson wrote:
>"peed all over the data", Must be a technical term... :)


Sorry, I try not to get too technical. :)

1999\02\17@105353 by Alan Nickerson

flavicon
face
I just thought it was funny.

-----Original Message-----
From: dave vanhorn <dvanhornspam@spam@CEDAR.NET>
To: EraseMEPICLISTRemoveMEspamSTOPspamMITVMA.MIT.EDU <RemoveMEPICLISTKILLspamspamTakeThisOuTMITVMA.MIT.EDU>
Date: Wednesday, February 17, 1999 9:42 AM
Subject: Re: filling unused code space


>At 07:19 AM 2/17/99 -0500, Alan Nickerson wrote:
>>"peed all over the data", Must be a technical term... :)
>
>
>Sorry, I try not to get too technical. :)
>

'Unused pins'
1999\02\18@204941 by Biswanath Dutta

flavicon
picon face
Hi Everyone,

I can understand that unused input pins can pick up signals if left
floating.

But how is it that outputs and the working of the software affected if
the inputs are unused in the software ?.

Biswanath

1999\02\19@121502 by John Payson

flavicon
face
|I can understand that unused input pins can pick up signals if left
|floating.

|But how is it that outputs and the working of the software affected if
|the inputs are unused in the software ?.

The software isn't likely to care about floating inputs if it
never reads them.  From my experience with the PICs, the only
bad effect of leaving an input floating is that it will cause
a slight increase in device power consumption; even this will
probably not be noticeable except in LP-mode "fleapower" app-
lications (when trying to run forever off a battery, there's a
big difference between 50uA and 250uA; if the PIC is taking 3mA,
however, adding another 0.2mA won't make much difference.

1999\02\19@213122 by Biswanath Dutta

flavicon
picon face
I was actually thinking about the problem recently posted by John Esposito
"Hardware or Software Problem ???"
The problem was solved gounding all unused input pins.

John Payson wrote:

{Quote hidden}

1999\02\20@023538 by Quentin

flavicon
face
Biswanath Dutta wrote:
>
> I was actually thinking about the problem recently posted by John Esposito
> "Hardware or Software Problem ???"
> The problem was solved gounding all unused input pins.
>
Posible the problem was somewhere else. I also use a breadboard for
prototyping and I never had a problem with floating pins. Sometimes I
only use PortA and set Port B as outputs. No problem.
Another thing I can think of is where your Tris instruction is in the
program. My first instruction is to set the unused pins. I don't touch
them again after that.

Quentin

'filling unused code space'
1999\02\20@082411 by paulb

flavicon
face
Alan Nickerson wrote:

> I just thought it was funny.

> From: dave vanhorn <spamBeGonedvanhornspam@spam@CEDAR.NET>
>>> "peed all over the data", Must be a technical term... :)
>> Sorry, I try not to get too technical. :)

 We all did.

Harold Hallikainen wrote:

> Is there a way to do something similar on the PIC (specifically a
> 16c61)?  It seems that perhaps high ROM locations could be filled with
> nops, then the PC would just roll around to the reset vector.
> Is there a way in MPASM to tell it to fill unused ROM with a specific
> instruction?

 And I think we came to the conclusion that this was already done for
us.  Depending on the µC "core", the instructions "ADDLW -1" and
"XORLW -1" are about as close to a NOP as you'd need.  They cause no
branch, no port alterations, repeated execution simply decrements or
complements W respectively on each cycle and within 1mS (for 1000
instructions at 4MHz) you wind through the unused memory and hit the
*reset* entry point within one eighteenth of the watchdog timeout
interval.

 The comment that this may take "too long" to happen is a little na•ve
as it seems to me.  Something *real bad* has happened to the system to
get here, concerns that it may slow the system down are a little too
late!

 So you can forget it.  Just make sure that the reset code iniitialises
all things that need initialisation, or if you like, code the very last
location with "GOTO $" (or variations involving page select) and let the
WDT run out.
--
 Cheers,
       Paul B.


'How to Setting Unused Pins ver VERY low power apps'
1999\06\11@152543 by William K. Borsum
flavicon
face
Greetings All:
Today's Question
What is the best way to treat unused pins on a PIC for absolutely lowest
possible power consumption? (and the theory behind your choice please).

Options are:    output, drive hi, no termination
               output, drive lo, no termination
               input with pullup
               input with pulldown
               input floating (not really an option--pin will oscillate sometim
es)

Some thoughts from my end:
1. Inputs require a pull-up or -down resistor, possibly in the megohm
range, but still some current flow, plus an extra part.
2. Outputs don't require external parts, but with big ground planes and
potential board leakage, driving low might be the best.  However, most of
the programmers I have used tend to drive the pins hi.

So What is the consensus?
kelly
****************************************************************************
********
All legitimate attachments to this email will be clearly identified in the
text.
William K. Borsum, P.E.
OEM Dataloggers and Instrumentation Systems
<RemoveMEborsumspam_OUTspamdascor.com> & <http://www.dascor.com>

1999\06\11@153210 by Jamil J. Weatherbee

flavicon
face
I talked to microchip tech support at one time about this, there really is
no concensus, because if your device is held in reset all the pins are in
tristate so i suppose it could draw lots of power.

The most economical, and safe from a software perspective seems to be just
configuring them as outputs.  Next to that probably putting a 100k
resistor to ground and configuring as outputs with latches low.  The 100k
resistors take care of having a tristate input during reset/input during
startup.



On Fri, 11 Jun 1999, William K. Borsum wrote:

> Greetings All:
> Today's Question
> What is the best way to treat unused pins on a PIC for absolutely lowest
> possible power consumption? (and the theory behind your choice please).
>
> Options are:    output, drive hi, no termination
>                 output, drive lo, no termination
>                 input with pullup
>                 input with pulldown
>                 input floating (not really an option--pin will oscillate somet
imes)
{Quote hidden}

'How to Set Unused Pins for VERY low power apps?'
1999\06\11@161358 by William K. Borsum

flavicon
face
This brings up another question:
For inputs that occasionally have external inputs plugged in, but are
otherwise normally disconnected from external voltages, should the default
be pull-UP or pull-DOWN resistors on the input pins?  Again, the object is
to absolutely minimize power draw. Based on the arguments below, a
pull-down might seem best--assuming the external voltage sources and the
PIC code don't care.

Any more thoughts?



{Quote hidden}

sometimes)
>>
>> Some thoughts from my end:
>> 1. Inputs require a pull-up or -down resistor, possibly in the megohm
>> range, but still some current flow, plus an extra part.
>> 2. Outputs don't require external parts, but with big ground planes and
>> potential board leakage, driving low might be the best.  However, most of
>> the programmers I have used tend to drive the pins hi.

****************************************************************************
********
All legitimate attachments to this email will be clearly identified in the
text.
William K. Borsum, P.E.
OEM Dataloggers and Instrumentation Systems
<spam_OUTborsumspam_OUTspamspam_OUTdascor.com> & <http://www.dascor.com>

1999\06\11@182130 by Jamil J. Weatherbee

flavicon
face
To support the pull-down resistor argument
on my 16c73a the Vol is 0.6V max wheras Voh is Vdd-0.7V
i think this would be because of differences in the complementary fets in
the totem pole outputs.

so a pull down resistor with 0.6v would consume 15% less power than the
same resistor used as a pullup



On Fri, 11 Jun 1999, William K. Borsum wrote:

{Quote hidden}

'How to Setting Unused Pins ver VERY low power apps'
1999\06\12@022030 by Ernie Murphy

flavicon
face
Another 2 cents worth...

 The project currently on my bench will have such an unused input in some
configurations, hence I've been musing about this. Here are the 6 (well, 8)
choices:

1) input, no resistor:  Bad, bad, very bad. Oscillation isn't really the
problem here (who cares how an unused pin changes), but the possibility it
will drift to Vcc/2 and hence turn on 2 fets from rail to rail is the scary
thing.

2) input with pull-up: OK, make the pullup the largest value you dare. Megs
would be OK in most enviroments. Dissipation will be practically zero.

3) input with pull-down: same as pull-up.

4) output no resistor: zero component count. Again no disipation for either
output state. Only danger is if the board is somehow shorted pin to pin. If
this is possible, perhaps one would use the same hi or lo state as the
adjacent pins to minimize uncontrolled short current.

5) output with pulldown: Adds a component for no reason. A high value
resistor will of cource be chosen... which is in parallel with the low
impeadance output stage... in the equivalent circuit the resistor drops
out. So why use it?

6) output with pullup: same as #5

I'm of course assuming a pulled-up output will be driven high, and
pulled-down driven low (ah, there are numbers 7 & 8). To cross these is to
just waste power. Incidentally, pulling up a high output will disipate zero
current, as the output only has its .7 drop from the rail IF there is
current being pulled out of it. No current, no drop. High outputs source
current, not sink it.

My choice is #4, output with no resistor. Since my free pin is next to the
ground pin, thats where I nailed it... output in the zero state.




At 12:24 PM 6/11/99 -0700, you wrote:
>Greetings All:
>Today's Question
>What is the best way to treat unused pins on a PIC for absolutely lowest
>possible power consumption? (and the theory behind your choice please).
>
>Options are:    output, drive hi, no termination
>                output, drive lo, no termination
>                input with pullup
>                input with pulldown
>                input floating (not really an option--pin will oscillate
sometimes)
{Quote hidden}


'CCS and "Unused fragments" in code space'
1999\07\14@113806 by Antonio Pasini
flavicon
face
I'm striving with a very common problem: fitting
a BIG program in a tight space. Seems a common one, right ? :-)

I'm using the CCS compiler v2.666.

How can I reorganize my sources in order to minimize the
"unused fragments" that the compiler reports ?

I get this:

------------------------------ (cut)
              ROM used: 3144 (77%)
                        3441 (84%) including unused fragments
              RAM used: 86 (45%) at main() level
                        103 (54%) worst case
              Stack:    6 worst case (5 in main + 1 for interrupts)
------------------------------ (cut)

I can imagine some problem of segment alignment, or bank switching
overhead.
But even cutting/pasting some code around, I could'nt manage to reduce
that.
Commenting some of the more heavy functions reduces that. But
I can't find a pattern, in that practice.

What are the most common causes of this "waste" of space ?

1999\07\14@115044 by Michael Rigby-Jones

flavicon
face
> I'm striving with a very common problem: fitting
> a BIG program in a tight space. Seems a common one, right ? :-)
>
> I'm using the CCS compiler v2.666.
>
Hmmm...I think the minor revision number says it all, right Andy? :o)

Cheers

Mike Rigby-Jones

1999\07\14@120513 by Andy Kunz

flavicon
face
At 04:44 PM 7/14/99 +0100, you wrote:
>> I'm striving with a very common problem: fitting
>> a BIG program in a tight space. Seems a common one, right ? :-)
>>
>> I'm using the CCS compiler v2.666.
>>

HOOO HOOO!!!!!

Say, that's only about 400 revisions since I gave up on it (seriously).

Andy

==================================================================
Andy Kunz               Life is what we do to prepare for Eternity
------------------------------------------------------------------
andyspamBeGonespam.....rc-hydros.com      http://www.rc-hydros.com     - Race Boats
KILLspamandyspam.....montanadesign.com  http://www.montanadesign.com - Electronics
==================================================================

1999\07\15@005940 by Darrell Flenniken

picon face
I>'m striving with a very common problem: fitting
>a BIG program in a tight space. Seems a common one, right ? :-)

>I'm using the CCS compiler v2.666.

>How can I reorganize my sources in order to minimize the
>"unused fragments" that the compiler reports ?


You can use the #separate pragma to force the compiler NOT to inline small
functions.

Split large functions into smaller chunks. Use #separate or the compiler may
inline a function that is called only once.

Avoid 16 bit math.

Use any hack tricks you can think of that will save space.


{Quote hidden}

I> can't find a pattern, in that practice.

>What are the most common causes of this "waste" of space ?

This not wasted space. It's space unused on an unfilled code bank.  The
compiler splits up the
object code and places it onto multiple banks when the code will not all fit
on one bank.  The granularity is function -- all code for a function must
fit on one bank  (code for multiple functions is packed onto banks).

If the compiler cannot find a free space on a bank large enough for a
function, it will fail to generate object code.

Don't worry until compiler tells you you are out of space.  Then you may
have to decompose functions into smaller chunks.


Darrell ... using 97% of a 16C66 (8K words)

'CCS and unused fragments'
1999\07\15@022806 by Antonio Pasini

flavicon
face
Oops!
Sorry, I found a page on the manual describing this. Didn't see that on
the first try.


'How to Setting Unused Pins ver VERY low power apps'
1999\09\30@103321 by Larry G. Nelson Sr.
flavicon
face
Output drive High or Low depending on what they are attached to. I just did
a project where we were using the pin as an input to look for a slow
transition (analog ramp) and the power consumption was much higher when the
port was an input. I set it to output for lower power and switched to input
to test then back to output to reduce power.


At 12:24 PM 6/11/99 -0700, you wrote:
>Greetings All:
>Today's Question
>What is the best way to treat unused pins on a PIC for absolutely lowest
>possible power consumption? (and the theory behind your choice please).
>
>Options are:    output, drive hi, no termination
>                output, drive lo, no termination
>                input with pullup
>                input with pulldown
>                input floating (not really an option--pin will oscillate
sometimes)
{Quote hidden}

Larry G. Nelson Sr.
RemoveMEL.NelsonRemoveMEspamEraseMEieee.org
http://www.ultranet.com/~nr


'Unused Ports'
1999\10\26@091409 by HJ Simpson
flavicon
face
Does anyone have an pinion on what to do with unused ports?
Make them outputs and leave floating, and set or clear?
Make them inputs and pull up or pull down?
And.... speaking of inputs, what do think is best, pull up and input as
a clear, or pull down and input as a set?
Opinions gratefully received.
Regards Howard.

1999\10\26@092449 by jamesp

picon face
Howard,

Personally, I make them outputs and leave them in the high
state.  I think this is a carry over from TTL days and just
didn't get changed in my mindset.  I really believe that it
as a matter of personal opinion on which way to treat them.
The thing in CMOS is don't let them go unterminated.  You
must do something with them.  If left floating and not
terminated in some way, they can toggle with adjacent pins
and cause power consumption to go up, they can cause programs
to go astray if they are read and not dealt with, and a whole
list of other reasons that are too numerous to list here.
Suffice it to say as long as you terminate unused ports in
some way that makes sense to you and the application, and as
long as they are dealt with in the program if need be, then
it's just a matter of personal taste, and application
functionality and possible future expansion, etc. that will
determine which way to terminate them is best (better) for
that particular application.  I know I've been a little long
winded here, but I hope you understand what it is I'm trying
to say. If there is anything here you have questions on, let
me know and I'll try to calrify.

                                       Regards,

                                        Jim




>Does anyone have an pinion on what to do with unused ports?
>Make them outputs and leave floating, and set or clear?
>Make them inputs and pull up or pull down?
>And.... speaking of inputs, what do think is best, pull up and input as
>a clear, or pull down and input as a set?
>Opinions gratefully received.
>Regards Howard.
>

1999\10\26@102319 by paulb

flavicon
face
HJ Simpson wrote:

> Does anyone have an pinion on what to do with unused ports?

 It's a FAQ.  Make them outputs.  Set them low.  On the PCB, track them
to a little pad and hole to attach things to later if desired.

> And.... speaking of inputs, what do think is best, pull up and input
> as a clear, or pull down and input as a set?

 It is generally most convenient for switches to return to ground and
use pull-ups.  Port B has internal pull-ups available for this purpose.
--
 Cheers,
       Paul B.

1999\10\26@140322 by Dave VanHorn

flavicon
face
> Make them outputs and leave floating, and set or clear?

As long as they are not tied to circuitry, this is my most preferred option.

> Make them inputs and pull up or pull down?

This works, as long as activation of the inputs won't cause the SW any
grief.
The chip will draw more current if inputs are just left floating.

> And.... speaking of inputs, what do think is best, pull up and input as
> a clear, or pull down and input as a set?

For unused, I don't see that it matters.

1999\10\26@205555 by Roberto Fernandes T Neto

flavicon
face
part 0 722 bytes content-type:text/x-vcard; charset=us-ascii; (decoded 7bit)

HJ Simpson wrote:

> Does anyone have an pinion on what to do with unused ports?
> Make them outputs and leave floating, and set or clear?
> Make them inputs and pull up or pull down?
> And.... speaking of inputs, what do think is best, pull up and input as
> a clear, or pull down and input as a set?
> Opinions gratefully received.
> Regards Howard.

Content-Type: text/x-vcard; charset=us-ascii;
name="tavaresneto.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Roberto Fernandes T Neto
Content-Disposition: attachment;
filename="tavaresneto.vcf"

Attachment converted: wonderland:tavaresneto.vcf 3 (TEXT/CSOm) (0000E809)

1999\10\27@093014 by eplus1

flavicon
face
The safest thing to do is to tie all unused pins to either ground or the
positive supply voltage using resistors, and leave them tri-stated (if they
are programmable i/o). Anything from about 1K to about 10K will work fine.
This way, if the pins get set to an unintended state (due to software bugs
or electrical noise or whatever), the chip will not be damaged because the
current will be limited by the resistor.

You could get rid of the resistors by just leaving the pins unconnected and
set as outputs, (high or low) but this leaves the possibility of the pins
floating while the chip is initializing, or in a fault situation in which
the pins are tristated unintentionally. It also introduces the (low but
real) possibility of the pin being shorted to the other supply rail and
causing functional failure or damage to the chip or supply.

The important thing is to avoid having a tri-stated (input) pin floating,
and to avoid having an output pin driven against an external connection so
that it exceeds its rated source/sink capability (or the combined
source/sink capability of the chip). Pull up or pull down resistors
eliminate both possibilities in all conditions. The worst than can happen is
accidentally driving an output against a pull up/down and thus wasting
power.

James Newton KILLspamjamesnewtonspamspamBeGonegeocities.com phone:1-619-652-0593
http://techref.homepage.com NOW OPEN (R/O) TO NON-MEMBERS!
Members can add private/public comments/pages ($0 TANSTAAFL web hosting)
PICLIST guide: http://204.210.50.240/techref/default.asp?url=piclist.htm


{Original Message removed}

1999\10\27@134440 by paulb

flavicon
face
Again the FAQ!

James Newton wrote:

> The safest thing to do is to tie all unused pins to either ground or
> the positive supply voltage using resistors, and leave them tri-stated
> (if they are programmable i/o).
> This way, if the pins get set to an unintended state (due to software
> bugs or electrical noise or whatever), the chip will not be damaged
> because the current will be limited by the resistor.

 *But*...  If you leave them unconnected, you certainly guarantee no
damage from unintended states.

> You could get rid of the resistors by just leaving the pins
> unconnected and set as outputs, (high or low)

 Best idea.  Allocate them pads for possible later use.  This satisfies
the design sensibilities of most of us who abhor waste!  And saves
resistors!

> but this leaves the possibility of the pins floating while the chip is
> initializing, or in a fault situation in which the pins are tristated
> unintentionally.

 Oh no!  You mean to say if the pin floats for a millisecond, the chip
will go up in smoke?  Shock!  Horror!

> It also introduces the (low but real) possibility of the pin being
> shorted to the other supply rail and causing functional failure or
> damage to the chip or supply.

 Why, but why, would this happen only to unused pins?  *Surely* it is
far more likely to happen to *used* pins?

> The important thing is to avoid having a tri-stated (input) pin
> floating,

 This is ludicrous!  So it might add a few dozen microamps to the
current draw.  Not half as much as if your suggested pull-up resistor
is accidentally pulled down by the same circumstance.

 Or do you propose this will "damage" the chip?  If so, why is it such
a popular concept, frequently advised, to use I/O pins to measure
analogue resistances or voltages?

> and to avoid having an output pin driven against an external
> connection so that it exceeds its rated source/sink capability (or the
> combined source/sink capability of the chip).

 Surely far more likely to happen to pins wired to other components?

> Pull up or pull down resistors eliminate both possibilities in all
> conditions.

 Rubbish!  If you can seriously conjecture a shorted pin, it's just as
likely to happen to a SMD resistor or SIL pack.

>  The worst than can happen is accidentally driving an output against a
> pull up/down and thus wasting power.

 33 k ohm resistors?  140 µA?  I suspect that's rather more than the
switching current of an input held at ¸ Vcc.

 Anyone got data on that though?
--
 Cheers,
       Paul B.

1999\10\27@171449 by eplus1

flavicon
face
Paul, I respect your opinions (and you are more than welcome to sign up on
my TechRef and post them along side mine) and I won't refer to them as
"rubbish" or "ludicrous" but,

1. Accidental grounding or energizing of an output pin (via a dropped pen or
paperclip, ill-formed trace, bent component lead, etc...) to the opposite
rail CAN smoke the chip and is far more likely (especially in the hands of a
newbie) than any other serious error. Yes, since most projects have more
used than unused pins, a short is more likely to happen to an in-use output
pin but, given equality in other areas, why increase the chance?

2. The cost of the resister is minimal to the projects that beginning PICers
will be turning out. Experienced production personnel, like yourself, can
weight the pros and cons and most likely already have decided to do FOR
THEMSELVES. A large value resistor, even left in place, will not prevent the
pin from being used if the production boards need a feature added by hand
later. I am trying to give the SAFEST advice possible for beginners here.
More than enough people will pressure them not to "waste" resistors.

3. Many low power PIC applications involve the chips power cycling,
sometimes rapidly. The power loss due to rapid switching of a tri-stated
input pin may be significant. I would like hard data also. No, rapid
switching will not fry the chip, and I didn't say it would.

4. By using very large value resistors (as I recommended), the current draw,
even if the pin is incorrectly set, will be negligible. A 100M resistor at 5
volts is 50nA IF set incorrectly. I have seen power consumption increase by
50mA when the pull-ups were removed from an unused port on an old Z80/PIO
project. Now, that was an old TTL (I think) PIO and there was a lot of RF
noise on that board so I doubt anything that extreme would happen on a
little PIC thing today. Data on PICs would be nice.

I also have another hidden reason for recommending the resistor that you
have, almost, hit upon. I have found that the last minute design change or
feature addition is the rule rather than the exception. I ALWAYS allocate
space to bring out every pin used or not. Getting inexperienced people in
the habit of placing that resistor makes them better prepared for the
reality of EE life. I know that on many occasions, people that I have
mentored have related that a last minute change was eased because they were
able to replace the resistor with another component or wire in a jumper to
satisfy the unforeseen need.

If non of that is compelling (and I doubt it is from your point of view),
may we agree to disagree and let each decide for themselves without getting
personal?

James Newton jamesnewtonspamspamgeocities.com phone:1-619-652-0593
http://techref.homepage.com NOW OPEN (R/O) TO NON-MEMBERS!
Members can add private/public comments/pages ($0 TANSTAAFL web hosting)
PICLIST guide: http://204.210.50.240/techref/default.asp?url=piclist.htm


{Original Message removed}

1999\10\27@182313 by Dave VanHorn

flavicon
face
> 4. By using very large value resistors (as I recommended), the current
draw,
> even if the pin is incorrectly set, will be negligible. A 100M resistor at
5
> volts is 50nA IF set incorrectly. I have seen power consumption increase
by
> 50mA when the pull-ups were removed from an unused port on an old Z80/PIO

This is a useless value for a pullup.
Electric field effects will dominate, and your "pulled up" input will be
bouncing all over the place.  Try something sane like 1-10k, which will
survive even near field E and H field events and usually remain in whatever
state you pulled it to.

Pullups on cmos inputs don't draw appreciable current.
NMOS Z80s are not CMOS, and they do draw current.

The safest, least cost method to secure unused pins is as outputs, low or
high.
Making them inputs adds ways for the code to have problems.
Shorting an output pin to the rails is not going to kill a chip. They will
simply output their max current into the load, and get slightly warm.

That being said, I would still put a resistor to ground on the schematic,
and not populate it, so that later, you can add things to those pins, using
the resistor pads.

1999\10\27@193333 by Robert A. LaBudde

flavicon
face
<x-flowed>At 05:22 PM 10/27/99 -0500, Dave wrote:
>That being said, I would still put a resistor to ground on the schematic,
>and not populate it, so that later, you can add things to those pins, using
>the resistor pads.

After watching all of this discussion, I have come to a personal conclusion
(as a neophyte, I admit) that the best solution appears to be to set all
unused pins to output HIGH with 10k pull-up resistors. This apparently has
the following benefits:

1. Defined state & non-floating.
2. No current flow (since at HIGH with pull-up).
3. Ready for future use on board.
4. Pull-up resistors are weak enough to overcome when used for a purpose.


================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: RemoveMEralspamBeGonespamRemoveMElcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

</x-flowed>

1999\10\27@215018 by Tony Nixon

flavicon
picon face
> > The important thing is to avoid having a tri-stated (input) pin
> > floating,
>
>   This is ludicrous!  So it might add a few dozen microamps to the
> current draw.  Not half as much as if your suggested pull-up resistor
> is accidentally pulled down by the same circumstance.

I don't think the current flow is the main problem here. A floating
input WILL cause erratic chip operation. Maybe not while you force it
to, but at some stage it will. I've had chips do all sorts of wierd
things, until I eliminated a floating pin (or pins). Some of these chips
froze just by placing a finger near them, some won't start, some start
but run 'funny'. The worst problem is spending mutitudes of time finding
out 'why', when you haven't realised the floating pin is the culprit. As
far as I know, the excess currents are caused by input FETS not knowing
what to do and the 'hi' and 'lo' ones turning on at the same time
causing minute rail to rail shorts, which could be at any frequency.
Surely this causes wonderful things to happen inside the die, false
triggering the brown out detect etc. - who knows?.

My opinion, is that there is some credibillity in using a moderate value
resistor to 'babysit' unused pins. Besides, there is your pin pad for
other uses if need be :-)


--
Best regards

Tony

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

1999\10\28@004140 by paulb

flavicon
face
James Newton wrote:

> 1. Accidental grounding or energizing of an output pin (via a dropped
> pen or paperclip, ill-formed trace, bent component lead, etc...) to
> the opposite rail CAN smoke the chip and is far more likely
> (especially in the hands of a newbie) than any other serious error.

 And statistically would be somewhat more likely to short to ground in
most designs.

> Yes, since most projects have more used than unused pins, a short is
> more likely to happen to an in-use output pin but, given equality in
> other areas, why increase the chance?

 I was not going on that basis (most pins already used) but rather on
the concept that the more trace and pads you have connected to any given
pin, the more likely to make a short.

> 2. The cost of the resister is minimal to the projects that beginning
> PICers will be turning out.

 Every piece counts.

> Experienced production personnel, like yourself,

 Oooh!  That *was* tongue-in-cheek!

> 3. Many low power PIC applications involve the chips power cycling,
> sometimes rapidly.  The power loss due to rapid switching of a
> tri-stated input pin may be significant.

 Indeed it could.

> I would like hard data also.

 Hopefully someone will actually *do* the experiment?

> A 100M resistor at 5 volts is 50nA IF set incorrectly.

 Dave's already taken you to task on that.  I don't think you really
meant it, did you?  I know for starters that you cannot get anywhere
near that value in SMD or SIL packs.  100k more likely.

> I have seen power consumption increase by 50mA when the pull-ups were
> removed from an unused port on an old Z80/PIO project.  Now, that was
> an old TTL (I think) PIO and there was a lot of RF noise on that board
> so I doubt anything that extreme would happen on a little PIC thing
> today.  Data on PICs would be nice.

 You have me at a loss for a mechanism on that one.  Dave too, it
seems, he has interpreted it the other way round I think.

> I also have another hidden reason for recommending the resistor that
> you have, almost, hit upon.

 Ah!  *NOW* you come clean!

>  I have found that the last minute design change or feature addition
> is the rule rather than the exception.  I ALWAYS allocate space to
> bring out every pin used or not.  Getting inexperienced people in the
> habit of placing that resistor makes them better prepared for the
> reality of EE life.  I know that on many occasions, people that I have
> mentored have related that a last minute change was eased because they
> were able to replace the resistor with another component or wire in a
> jumper to satisfy the unforeseen need.

 Good thinking 99.

Robert A. LaBudde wrote:

> After watching all of this discussion, I have come to a personal
> conclusion ... that the best solution appears to be to set all unused
> pins to output HIGH with 10k pull-up resistors.

 I'd give you two reasons to pull *down* as James suggests.
1} a short is more likely to occur to ground.
2} If you have to use the points to connect to an external device, you
are more likely to want to reference it to ground.

 Tony Nixon reminds us of bizarre problems with unterminated inputs (a
good argument for making them outputs! ;-).

 This still worries me, as it conflicts with the use of them for
analogue assessments.  I'd still be suspicious of interrupt problems
with interrupt-on-change or RB0 if one was looking for an explanation
rather than undocumented chip problems!

 My limited ATMEL experience says: "Don't forget to terminate RESET!"
--
 Cheers,
       Paul B.

1999\10\28@110201 by eplus1

flavicon
face
Yeah, I brain farted on the resistor values. I have a big box of 4.7k that I
use when I need such a thing. Truth is, Paul is right FOR THE PIC in that I
program unused pins for output and set them low. I DO always leave space for
a pad or a resistor for unexpected additions (especially post-production)
and if I were working with chips that I wasn't absolutely sure were going to
survive a short, I would use the resistors.

I also worry about my designs freaking on power-up before I can set the
unused pins for output. I haven't had the problems that Tony mentions with
erratic operation but if a production part started exhibiting that effect, I
would have a space on the board for the resistors to be added as a fix.

So, when answering a newbie question, I always advise the resistors. I still
think its the safest single answer.

I was asked off list if its ok to tie the pins together and use just one
resistor. My response was:
The safest thing to do is to use a separate resistor to a rail for each pin.
The next safest thing to do is to not use the resistors at all and program
the pins as outputs.
The least safest thing would be to tie the pins together and use one
resistor to a rail as it would be very easy to get two pins programmed as
outputs and one set high while the other was set low.

James Newton @spam@jamesnewtonSTOPspamspam@spam@geocities.com phone:1-619-652-0593
http://techref.homepage.com NOW OPEN (R/O) TO NON-MEMBERS!
Members can add private/public comments/pages ($0 TANSTAAFL web hosting)
PICLIST guide: http://204.210.50.240/techref/default.asp?url=piclist.htm


{Original Message removed}


'[PIC]: Filling unused memory using Hi-Tech C?'
2000\09\13@150825 by Parker, Kevin L
flavicon
face
I am developing an application for the PIC12C672.  If the program counter
somehow winds up pointing to an unused area of program memory, I want to
make sure the watchdog timer will time out and issue a microcontroller reset
signal.

In their literature, Microchip suggests filling the unused memory with a
'GOTO $' command.  If the program counter is corrupted, it's likely this
instruction will execute until a watchdog time-out re-initializes the
microcontroller.  Microchip suggests this can be accomplished using the
MPASM command FILL with the following syntax (assuming the last location is
3FFH):

FILL (GOTO $), (400H-$)

Does anyone know a way to fill unused program memory with an assembly 'GOTO
$' using a Hi-Tech C compiler directive?

In addition, feel free to suggest other methods of forcing a watchdog
time-out reset in the event that the program counter goes wild.

Thanks in advance,
Kevin

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

2000\09\13@160713 by Andrew E. Kalman

picon face
Re:

>
>Does anyone know a way to fill unused program memory with an assembly 'GOTO
>$' using a Hi-Tech C compiler directive?

memset() is part of PIC C, However, it doesn't work in bank2 and bank3.

Here's what I use to clear a structure in any bank:

char n;
structureType * structP;

n = sizeof(structureType);
structP = instanceofstructure;
while (n--);
  *structP++ = '\0';

so you can replace the '\0' with whatever a GOTO $ assembles to.


--

 ______________________________________
  Andrew E. Kalman, Ph.D.   spamBeGoneaekspamnetcom.com

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestSTOPspamspammitvma.mit.edu>

2000\09\13@200619 by Plunkett, Dennis

flavicon
face
14/9/2000


This function does not work in the current version of Hi-tech, it has a
problem with the high order bits in that they can not be set to 0. Hi-tech
are aware of this problem and are working on a solution


Dennis



> {Original Message removed}

2000\09\13@200834 by Plunkett, Dennis

flavicon
face
14/9/2000

This is naughty code!
You need to know the code side that is free and then you have to force the
location that the structure exists in. Also I note that this structure is
not forced as a constant, so does it attempt to copy it to RAM?

Dennis




> {Original Message removed}

2000\09\13@232315 by Andrew E. Kalman

picon face
Oops.

I wrote:


>char n;
>structureType * structP;
>
>n = sizeof(structureType);
>structP = instanceofstructure;
>while (n--);
>   *structP++ = '\0';
>
>so you can replace the '\0' with whatever a GOTO $ assembles to.

But of course that's my _RAM_ initializer, and will do nothing for ROM. Sorry.
--

 ______________________________________
  Andrew E. Kalman, Ph.D.   RemoveMEaekspamspamnetcom.com

--
http://www.piclist.com hint: To leave the PICList
TakeThisOuTpiclist-unsubscribe-requestspamspamRemoveMEmitvma.mit.edu>


'[PIC]: grounding unused inputs'
2001\01\14@074732 by Jose S. Samonte Jr.
picon face
Do unused inputs really need to be connected to ground?
What is the effect if they are not grounded?
Does it affect operation of the PIC?
Thank you very much.

____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\01\14@090241 by mike

flavicon
face
On Sun, 14 Jan 2001 05:46:58 MST, you wrote:

>Do unused inputs really need to be connected to ground?
>What is the effect if they are not grounded?
>Does it affect operation of the PIC?
>Thank you very much.
>
>____________________________________________________________________
>Get free email and a permanent address at http://www.netaddress.com/?N=1
Unused pins should be connected to either 0V or Vdd, or set as
outputs. For PORT B you could also enable pull-ups as an alternative
if this doen't cause problems with other pin usage. If left unconnected,  they may float to intermediate voltages and
cause increased (and erratic) power consumption and  noise.
For a breadboard lash-up it usually doesn't really matter, but any
production circuit should avoid floating inputs.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\01\14@111508 by Olin Lathrop

face picon face
>>
Do unused inputs really need to be connected to ground?
What is the effect if they are not grounded?
Does it affect operation of the PIC?
<<

This has been beaten to death several times.  Check the archive.

I leave unused pins open and set them as outputs.  I usually tie unused
input-only pins to ground.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, KILLspamolinspamspamspam_OUTembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\01\14@124041 by David VanHorn

flavicon
face
At 05:46 AM 1/14/01 -0700, Jose S. Samonte Jr. wrote:
>Do unused inputs really need to be connected to ground?
>What is the effect if they are not grounded?
>Does it affect operation of the PIC?
>Thank you very much.

They don't have to be inputs on the pic, make them outputs, and let them float.

If you leave them as inputs, then yes, they should be connected to a logic
level, either high or low will do. Ground is probably slightly better for EMI.
--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\01\14@125936 by Dan Michaels

flavicon
face
Olin Lathrop wrote:
>>>
>Do unused inputs really need to be connected to ground?
>What is the effect if they are not grounded?
>Does it affect operation of the PIC?
><<
>
>This has been beaten to death several times.  Check the archive.
>
>I leave unused pins open and set them as outputs.  I usually tie unused
>input-only pins to ground.
>

To be "safe", it is best to tie unused input pins to ground [or Vcc,
doesn't much matter which] *ONLY* through a resistor, rather than
directly with a short. This is not superstition, as during code
development it is all too easy to accidentally configure a pin
intended as input to output. You then run the risk of
short-circuiting an output.

Furthermore, having a resistor on the pin, rather than a short,
makes it much easier to utilize that pin later on for some useful
function, as the need may arise.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\01\14@152445 by Olin Lathrop

face picon face
> To be "safe", it is best to tie unused input pins to ground [or Vcc,
> doesn't much matter which] *ONLY* through a resistor, rather than
> directly with a short. This is not superstition, as during code
> development it is all too easy to accidentally configure a pin
> intended as input to output. You then run the risk of
> short-circuiting an output.

Perhaps in a low volume product.  I wouldn't want to burden a high volume
product with unnecessary parts for a minor debugging convenience.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, olinRemoveMEspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\01\14@175023 by Dan Michaels

flavicon
face
Olin Lathrop wrote:
>> To be "safe", it is best to tie unused input pins to ground [or Vcc,
>> doesn't much matter which] *ONLY* through a resistor, rather than
>> directly with a short. This is not superstition, as during code
>> development it is all too easy to accidentally configure a pin
>> intended as input to output. You then run the risk of
>> short-circuiting an output.
>
>Perhaps in a low volume product.  I wouldn't want to burden a high volume
>product with unnecessary parts for a minor debugging convenience.
>

Even in a high volume product, personally I would never simply
(a) configure a pin as output and then leave it unterminated, or
(b) set a pin to input and then short straight it to gnd. There are
a number of possible "disastrous" scenarios this way:

1 - with (a), an ESD spike might modify the TRIS register, set an
   output pin to input, and then it would float and pick up noise,
   and possibly affect proper operation.

2 - with (b), an ESD spike might modify the TRIS resgister, set an
   input pin to output, and fry your product.

3 - with (b), on the next go round with code development, you might
   do the TRIS thing yourself by mistake.

4 - with (b), it takes more work if you want to use the pin
   differently in the future.

5 - other circumstances may accidentally mod the TRIS register in
   the field, eg brownouts, lightning crashes, screwy things related
   to general susceptibility of the /MCLR pin, who knows what.

Better to spend a few pennies and tie the unused pins to gnd via
a bussed SIP resistor net, and improve the reliability of your
product. Also, as mentioned several times, it helps saves the butt
of those of us in the subset of non-perfect coders when they screw
up during development. Good practice for code dev, good practice
for field reliability.

In a nice "guaranteed" noise-free field environment, you might be
ok doing it the "quick-and-dirty" way. But, all in all, better
safe than sorry. Experience, yes. Superstition, no.

- danM

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\01\15@151904 by Dwayne Reid

flavicon
face
At 05:50 PM 1/14/01 -0500, Dan Michaels wrote:

>Even in a high volume product, personally I would never simply
>(a) configure a pin as output and then leave it unterminated, or
>(b) set a pin to input and then short straight it to gnd. There are
>a number of possible "disastrous" scenarios this way:
>
>1 - with (a), an ESD spike might modify the TRIS register, set an
>     output pin to input, and then it would float and pick up noise,
>     and possibly affect proper operation.

Hi there, Dan.

I would agree with your reasoning above *if* I set the TRIS registers only
at the start of code and never touched them again.  But I consider that to
be bad practice.  I refresh all important registers regularly, usually in
the routine that looks after the watchdog timer.  In fact, I will often
*read* the registers to make sure that it is what I expect them to be,
rather than just refreshing them.  If I get a nasty transient that is
enough to disturb the TRIS or INTCON registers, I figure that I had better
re-init everything anyways.  So: I configure un-used pins as output and set
them LO.

Regarding being able to use some of those un-used pins for later changes,
you are correct in that having pads with holes makes those changes easier
to make.  But you don't need to stuff components in those holes.

dwayne



Dwayne Reid   <EraseMEdwaynerSTOPspamspamRemoveMEplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 17 years of Engineering Innovation (1984 - 2001)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

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


2001\01\15@155730 by David VanHorn

flavicon
face
>
>I would agree with your reasoning above *if* I set the TRIS registers only
>at the start of code and never touched them again.  But I consider that to
>be bad practice.  I refresh all important registers regularly, usually in
>the routine that looks after the watchdog timer.  In fact, I will often
>*read* the registers to make sure that it is what I expect them to be,
>rather than just refreshing them.  If I get a nasty transient that is
>enough to disturb the TRIS or INTCON registers, I figure that I had better
>re-init everything anyways.  So: I configure un-used pins as output and set
>them LO.


Interesting.
I see what you mean here.
On the AVR or Z8, this isn't a problem because the tris-equivalent
registers can't be modified by inputs like this.  I can easily output a 1
into a short to ground (pointless but harmless) and the chip won't decide
to change it on me.

I think the PIC architecture puts a larger burden on you to protect the
processor from output forcing in your designs.

It's an interesting design wrinkle though, that your output bits could be
changed on you at any time. That, plus the weaknesses in the BSF/BCF
instructions wrt pin loading, argue twoard the shadow register approach for
the port registers.

--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

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


2001\01\15@192135 by Dan Michaels

flavicon
face
Dwayne Reid wrote:

>I would agree with your reasoning above *if* I set the TRIS registers only
>at the start of code and never touched them again.  But I consider that to
>be bad practice.  I refresh all important registers regularly, usually in
>the routine that looks after the watchdog timer.


Also a good idea - back when I worked with 6805, Motorola actually
recommended in their databooks to periodically refresh the TRIS
registers [whatever they called them], just in case they are
changed by ESD/noise/etc. This should be easy to do in the outermost
code loop, since the TRIS are usually set on bootup and rarely changed,
in most cases.

- danM

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


2001\01\15@194035 by Dwayne Reid

flavicon
face
At 03:55 PM 1/15/01 -0500, David VanHorn wrote:

>Interesting.
>I see what you mean here.
>On the AVR or Z8, this isn't a problem because the tris-equivalent
>registers can't be modified by inputs like this.

Hi there, Dave.

Something you wrote puzzles me - maybe there is yet another PIC wrinkle
that I am not aware of.  Is there any condition where the TRIS register can
be changed by something happening on the port pins?  If so, this is a new
problem to me!

The only port related problem I can think of right now is the
read-modify-write issue - its not a problem since I am aware of it.  But I
am not aware of a TRIS register susceptibility.  Is there a problem
there?  What causes it and what does it do?

I always check or refresh TRIS and other important registers simply because
I can't predict what a nasty ESD or EMI event might do to me - all I can do
is deal with the problem if it happens.  But it sure doesn't happen during
normal operation.

dwayne




Dwayne Reid   <spamdwayner.....spamspamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 17 years of Engineering Innovation (1984 - 2001)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

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


2001\01\15@214016 by David VanHorn

flavicon
face
At 05:10 PM 1/15/01 -0700, Dwayne Reid wrote:
>At 03:55 PM 1/15/01 -0500, David VanHorn wrote:
>
>>Interesting.
>>I see what you mean here.
>>On the AVR or Z8, this isn't a problem because the tris-equivalent
>>registers can't be modified by inputs like this.
>
>Hi there, Dave.
>
>Something you wrote puzzles me - maybe there is yet another PIC wrinkle
>that I am not aware of.  Is there any condition where the TRIS register can
>be changed by something happening on the port pins?  If so, this is a new
>problem to me!

Sorry, I meant port not tris :)

--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

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


2001\01\16@014433 by yansong gu

flavicon
face
Has anyone used a dragonball for palm alike development?  I just received
some literature from big M.  Wonder where is a good start from a picer's
point.

Yansong


{Original Message removed}

2001\01\21@222546 by Richard Sloan

flavicon
face
Does not seem to matter if an unused output is fried.

-----Original Message-----
From: pic microcontroller discussion list
[PICLISTKILLspamspamEraseMEMITVMA.MIT.EDU]On Behalf Of Olin Lathrop
Sent: Sunday, January 14, 2001 3:19 PM
To: EraseMEPICLIST@spam@spam@spam@MITVMA.MIT.EDU
Subject: Re: [PIC]: grounding unused inputs


> To be "safe", it is best to tie unused input pins to ground [or Vcc,
> doesn't much matter which] *ONLY* through a resistor, rather than
> directly with a short. This is not superstition, as during code
> development it is all too easy to accidentally configure a pin
> intended as input to output. You then run the risk of
> short-circuiting an output.

Perhaps in a low volume product.  I wouldn't want to burden a high volume
product with unnecessary parts for a minor debugging convenience.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, @spam@olinspamspamKILLspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

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


2001\01\22@041944 by Russell McMahon

picon face
>Does not seem to matter if an unused output is fried.

There is a fate WORSE than a cleanly fried output waiting for an in service
device that accidentally flips a grounded unused input to a high and unused
output (or whatever).

This is MUCH higher current drain. I have had a PIC in a micropower
application suddenly draw 100 mA from a  3 volt supply ! :-)
That was from gross inattention (ie stupidity) (5 x inputs connected to VCC
driven as grounded outputs) but it could happen in real life.



     Russell McMahon
_____________________________

What can one man* do?
Donate food daily free !!! -  http://www.thehungersite.com/
Donate Vitamin A!  http://www.thechildsurvivalsite.com/
http://www.rawa.com  - one perspective on Afghanistan
http://www.changingourworld.com    http://www.easttimor.com   http://www.sudan.com

(* - or woman, child or internet enabled intelligent entity :-))


>> To be "safe", it is best to tie unused input pins to ground [or Vcc,
>> doesn't much matter which] *ONLY* through a resistor, rather than
>> directly with a short. This is not superstition, as during code
>> development it is all too easy to accidentally configure a pin
>> intended as input to output. You then run the risk of
>> short-circuiting an output.
>
>Perhaps in a low volume product.  I wouldn't want to burden a high volume
>product with unnecessary parts for a minor debugging convenience.

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



'[PIC]:What is the correct way to terminate unused '
2002\01\16@115129 by WEBB,TIM (A-Sonoma,ex1)
flavicon
face
I will have several unused pins on my 16F877

Should the unused pins be set as inputs or outputs and should they be tied
directly to GND or do I use a resistor.

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


2002\01\16@120338 by Rudy Rudy

flavicon
face
Set them as outputs.

-----------------------
Rudy Rudy
TakeThisOuTrudyspamrudyrudy.com
http://www.rudyrudy.com
-----------------------

> {Original Message removed}

2002\01\16@151706 by Andre Abelian

picon face
two ways can be done.

1. make unused pins inputs and ground them.
2. make unused pins output and do not connect to any where
  do not ground output pins.


Andre Abelian




I will have several unused pins on my 16F877

Should the unused pins be set as inputs or outputs and should they be
tied
directly to GND or do I use a resistor.

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

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-request.....spamKILLspammitvma.mit.edu


2002\01\16@154505 by iklas Wennerstrand

picon face
If you ground the input pin then you have to be seartain that you never ever
get a high value on that port pin.
That is if the MCU gets crazy and accidentelly shift to output and drive the
port pin high.
Bad to connect direct to ground without a current limiting resistor.
To lower cost and board space I would suggest alternative 2
Niklas

-----Ursprungligt meddelande-----
Från: pic microcontroller discussion list [spamPICLISTspamMITVMA.MIT.EDU]
För Andre Abelian
Skickat:        den 16 januari 2002 21:15
Till:   PICLISTSTOPspamspamMITVMA.MIT.EDU
Ämne: Re: [PIC]:What is the correct way to terminate unused pins 16F877

two ways can be done.

1. make unused pins inputs and ground them.
2. make unused pins output and do not connect to any where
  do not ground output pins.


Andre Abelian




I will have several unused pins on my 16F877

Should the unused pins be set as inputs or outputs and should they be
tied
directly to GND or do I use a resistor.

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

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-request.....spamspammitvma.mit.edu

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


'[PIC]: What to do with unused I/O pins'
2002\01\21@153712 by andyf

flavicon
face
I am currently working on a gadget with a 12C508.  Three I/O pins (GP0, GP1 and GP4) are set as outputs and are used to provide a 'clock pulse' to some other circuitry.

When used in the field, any or all of these pins could be used, but probably only two at a time.

Should anything be done with these pins that aren't used?  They will be 'running' all the time, whether the signal is used or not.  Perhaps tie them to ground through a 10K resistor?  Or maybe they're fine left open?

What about unused I/O pins that aren't referenced in the program?  Should anything be done with them?  I'm basically trying to limit long term damage (re: my post about the life expentancy of a PIC).

Thanks for any input!

_____________________________________________________________
Are you a Techie? Get Your Free Tech Email Address Now! Visit http://www.TechEmail.com

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


2002\01\21@175454 by kben

picon face
Hi Andy
Try these from the PIC FAQ. ( I usually just set them as outputs)

www.piclist.com/techref/piclist/begin.htm
No. 9 from the list
Don't Float: Tie the switch pin Hi or Lo with a ~10K resistor or use internal
pullups to avoid floating inputs when the switch is open. In general, do something
with unused pins don't just leave them floating
also
http://www.piclist.com/techref/logic/xtrapins.htm

>I am currently working on a gadget with a 12C508.  Three I/O pins (GP0, GP1
and GP4) are set as outputs and are used to provide a 'clock pulse' to some
other circuitry.
>
>When used in the field, any or all of these pins could be used, but probably
only two at a time.
>
>Should anything be done with these pins that aren't used?  They will be 'running'
all the time, whether the signal is used or not.  Perhaps tie them to ground
through a 10K resistor?  Or maybe they're fine left open?
>
>What about unused I/O pins that aren't referenced in the program?  Should anything
be done with them?  I'm basically trying to limit long term damage (re: my post
about the life expentancy of a PIC).
>
>Thanks for any input!

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



'[EE]: Unused pins on a CMOS OpAmp?'
2002\03\01@194253 by Rick Mann
flavicon
face
What should I do with the unused pins on a dual CMOS op-amp (specifically,
the National LM6482 rail-to-rail op amp)? If anything, is it enough to tie
the inputs of the unused op amp together? Should they also be grounded?

The datasheet had no recommendations, nor did the FAQ.

TIA,

--
Rick

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


2002\03\01@195724 by Dave Dilatush

picon face
Rick Mann wrote...

>What should I do with the unused pins on a dual CMOS op-amp (specifically,
>the National LM6482 rail-to-rail op amp)? If anything, is it enough to tie
>the inputs of the unused op amp together? Should they also be grounded?
>
>The datasheet had no recommendations, nor did the FAQ.

You can tie one opamp input (doesn't matter which one) to one supply
rail, and the other opamp input to the other rail, and leave the output
open; or you can tie the output to the inverting input to make a
unity-gain follower, and then tie the non-inverting input to ground or
to either of the rails.

Either way, the output of the opamp is determinate and stable- which is
what you want so the unused opamp doesn't interfere with anything.

HTH...

Dave

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


2002\03\01@210512 by Spehro Pefhany

picon face
At 04:38 PM 3/1/02 -0800, you wrote:
>What should I do with the unused pins on a dual CMOS op-amp (specifically,
>the National LM6482 rail-to-rail op amp)? If anything, is it enough to tie
>the inputs of the unused op amp together? Should they also be grounded?

The best thing to do in general is to connect the op-amp as a voltage-
follower (output to inverting input) and connect the non-inverting input to
ground if you have +/- supplies, or a voltage that the output can follow
to if you have a single supply. Next best thing is to ground the non-inverting
input with a single supply, and have output connected to inverting input.

Some op-amps do strange things when you go outside the common-mode range or
apply a high differential voltage. They can draw excessive input current
(Bipolar types sometimes have the equivalent of back-to-back diodes across
the input) or they can draw excessive supply current. Unfortunately they
often don't publish the schematics of the op-amps any more, so it's hard
to tell without actually testing. This one is a CMOS one, so it's immune to
some of the ills that affect bipolar rail-to-rail op-amps, but if you follow
the above ideas, you'll have more flexibility in dropping in alternative
op-amps if required.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
spam_OUTspeffTakeThisOuTspamEraseMEinterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
9/11 United we Stand

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


'[EE]: Unused pins on a comparator'
2002\03\03@123042 by Brian Kraut

picon face
This reminds me of something I came accross recently on an LM339
comparator.  I have a book that says to ground all unused pins of the
comparator.  I would think that with both input pins grounded that the
output would be unstable.  It seems to make more sense to me to ground
one input and connect the output to VCC to get a stable output.  Anyone
not agree?

Dave Dilatush 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


2002\03\03@124505 by Spehro Pefhany

picon face
At 12:34 PM 3/2/02 -0800, you wrote:
>This reminds me of something I came accross recently on an LM339
>comparator.  I have a book that says to ground all unused pins of the
>comparator.  I would think that with both input pins grounded that the
>output would be unstable.  It seems to make more sense to me to ground
>one input and connect the output to VCC to get a stable output.  Anyone
>not agree?

I'd suggest following the original manufacturer's data-sheet
recommendation, which is to ground all 3 pins of unused comparators
(that includes the output).

(In unusual circumstances, there may be some benefit in low-level
reduced noise or current consumption with biasing it one way or the
other, but I'd prefer to see ~100mV to do it, not Vcc).

Connecting an open-collector output to Vcc is not a very good idea, but
you probably didn't actually mean to write that!

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
@spam@speffspamspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
9/11 United we Stand

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


2002\03\03@124507 by Dave Dilatush

picon face
Brian Kraut wrote...

>This reminds me of something I came accross recently on an LM339
>comparator.  I have a book that says to ground all unused pins of the
>comparator.  I would think that with both input pins grounded that the
>output would be unstable.  It seems to make more sense to me to ground
>one input and connect the output to VCC to get a stable output.  Anyone
>not agree?

The idea of grounding all unused pins--both inputs AND the output--of an
unused LM339 section works because the LM339 output is open-collector;
it can only pull down.  You wouldn't want to do this with any device
having an active-high output (such as an opamp), but doing it with an
LM339 comparator is OK.  This applies only to an LM339 whose negative
supply terminal is grounded; obviously, if it is tied to a negative
voltage, the unused output should be tied there, not to ground.

For the LM339, connecting one input to ground and the other input to VCC
would be pointless because the LM339's input common-mode range does not
include VCC; and when either of the inputs is outside the input CMR, the
output is indeterminate.

Dave

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


2002\03\03@125543 by Brian Kraut

picon face
O.K.  Obviously the open collector tied to ground will be a determined
output, but I guess it can keep oscillating between open collector and
ground internally.  I guess that must be O.K. though.  I thought that
maybee it was a typeo in my book.  This is probably the only practical
soultion since grounding one input and having one at some less than Vcc
voltage divider would be impractical.  The output will probably stay one
way or the other with both inputs grounded from tollerences in the part
anyway.

Dave Dilatush 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


2002\03\03@132524 by Dave Dilatush

picon face
Brian Kraut wrote...

>O.K.  Obviously the open collector tied to ground will be a determined
>output, but I guess it can keep oscillating between open collector and
>ground internally.

I think that's what's called a "distinction without a difference".

The bottom line, when dealing with unused opamp sections or comparator
sections, is twofold:

1.  Keep both inputs within their specified common-mode range.

2.  Keep the output from flopping around.

Whatever satisfies both of these requirements, works.

Dave

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


2002\03\03@132731 by Spehro Pefhany

picon face
At 05:43 PM 3/3/02 +0000, you wrote:

>For the LM339, connecting one input to ground and the other input to VCC
>would be pointless because the LM339's input common-mode range does not
>include VCC; and when either of the inputs is outside the input CMR, the
>output is indeterminate.

Hmmm.. "indeterminate" or "unspecified"?  ;-)

From the internal schematic, it looks like tying both pins
to a voltage >> Vcc (but < 36V) will lead to a predictable result
(output low and and some  current saving). There's a range
around Vcc where the current sources are shutting down that won't be
so predictable if both inputs are in that same range, but if one pin
is within the common-mode range, the results from the other pin being
-0.3 < Vin < 36V should not be different from what you'd expect,
regardless of supply voltage.

(BTW, their assumption that ground = negative supply was corrected on
later data sheets, I guess some people didn't realize the reasoning)

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
TakeThisOuTspeffKILLspamspam@spam@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
9/11 United we Stand

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


2002\03\03@132944 by Brian Kraut

picon face
Works for me.  Thanks.

Dave Dilatush 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


2002\03\03@133531 by Olin Lathrop

face picon face
> This reminds me of something I came accross recently on an LM339
> comparator.  I have a book that says to ground all unused pins of the
> comparator.  I would think that with both input pins grounded that the
> output would be unstable.  It seems to make more sense to me to ground
> one input and connect the output to VCC to get a stable output.  Anyone
> not agree?

I don't like tying both input pins together because, as you say, it could be
unstable.  You are counting on the offset voltage to drive the output one
way.

However, I would definitely NOT tie one to power and the other to ground.
Depending on the input stage, that could draw excessive current or even
destroy the chip.  This is less likely to be a problem on comparators
because these are usually designed for a large differential mode input.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, .....olinRemoveMEspamembedinc.com, 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


'[PIC]: filling unused program memory'
2002\03\12@180835 by Terence Monteith

flavicon
face
I would like to fill in unused portions of the program memory with a
specific value (0x0000), but am unsure how this can be done without
tediously inserting the values manually or by using FILL directives
throughout the code.  Using a FILL directive at the very beginning of code
of course will give me overwrite errors when compiled.  Any suggestions?

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


2002\03\12@183205 by mike

flavicon
face
On Tue, 12 Mar 2002 16:55:29 -0600, you wrote:

>I would like to fill in unused portions of the program memory with a
>specific value (0x0000), why?

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


2002\03\12@190027 by Pendley, Michael

picon face
Using what assembler or compiler?

If you are using MPASM (and I am new to this so be gentile if I am
wrong)...how about the "fill" directive.

From the MPASM help file:  <label> fill <expr>, count

Generates <count> occurrences of the program word .... <expr>

If you used this after the last real instruction in your program then
<label> will have the value of the first location you want to zero.  The
last address depends on the processor type but is certainly known in
advance.  Call it lastProgramAddress.

I assume something like this would work

ZeroFill: fill 0,lastProgramAddress - ZeroFill + 1




-Mike



{Original Message removed}

2002\03\12@192431 by Sean Alcorn - Avion Sydney

flavicon
face
on 13/3/02 10:31 AM, Mike Harrison at RemoveMEmikespamspamSTOPspamWHITEWING.CO.UK wrote:


>> I would like to fill in unused portions of the program memory with a
>> specific value (0x0000),
> why?

Probably because many text books have told him that he should.

That should spark a debate! :-)

Sean

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


2002\03\13@100056 by Terence Monteith

flavicon
face
Yes, I had thought of the FILL directive, but due to the nature of the code
(tables, code spread over 4 pages) I would need to put in quite a few.  I
was wondering if their was a more elegant way of doing this using MPASM.

I am implementing code to reprogram the microcontroller remotely, and I want
to generate a hex file that will set all unused program words to 0x0000.
This way I can determine if the code was loaded in the field (since the
unused portions contain 0x0000), or if it was loaded at the factory (where
unused portions will contain 0x3FFF).

{Original Message removed}

2002\03\13@102520 by Claudio Tagliola

flavicon
face
Can't you FILL the complete range as the first MPASM operator, and then
ORG back to the beginning?

{Original Message removed}

2002\03\13@102744 by Terence Monteith

flavicon
face
No, then I get overwrite errors.

-----Original Message-----
From: Claudio Tagliola [spamBeGonecptagliolaspamRemoveMECHELLO.NL]
Sent: March 13, 2002 9:23 AM
To: .....PICLISTEraseMEspamMITVMA.MIT.EDU
Subject: Re: [PIC]: filling unused program memory


Can't you FILL the complete range as the first MPASM operator, and then
ORG back to the beginning?

-----Original Message-----
From: pic microcontroller discussion list
[spamPICLISTspam_OUTspam@spam@MITVMA.MIT.EDU] On Behalf Of Terence Monteith
Sent: woensdag 13 maart 2002 15:57
To: spamPICLIST@spam@spamSTOPspamMITVMA.MIT.EDU
Subject: Re: [PIC]: filling unused program memory


Yes, I had thought of the FILL directive, but due to the nature of the
code (tables, code spread over 4 pages) I would need to put in quite a
few.  I was wondering if their was a more elegant way of doing this
using MPASM.

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


2002\03\13@102951 by Carlos Ojea

flavicon
face
>I am implementing code to reprogram the microcontroller remotely,

In the future (not far) I also will reprogram the pic remotely.
I though in somethig like send the new code via a telephone mobile module
and save it in an external eeprom. Then check if the code is ok and program
it in the pic (flash pic).
How is your idea?
Regards,
Carlos

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


2002\03\13@103749 by Pic Dude

flavicon
face
Isn't this the purpose of erasing a chip before programming?  I'm new to
this PIC stuff still, but the Tait programmer I'm using seems to state
that using the erase command on the same command-line as dumping
the hex file to the PIC will erase the chip first and then drop on the
code whereever there is code.  All mem locations w/o code will not
be touched.

Cheers.


----- Original Message -----
From: "Terence Monteith" <spamBeGoneTerence.MonteithspamBeGonespam@spam@WAVECOM.CA>
To: <RemoveMEPICLISTRemoveMEspamRemoveMEMITVMA.MIT.EDU>
Sent: Wednesday, March 13, 2002 9:25 AM
Subject: Re: [PIC]: filling unused program memory


> No, then I get overwrite errors.
>
> {Original Message removed}

2002\03\13@104238 by Terence Monteith

flavicon
face
I cannot get into too much detail since ultimately this will end up in
someone else's product, but here is a brief explanation.  The unit itself is
connected to a headend via an RS485 connection, where the reprogramming is
controlled from.  On the uC is a modified version of a Microchip application
note (AN732).  In the microcontroller data is received, verified with a CRC,
and programmed 16 words at a time.  It is then reverified to make sure it
was programmed correctly, and then an ACK (or NACK if somewhere the process
failed) is sent back to the headend.  If an ACK is returned the next 16
words are sent, if a NACK is returned the 16 words that failed are re-sent.

{Original Message removed}

2002\03\13@104440 by Claudio Tagliola

flavicon
face
Can't you build a custom .HEX file modify program? It shouldn't be too
hard to make a program which replaces the 0x3FFF into 0x0000.

On another note: you wrote it's for determining a factory or a field
load. Do you have to have every 3FFF replaced by 0000? Can't you pick
ONE memory location and hardcode a pre-defined value there? You can make
it with MPASM using IFDEFs which trigger only for a factory build.

{Original Message removed}

2002\03\13@105535 by Terence Monteith

flavicon
face
>Can't you build a custom .HEX file modify program? It shouldn't be too
>hard to make a program which replaces the 0x3FFF into 0x0000.

I could but was hoping for an easier way.

>On another note: you wrote it's for determining a factory or a field
>load. Do you have to have every 3FFF replaced by 0000? Can't you pick
>ONE memory location and hardcode a pre-defined value there? You can make
>it with MPASM using IFDEFs which trigger only for a factory build.

I am thinking I might just have to do this.  Thanks for the help.

{Original Message removed}

2002\03\13@130836 by Olin Lathrop

face picon face
> Yes, I had thought of the FILL directive, but due to the nature of the
code
> (tables, code spread over 4 pages) I would need to put in quite a few.  I
> was wondering if their was a more elegant way of doing this using MPASM.

You could just post process the HEX file by inserting hard zeros for all
values that aren't explicitly specified.

> I am implementing code to reprogram the microcontroller remotely, and I
want
> to generate a hex file that will set all unused program words to 0x0000.
> This way I can determine if the code was loaded in the field (since the
> unused portions contain 0x0000), or if it was loaded at the factory (where
> unused portions will contain 0x3FFF).

How about a single ID or version word at a know location, like the last
location in memory.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, olinKILLspamspamspamembedinc.com, 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


2002\03\13@130847 by Olin Lathrop

face picon face
> Isn't this the purpose of erasing a chip before programming?  I'm new to
> this PIC stuff still, but the Tait programmer I'm using seems to state
> that using the erase command on the same command-line as dumping
> the hex file to the PIC will erase the chip first and then drop on the
> code whereever there is code.  All mem locations w/o code will not
> be touched.

He wants to set unused memory to 0 (although his reasons seem silly),
whereas "erase" implies setting it to all 1s.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, spam_OUTolin@spam@spamembedinc.com, 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


2002\03\13@134928 by Pic Dude

flavicon
face
"whereas "erase" implies setting it to all 1s".

Ahhh.....never knew that.  Always assumed it was zero.  Thanks!

Didn't pay attention to the start of this thread.  Should i ask about
the reason....???


{Original Message removed}

2002\03\14@195641 by parkiss

picon face
Recognizing that the original question referred to an MPASM
solution, an alternate approach would be an offline program to
manipulate the .hex file so that zeroes are written to all addresses
not otherwise filled.  Would take a few hours to write and test the
program, but may save time in the long run once the capability
exists.

Regards,

Steve

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


'[PIC]: Unused I/O ideas'
2002\03\26@102954 by Chris Loiacono

flavicon
face
I am doing a board with a PIC18, on which I'm planning what I'm calling an
expansion connector.
Basically I want to bring all the unused I/O, along with some other pins to
a connector that will allow me to make various daughter-boards that can be
plugged-in as future options.

Normally, I tie all unused I/O to Gnd. DOing this will be somewhat
challenging, since any of these will be made useless for future use if this
is done permanently. The options I can foresee are either shunt-jumpers to
Gnd, or perhaps setting all the unused pins as outputs. The latter is
something I have never tried. I'm hoping one of you has some insight to
share on this.

TIA,
Chris

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


2002\03\26@104843 by M. Adam Davis

flavicon
face
Well, if you set unused pins as outputs, you risk shorting them on your
exposed connector pins.

You may consider simply adding places to put SIP resisters (8 resisters
to a common wire in a 1x9 package).  As this is cmos we're talking about
you could even put 1M resisters in the circuit, and it would affect the
usage of the pins only a little with all the benefits of non-oscillating
cmos inputs.

Could be cheaper/smaller/easier to deal with than shunts.

-Adam

Chris Loiacono wrote:

{Quote hidden}

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


2002\03\26@105101 by Sid Weaver

picon face
For Chris

Why not just set all the unused pins to "low", then they can be changed later
with a small program edit.

Sid

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


2002\03\26@110346 by Bob Ammerman

picon face
Setting unused pins to outputs is a fine idea.

Bob Ammerman
RAm Systems

----- Original Message -----
From: "Chris Loiacono" <spamchrisKILLspamspamKILLspamMAIL2ASI.COM>
To: <spamPICLISTspam_OUTspamMITVMA.MIT.EDU>
Sent: Tuesday, March 26, 2002 10:29 AM
Subject: Re: [PIC]: Unused I/O ideas


> I am doing a board with a PIC18, on which I'm planning what I'm calling an
> expansion connector.
> Basically I want to bring all the unused I/O, along with some other pins
to
> a connector that will allow me to make various daughter-boards that can be
> plugged-in as future options.
>
> Normally, I tie all unused I/O to Gnd. DOing this will be somewhat
> challenging, since any of these will be made useless for future use if
this
{Quote hidden}

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


2002\03\26@110358 by Byron A Jeff

face picon face
On Tue, Mar 26, 2002 at 10:29:59AM -0500, Chris Loiacono wrote:
> I am doing a board with a PIC18, on which I'm planning what I'm calling an
> expansion connector.
> Basically I want to bring all the unused I/O, along with some other pins to
> a connector that will allow me to make various daughter-boards that can be
> plugged-in as future options.

Always a good idea.

>
> Normally, I tie all unused I/O to Gnd. DOing this will be somewhat
> challenging, since any of these will be made useless for future use if this
> is done permanently. The options I can foresee are either shunt-jumpers to
> Gnd, or perhaps setting all the unused pins as outputs. The latter is
> something I have never tried. I'm hoping one of you has some insight to
> share on this.

Well you missed a third option. Actually your first option of tying directly to
GND is a somewhat dangerous proposistion. If for any reason such a pin was
ever set to an output and high, you'd blow it sky high.

The third option is to use a very light pullup/pulldown resistor. Gives the
same effect by forcing the input pin to a known state, with the additional
advantage that it can be easily overridden either as an output or input.
I like it best because it's not subject to programmatic failure. However it'll
cost you a bit of board real estate and a bit of power consumption. Also it
can hinder very high speed bus operation, But since a PIC isn't going to
be able to twiddle I/O lines any faster that once every 200ns, it probably
won't be a problem. 22Kohms is probably a good value for starters. Also
places like Digikey carry resistor packs where 15 resistors with a common
pin in a 16 pin package. Two of those should be able to cover the entire bus.

Setting I/O pins to outputs is the next logical choice. However don't trust
your code to set and forget. PIC code can sometimes flip bits in the output
latches especially using read-modify-write instructions.

BAJ

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


2002\03\26@160648 by Harold M Hallikainen

picon face
       This is a pretty common item on the list. I leave unused lines open and
program them as outputs. They are then free to be used later.
       By the way, I recently had to interface with a product that drops its
supply down to 3V when it sleeps (and the customer didn't tell me). I'm
modifying my design to use the RA4 open drain output to drive it. I
thought I'd try just tristating the line instead of driving it high. The
current consumption when WAY up. Input lines that are not at ground or
+supply DO cause a lot of current (at least it was a lot in this
application, hundreds of microamps).

Harold

On Tue, 26 Mar 2002 10:29:59 -0500 Chris Loiacono <EraseMEchrisRemoveMEspamMAIL2ASI.COM>
writes:
{Quote hidden}

FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com


________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
dl.http://www.juno.com/get/web/.

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


2002\03\27@181104 by Olin Lathrop

face picon face
> I am doing a board with a PIC18, on which I'm planning what I'm calling an
> expansion connector.
> Basically I want to bring all the unused I/O, along with some other pins
to
> a connector that will allow me to make various daughter-boards that can be
> plugged-in as future options.
>
> Normally, I tie all unused I/O to Gnd. DOing this will be somewhat
> challenging, since any of these will be made useless for future use if
this
> is done permanently. The options I can foresee are either shunt-jumpers to
> Gnd, or perhaps setting all the unused pins as outputs. The latter is
> something I have never tried. I'm hoping one of you has some insight to
> share on this.

I set unused lines as outputs and drive them low.  That way they can be left
unconnected so it is easier to modify an existing board if they have to be
accessed.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, olinTakeThisOuTspamKILLspamembedinc.com, http://www.embedinc.com

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


2002\03\27@231612 by Chris Loiacono

flavicon
face
Thanks, Olin. I like the after-thought. Sounds like my idea is not original
at all, which is a good thing.
Chris

{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestSTOPspamspammitvma.mit.edu



'[PIC]: Unused pins'
2002\08\28@192537 by Brendan Moran
flavicon
face
Just wondering what you folks consider standard procedure for
handling unused PIC pins.  I can see two decent options, myself.  1st
is to leave them as inputs, and ground them.  2nd is to set them to
outputs, and leave them disconnected.  Both should use minimal power, but I
don't know the other pros and cons related to the option.

--Brendan

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


2002\08\28@193440 by Byron A Jeff

face picon face
On Wed, Aug 28, 2002 at 04:23:43PM -0700, Brendan Moran wrote:
> Just wondering what you folks consider standard procedure for
> handling unused PIC pins.  I can see two decent options, myself.  1st
> is to leave them as inputs, and ground them.  2nd is to set them to
> outputs, and leave them disconnected.  Both should use minimal power, but I
> don't know the other pros and cons related to the option.

You've pretty much described it. Setting to outputs works just as well and
requires less hardware. Also it has less of chance of screwing up if its
TRIS bit flips. Consider if you have a grounded input and it flips to a high
output because of a glitch. You now have one burned output port. However if
a disconnected output flips to an input, You'll probably be OK.

Just some thoughts.

BAJ

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


2002\08\28@193656 by Sid Weaver

picon face
In a message dated 08/28/2002 19:26:44 Eastern Daylight Time,
bmoran.....spam@spam@MILLENNIUM.CA writes:


> Just wondering what you folks consider standard procedure for
> handling unused PIC pins.  I can see two decent options, myself.  1st
> is to leave them as inputs, and ground them.  2nd is to set them to
> outputs, and leave them disconnected.  Both should use minimal power, but I
> don't know the other pros and cons related to the option.
>
> --Brendan
>

Brendan, I simply ignore unused pins.
Sid Weaver - W4EKQ

< < < <
Remember - Fumpus tegit .

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


2002\08\28@194537 by Brendan Moran

flavicon
face
> Brendan, I simply ignore unused pins.
> Sid Weaver - W4EKQ

That's what I *have* been doing, but since I'm committing this project to a
PCB, I want it to be done right.  And I know that if the pins are ignored,
then there could be some issues with power consumption. CMOS is worse than
TTL for this.

--Brendan

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


2002\08\28@194833 by Tony Nixon

flavicon
picon face
The problem with grounding directly, is if something goes wrong and
changes them to outputs at the oppostie polarity.

The cheapest is to set them as outputs, but again, if something goes
wrong and sets them as inputs, then they float and "may" cause problems.

The best (??) is to set them as low outputs with pull down resistors, or
high with pullups.  If something goes wrong, only a slight increase in
power consumption occurs.



Brendan Moran wrote:
{Quote hidden}

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
salesspamspamTakeThisOuTbubblesoftonline.com

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


2002\08\28@195234 by David Duffy

flavicon
face
At 04:44 PM 28/08/2002 -0700, you wrote:
> > Brendan, I simply ignore unused pins.
> > Sid Weaver - W4EKQ

Not a good idea! Floating inputs will cause havoc given half a chance.
You can do without the increased input current and glitches. :-)

>That's what I *have* been doing, but since I'm committing this project to a
>PCB, I want it to be done right.  And I know that if the pins are ignored,
>then there could be some issues with power consumption. CMOS is worse than
>TTL for this.

As another poster said, set them as output and leave the not connected.
If you really want, you can leave the mas input and use pull-up/down resistors
but that's really a waste of space & money most of the time.
Regards...
___________________________________________
David Duffy        Audio Visual Devices P/L
U8, 9-11 Trade St, Cleveland 4163 Australia
Ph: +61 7 38210362   Fax: +61 7 38210281
New Web: http://www.audiovisualdevices.com.au
___________________________________________

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


2002\08\28@195441 by Tony Nixon

flavicon
picon face
Sid Weaver wrote:

> Brendan, I simply ignore unused pins.

Problems caused by ignoring unused pins will not go away. They will
stick around and haunt you. Might be fine one day, next day ........

Hard to diagnose the problems too if you are unaware of a floating pin.

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
TakeThisOuTsalesspamspambubblesoftonline.com

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


2002\08\28@200144 by Sid Weaver

picon face
In a message dated 08/28/2002 19:46:38 Eastern Daylight Time,
spamBeGonebmoranKILLspamspamMILLENNIUM.CA writes:


> That's what I *have* been doing, but since I'm committing this project to a
> PCB, I want it to be done right.  And I know that if the pins are ignored,
> then there could be some issues with power consumption. CMOS is worse than
> TTL for this.
>

Brendan, I've made a lot of PC boards where I ignored the unused pins.  Power
consumption was really never an issue because I was always running of a wall
wart.  Even so, I can't imagine that the power consumed by an unused pin
would be significant.  And I have followed the same procedure with the
"other" micro-processor.

Sid

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


2002\08\28@202427 by David Duffy

flavicon
face
At 08:00 PM 28/08/2002 -0400, you wrote:
>In a message dated 08/28/2002 19:46:38 Eastern Daylight Time,
>EraseMEbmoranRemoveMEspam@spam@MILLENNIUM.CA writes:
>
> > That's what I *have* been doing, but since I'm committing this project to a
> > PCB, I want it to be done right.  And I know that if the pins are ignored,
> > then there could be some issues with power consumption. CMOS is worse than
> > TTL for this.
> >
>
>Brendan, I've made a lot of PC boards where I ignored the unused pins.  Power
>consumption was really never an issue because I was always running of a wall
>wart.  Even so, I can't imagine that the power consumed by an unused pin
>would be significant.  And I have followed the same procedure with the
>"other" micro-processor.

Hi Sid,
It's not the power consumption as such, but the whole chip can oscillate and
behave badly when you let inputs float. It's just like leaving unused inputs on
CMOS gates floating - just asking for trouble. They (CMOS) have a habit of
latching up, heating up and dying. The increased power consumption is just a
symptom of the problem and should not be ignored.
Regards...
___________________________________________
David Duffy        Audio Visual Devices P/L
U8, 9-11 Trade St, Cleveland 4163 Australia
Ph: +61 7 38210362   Fax: +61 7 38210281
New Web: http://www.audiovisualdevices.com.au
___________________________________________

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


2002\08\28@210747 by Jim

flavicon
face
I would at least attach the pin to a
pad - where a resistor or a jumper
could be placed optionally at build
(board-stuff) time ...

RF Jim

{Original Message removed}

2002\08\28@210908 by Leonard Gabrielson

picon face
Hi,

Oscillation is not a problem if you simply make them outputs and connect
them to nothing.  I've been doing it for years.

Len
{Original Message removed}

2002\08\28@235835 by Jim

flavicon
face
I would at least attach the pin to a
pad - where a resistor or a jumper
could be placed optionally at build
(board-stuff) time ... or later (after
 discovery of a problem)!

RF Jim

>
> {Original Message removed}

2002\08\28@235846 by David Duffy

flavicon
face
Len wrote:
>Oscillation is not a problem if you simply make them outputs and connect
>them to nothing.  I've been doing it for years.

That's right. The oscillation or such occurs when the pin floats (when input).
It can be biased into its linear region, which makes it draw excessive current
and generally becoming unhappy. (This is what I said the first time isn't it?)
OK, I think we have this clear for the OP now! Time to get back to work. :-)

<snip>
> > Hi Sid,
> > It's not the power consumption as such, but the whole chip can oscillate
> > and behave badly when you let inputs float. It's just like leaving unused
> > inputs on
> > CMOS gates floating - just asking for trouble. They (CMOS) have a habit of
> > latching up, heating up and dying. The increased power consumption is just
> >a symptom of the problem and should not be ignored.

___________________________________________
David Duffy        Audio Visual Devices P/L
U8, 9-11 Trade St, Cleveland 4163 Australia
Ph: +61 7 38210362   Fax: +61 7 38210281
New Web: http://www.audiovisualdevices.com.au
___________________________________________

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


2002\08\29@074933 by Olin Lathrop

face picon face
> Just wondering what you folks consider standard procedure for
> handling unused PIC pins.

I set them as outputs driving low and leave them disconnected because:

1  -  It is easier to make a manual change to use a pin if it is not
connected to anything.

2  -  A firmware bug won't accidentally cause a lot of current draw thru the
pin.

3  -  Driving low by default is better than driving high because this works
for open drain outputs too.

My PIC assembler preprocessor and the PORT module automatically set all
unused pins as outputs driving low.  See the /INBIT and /OUTBIT directives
in PREPIC and the PORT module at http://www.embedinc.com/pic.


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

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


2002\08\29@075347 by Olin Lathrop

face picon face
> Brendan, I simply ignore unused pins.

Bad idea.

CMOS inputs are very high impedence and can pick up noise if not driven.
Noise on an input will increase overall current draw from the extra clock
edges, and can be worse if the input is held in the mid region.


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

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestspamBeGonespammitvma.mit.edu


2002\08\29@080010 by Olin Lathrop

face picon face
From: "Sid Weaver" <spam_OUTNEWZEDspamspamAOL.COM>
> Brendan, I've made a lot of PC boards where I ignored the unused pins.
Power
> consumption was really never an issue because I was always running of a
wall
> wart.  Even so, I can't imagine that the power consumed by an unused pin
> would be significant.  And I have followed the same procedure with the
> "other" micro-processor.

Sooner or later you'll get bitten.  Yes, you can get away with floating
inputs most of the time.  If you don't want to learn from everyone here that
you shouldn't leave inputs floating, that's your business, but please stop
advising others to do so.


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

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


2002\08\29@082927 by Sid Weaver

picon face
In a message dated 08/28/2002 20:25:56 Eastern Daylight Time,
spamBeGonedavidKILLspamspamKILLspamAUDIOVISUALDEVICES.COM.AU writes:


> Hi Sid,
> It's not the power consumption as such, but the whole chip can oscillate and
> behave badly when you let inputs float. It's just like leaving unused
> inputs on
> CMOS gates floating - just asking for trouble. They (CMOS) have a habit of
> latching up, heating up and dying. The increased power consumption is just a
> symptom of the problem and should not be ignored.
> Regards...
>

For David

When I said I ignore them, what I really meant was to set them as outputs
then forget about them.  In a finished PC you you will probably never need
them, but it is nice to have an uncluttered pin available "just in case".
There have been times in the past when a wire jumper and a small program
change saved a complete circuit.

Ever been to Cook?

Cheers

Sid

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


2002\08\29@104324 by Ken Crismon

flavicon
face
David,

A newbie addition to this question.  What should the unused pins be "tied" to.  Ground???

Thanks,

Ken Crismon

{Original Message removed}

2002\08\29@104600 by 4HAZ

flavicon
face
My $0.02
I am working with a single pcb layout at present that covers a line of
products, minor differences in components and microcontroller code and what
is externally connected and viola a new and different product.
I personally leave the unused pins programmed as inputs / outputs depending
on their normal usage, the unused inputs are either tied high or low via a
10k or so resistor.
For example one of the inputs normally comes from another device whos output
is an npn open collector configuration, the pull-up resistor on my pcb will
prevent oscilation even if that function is not being used.
The important thing to remember here is not to directly ground any "unused"
pin.

Lonnie - KF4HAZ -

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


2002\08\29@162224 by Russell McMahon

face
flavicon
face
Write this in your "Things must know about microprocessors" book.

       **** Ignoring unused pins is bad engineering. ****

It's asking for trouble.
Sooner or later you will be sorry.
You may already be sorry and wonder why :-)
This applies to almost every microprocessor - it's NOT a PIC specific
problem.

The only situation where it wouldn't matter (much) would be if the default
port setting was inputs with pullups enabled.

If an input floats it will likely spend a significant part of its time near
the middle of the voltage range. Near is a relative term depending somewhat
on processor. Unless you input is Schmitt triggered, having it float mid
supply will do BAD things. A Schmitt will draw less extra current (but still
more than normal). Regardless, it will not only draw higher current but MAY
noise up A2Ds, make the processor act funny like, create EMI and more. Often
it mightn't. Sometimes it will. Don't do it.

Choices in approximate order of decreasing goodness (IMHO) BUT this will
vary with your level of discipline and documentation.

1 Input with internal pullup.
2 Output set high or low.
3 Input with external pull up/down
4 Input tied to ground.supply

1 is zero cost but can be destroyed by software change.

2 is zero cost but has a pin doing something - not usually a problem unless
someone equates unused with don care.

3 Costs the pull up/down but is well defined.
This is the safest option but annoying.

4 Is free BUT can cause bad problems if software is changed.

       Russell McMahon

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


2002\08\29@163652 by lexandre_Guimar=E3es?=

flavicon
face
Hi,

> 4 Input tied to ground.supply

> 4 Is free BUT can cause bad problems if software is changed.

   I would NEVER do that ! I have seen a product ( Thanks God it was not
mine ! ) from a client that just blew 200 boards in a cold month because of
that !!!! It was poorly designed in every way I can think of and was very
sensitive to EMI. The ports changed state from input to output and the chips
just blew apart. I agree that if the other aspects of the design were better
thought that should not happen often but I can't see any advantages of tying
the pin to ground !!

   Pull-ups or down are the best if you can afford it, if not just leave
the ports as outputs. There is nothing to be gained by relying on the
internal pullups or tying the pin to ground or VCC.

Best regards,
Alexandre Guimaraes

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


2002\08\29@164054 by mike

flavicon
face
On Thu, 29 Aug 2002 17:37:21 -0300, you wrote:

>Hi,
>
>> 4 Input tied to ground.supply
>
>> 4 Is free BUT can cause bad problems if software is changed.
>
>    I would NEVER do that ! I have seen a product ( Thanks God it was not
>mine ! ) from a client that just blew 200 boards in a cold month because of
>that !!!! It was poorly designed in every way I can think of and was very
>sensitive to EMI. The ports changed state from input to output and the chips
>just blew apart. I agree that if the other aspects of the design were better
>thought that should not happen often but I can't see any advantages of tying
>the pin to ground !!
>
>    Pull-ups or down are the best if you can afford it, if not just leave
>the ports as outputs. There is nothing to be gained by relying on the
>internal pullups or tying the pin to ground or VCC.

Have you ever designed complex single-layer PCBs ?
--
http://www.piclist.com hint: To leave the PICList
spampiclist-unsubscribe-requestspammitvma.mit.edu


2002\08\29@165353 by hard Prosser

flavicon
face
I just looked at my last 3 main projects - Not an unused pin on any of
them!
But if there were, they'd be outputs. - if there's space it can be useful
to bring them out to some sort of pad & they can be real helpful when
debugging.

Richard P




Write this in your "Things must know about microprocessors" book.

       **** Ignoring unused pins is bad engineering. ****

It's asking for trouble.
Sooner or later you will be sorry.
You may already be sorry and wonder why :-)
This applies to almost every microprocessor - it's NOT a PIC specific
problem.

The only situation where it wouldn't matter (much) would be if the default
port setting was inputs with pullups enabled.

If an input floats it will likely spend a significant part of its time near
the middle of the voltage range. Near is a relative term depending somewhat
on processor. Unless you input is Schmitt triggered, having it float mid
supply will do BAD things. A Schmitt will draw less extra current (but
still
more than normal). Regardless, it will not only draw higher current but MAY
noise up A2Ds, make the processor act funny like, create EMI and more.
Often
it mightn't. Sometimes it will. Don't do it.

Choices in approximate order of decreasing goodness (IMHO) BUT this will
vary with your level of discipline and documentation.

1 Input with internal pullup.
2 Output set high or low.
3 Input with external pull up/down
4 Input tied to ground.supply

1 is zero cost but can be destroyed by software change.

2 is zero cost but has a pin doing something - not usually a problem unless
someone equates unused with don care.

3 Costs the pull up/down but is well defined.
This is the safest option but annoying.

4 Is free BUT can cause bad problems if software is changed.

       Russell McMahon

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

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


2002\08\29@200709 by David Duffy

flavicon
face
At 09:33 AM 29/08/02 -0500, you wrote:
>David,
>
>A newbie addition to this question.  What should the unused pins be "tied"
>to.  Ground???

Ken,
As previously advised, don't tie them to anything. Leave them not connected
& set as output.
This is not a "floating" pin as the PIC is driving the output to a known
state. The problem is
when the pin is set to *input* and left not connected. Then, external
forces (the way you hold
your tongue, phase of the moon, etc!) will let the pin wander into the
undefined region (neither
high nor low) and the PIC pin input circuitry will draw more current and
possible behave in a
less than predictable manner. As others have pointed out, if you have spare
port pins, you
can always add pull up/down resistors to them for future expansion. I hate
having PIC pins on
a board that are unused! I usually think of extra features to use them at
minimal cost or bring
them out to a connector (or pads) and chuck a series resistor in there (for
driving a LED) or
a pull-up resistor for adding a switch later on. A lot of the boards I
design are multi-purpose.
Regards...

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


2002\08\29@230505 by Ken Crismon

flavicon
face
Thanks for the info David.  After reading further it became clear that the "set to output" was the most common response.

I am a newbie and having fun learning a lot about the PIC and the 8051 at the same time.  Building two proto-types one for each controller and the engineering team will decide later which is better for our application.  My take is it will come down to cost and maintainability.

Regardless...  Sure am having a lot of fun.  My past life I was a Z-80 dude but things have certainly changed!!!

Thanks again for the answer and I'll have lots more stupid newbie questions but fortunately this list seems to deal with them very nicely!!!

Cheers,

Ken

{Original Message removed}


'[PIC]: Unused pins'
2002\09\01@110329 by Dan Marchesani
picon face
Hi Brendan,

That is a pretty fair question to ponder.

Port Pins as INPUTS
If as INPUTS, set either to ground or Vdd .  Floating INPUT is a NO NO
in CMOS.  Floating the input gates of a CMOS devices will allow them to
charge to the surrounding fields.  This could  cause the floating input
to hanging in between a logic 1 or 0 (1/2 Vdd) where the CMOS device
drains its highest current and heats it up.   (I guess you know that)

Port Pins as OUTPUTS
Well if you have your unused Pins set as OUTPUTS, and floating, a few
things can happen.  Accidental shorts to these pins can happen.  You'll
have to check the data sheets on what kind of protection there is
against this.  Shorts from a voltage source higher then the device's Vdd
may damage them.  Out side of shorts there is no real problem setting
them to OUTPUTS.  If I may add, as OUTPUT, the programming if it sends
logic changes to this unused pin, current during transit still normally
occur internally to the output gate.  Also if your supply source is from
a batt, then you might take this current into consideration, and not set
your unused pins to output.

On the other hand, you can still get away with the OUTPUT setting while
using a batt, just as long as there is no logic changes take place on
these outputs.

I personally I like to set the I/O Pins to INPUT and ground them.  Yet
there are times I may make them OUTPUTS and let them float and chance
the problems of shorts.  Mainly if I make the unused Pins as output,
generally this will occur in my projects because the USED PINS on their
common port is also outputs (it is less of a pain in the neck to program
around).

In the real world, unused and used OUTPUTS are prone to taking a short,
and can be damaged, no more differently.

Dan M.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\09\01@111917 by Wouter van Ooijen

face picon face
> Well if you have your unused Pins set as OUTPUTS, and floating, a few
> things can happen.

A basic course on logic learned me (long ago) that when a particular
line of reasoning states that a contradiction is true, you are allowed
to take *any* proposition as beging true. So once you have achieved the
above effect (both floating and outputs) I guess a lot more than just 'a
few things' can happen..... (like the S/N ratio on the PICList suddenly
reaching 1.0).

Wouter van Ooijen

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

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\09\01@195834 by David Duffy

flavicon
face
Dan M wrote:
>Hi Brendan,
>That is a pretty fair question to ponder.
>
>Port Pins as INPUTS
>If as INPUTS, set either to ground or Vdd .  Floating INPUT is a NO NO
>in CMOS.  Floating the input gates of a CMOS devices will allow them to
>charge to the surrounding fields.  This could  cause the floating input
>to hanging in between a logic 1 or 0 (1/2 Vdd) where the CMOS device
>drains its highest current and heats it up.   (I guess you know that)

Yes, this is correct.

{Quote hidden}

I guess you and I will have to disagree on this Dan. Newbies just don't need
the added complication of having port pins grounded and accidently setting
them to output killing the chip in the process. The ideal way for them is to
use pull-up/down resistors I guess but not many will actually do it.  :-)

>In the real world, unused and used OUTPUTS are prone to taking a short,
>and can be damaged, no more differently.

In the real world, your unused pins won't get shorted because they don't
go anywhere near the customer interface. (usually not connected at all)
Regards...
___________________________________________
David Duffy        Audio Visual Devices P/L
U8, 9-11 Trade St, Cleveland 4163 Australia
Ph: +61 7 38210362   Fax: +61 7 38210281
New Web: http://www.audiovisualdevices.com.au
___________________________________________

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\09\02@075832 by Olin Lathrop

face picon face
> >In the real world, unused and used OUTPUTS are prone to taking a short,
> >and can be damaged, no more differently.
>
> In the real world, your unused pins won't get shorted because they don't
> go anywhere near the customer interface. (usually not connected at all)

Not to mention that you've got much bigger problems if something is shorting
against traces on the board.


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

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


2002\09\02@094948 by Dan Marchesani

picon face
Hi Olin Latrop

In addition having an input held at 1/2 Logic the voltage between 0 and Vdd will cause the CMOS Device's internal gate to heat up.  Floating inputs is certainly the worse thing anyone can do with CMOS.

I recall the early days of CMOS where many engineers that had little practices in design using this new family.  I seen many products that actually got placed on the Market, only to come back and have to be reworked.  

Most had experience with TTL.  In TTL it was OK to float an input and get away with it.  But CMOS Device Inputs being Hi Z, allow them to charge up from pick up of the surrounding field (noise).  

In a CMOS INVERTER as an example, once the input gate charges enough to reach UNKNOWN LOGIC a voltage of 1.5 v above Vss (with a 5 V supply), the output of this gate starts to conduct between the two internal output FET.  Once your input reaches Mid Voltage of 2.5 Volts,  Both these FET's are on. allowing  current is flowing between the Source and Ground, using the two internal FET as a load.  After some time they might heat up enough to be damaged.

Well I am glad you asked this question.  Many people getting involved with CMOS today need to understand this major point.  


Good Luck, you just took another step up.

Dan Marchesani


Olin Lathrop wrote:
Brendan, I simply ignore unused pins.

Bad idea.

CMOS inputs are very high impedence and can pick up noise if not driven.
Noise on an input will increase overall current draw from the extra clock
edges, and can be worse if the input is held in the mid region.


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

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




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

2002\09\02@102553 by Dan Marchesani

picon face
Dan Marchesani wrote:

>
> In a CMOS INVERTER as an example, once the input gate charges enough
> to reach UNKNOWN LOGIC a voltage of 1.5 v above Vss (with a 5 V
> supply), the output of this gate starts to conduct between the two
> internal output FET.  Once your input reaches Mid Voltage of 2.5
> Volts,  Both these FET's are on. allowing  current is flowing between
> the Source and Ground, using the two internal FET as a load.  After
> some time they might heat up enough to be damaged.
>
Additionally:

We all kind of view the devices we work with as logical.  We tend to
over look the analog aspect.  After reading many responses to the
subject I noticed the over view was pointing mainly to the logic level
being either 1 or 0.  Clocking, Oscillating, and transit between these
two logic levels.  The current drain verses frequency etc.  (Some did
address the 1/2 Logic voltage problem -  they are the really experienced. )

Floating Input Gates as I described can damage the device, which I think
is the most paramount design problem over all.  In normal operation,
current drain only occurs during transit between the two logic levels,
but once the input is held at MID POINT, a condition that is NOT normal
for logic devices.  Chip Manufacturers design these devices to with
stand TRANSIT CURRENT.

Why we don't see our designs failing to damage due to floating inputs,
is because the surrounding fields (noise) are analog in  nature.  They
never hold the voltage at 1/2 logic ( Mid point between Vss and Vdd).
So I guess they don't heat up to a point of getting damaged right away.
 Over time they could and will fail.

Danny Marchesani

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


2002\09\02@104512 by Dan Marchesani

picon face
Olin Lathrop wrote:

>Sooner or later you'll get bitten.  Yes, you can get away with floating
>inputs most of the time.  If you don't want to learn from everyone here that
>you shouldn't leave inputs floating, that's your business, but please stop
>advising others to do so.
>

I TOTALLY AGREE............  FLOATING INOUTS IS THE WORST THING ANYONE
CAN HAVE IN A DESIGN "THE WORST"

Dan Marchesani

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


2002\09\02@111649 by Dan Marchesani

picon face
Hi Olin,

I always pondered the best way to handle them.  Of all I read, your
notes are worth following....

Only problem with partially used ports where some pins are used as
outputs, the output logic from the program needs to be masked to
maintain  the unused Hardware Pin Logic LOW.  Its a little bit of a
pain, but I guess it is worth it, if future prototyping / board changes
are kept in mind.  I guess this one of my sticking points I could never
resolve in my thinking.

Yes, your NOTE Number 2 is certainly a good reason to follow this
method.  Crazy problems can and do occur.  Sometimes the processor can
take off on it's own, changing what we set the I/O pins for.  If an
unused pin is tied to ground, and some how is forced into being an
output, with a logic HI....  It doesn't take a rocket  scientist to
figure the rest, ha ha..

Thanks
Dan Marchesani

Olin Lathrop wrote:

{Quote hidden}

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


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