Glyn: Set STATUS, RP0 _Before_ writing to TRISD and clear STATUS, RP0 _After_. The code for any of the PIC 16CXX's (not 5X's) applies directly, as far as style and method. The '74 just has more stuff. The '5X code applies with some minor mods. Get the embedded control handbook and read it and the data book. Brian