Yes, when you switch back to output mode, the last value written to the port will still be in the output latch. However, there is a gotcha.... if you use any read-modify-write instructions (including BCF, BSF and any others) on the port then the latch will be overwritten. This is usually only a problem if the port is mixed between inputs and outputs, as opposed to all inputs or all outputs. Bob Ammerman RAm Systems ----- Original Message ----- From: "Jon Baker" To: Sent: Tuesday, May 21, 2002 6:44 PM Subject: [PIC]: State of output drivers after a tris change If I ran the following pseudo-code: TRISB = 0 PORTB = 0xAA TRISB = 255 TEMP = PORTB TRISB = 0 After to port is set back to output what will be the state of the pins? Does the contents of the output driver get destroyed when changing TRIS, or when performing a read operation on the port? I'm hoping that my original value ( AA ) is presented on the pins when I switch back to output mode. Thanks muchly. Jon Baker -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu