First in order to set the TRIS registers you need to change bank. (in case this is the whole code and not a segment) (for PORTA there is another register called ADCON1, check it's function in the datasheet) As for the nessecity question i leave that to the experienced of the list...(i would init them all) -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Paul Reilly Sent: Friday, September 01, 2000 4:39 PM To: PICLIST@MITVMA.MIT.EDU Subject: 16F877 port setup Hi, I'm using a PICF877 in a project. It's got more ports than you could shake a stick at. My question is do I need to worry about ports I'm not using? Presently my code initialses all the ports at the beginning, regardless of they're going to be used. It then sets unused ports as inputs, like so: bcf STATUS, RP0 ; \ bcf STATUS, RP1 ; / select bank 0 clrf PORTA ; initialise PORTA clrf PORTB ; initialise PORTB clrf PORTC ; initialise PORTC clrf PORTD ; initialise PORTD clrf PORTE ; initialise PORTE movlw B'11111111' ; port C - not used movwf TRISC ; make all inputs etc Is this worth doing, or can I just ignore unused ports and not bother setting their TRIS bits? I was going to tie all unused to Vss. Paul -- 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: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.