CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

I/O port not used...

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
GDetienne



Joined: 20 Sep 2003
Posts: 47
Location: Brussel - Belgium

View user's profile Send private message

I/O port not used...
PostPosted: Tue Mar 22, 2005 9:54 am     Reply with quote

Hello,
I use a 16F876A. Some ports are not used.
I have read this week, on this forum, that it's not correct to let the non used port not connected.

Could you give me your advies ?
Port connected directly to ground or to + 5V with resistor (10 K)?
If set_tris() is used, port is declared as Input or Output ?

Thanks in advance.

Detienne Guy.
Ttelmah
Guest







PostPosted: Tue Mar 22, 2005 10:27 am     Reply with quote

Any of:
Set it as an input, and have a resistor pulling it high.
Set it as an output, and have a resistor pulling it low.
Set it as an input, and connect it to anoter pin that functions as an output.
Set it as an output, and drive it either high or low.
There is a 'caveat' with the pull up resistor, that power should not be applied to this, before the power is applied to the PIC.
There is a caveat with attaching it to another output, that you are increasing the loading on this pin when it changes state.
What you are trying to avoid, is the pin floating to an 'indeterminate state' (a voltage between the switching points for 'high', and 'low'), which can make CMOS inputs draw extra power.

Best Wishes
Ttelmah
Guest







PostPosted: Tue Mar 22, 2005 10:45 am     Reply with quote

Line two should be "set it as an input and have a resistor driving it low".

Best Wishes
valemike
Guest







PostPosted: Tue Mar 22, 2005 12:04 pm     Reply with quote

Ttelmah's right, and the post below from a Microchip FAE re-iterates what Ttelmah says...

Quote:
Hi Mike-

There are many opinions on the best way to handle unused digital I/O. You can configure them as inputs so long as you have them tied to either Vdd or Vss or you can configure them as outputs and leave them unterminated. If you wish to configure them as outputs and terminate them, drive the outputs to the rail you have tied it to--through a resistor- 10k should work just fine.

As I mentioned, there are many opinions on this, and a few customers of mine have their "standard operating procedure" on what to do. Best to just follow that if that is the case with your company...
GDetienne



Joined: 20 Sep 2003
Posts: 47
Location: Brussel - Belgium

View user's profile Send private message

Thanks.
PostPosted: Tue Mar 22, 2005 4:31 pm     Reply with quote

Thanks a lot for your advies.

Guy Detienne.
Will Reeve



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

PostPosted: Wed Mar 30, 2005 10:19 am     Reply with quote

Belts and braces > as pins nearly always start-up as inputs you can't 100% safe leaving a pin unconnected and setting it as an output as there will be a finite time when it's an input and floating?

Note the ? mark, I've done this on a few old projects and never had problems, but over the last couple of years always tie them to a rail with a resistor and leave them as inputs.

Anyone know the lowest power consumption mode? I presume it's an input tied to GND with 10k? An output must use a tiny bit of current to drive the pin logic?

Keep well,

Will
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Wed Mar 30, 2005 12:04 pm     Reply with quote

If you have unused pins, it is always nice to use them for a self test. It is a good practice to design your product for test but may not always be feasible.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group