At 02:58 PM 8/10/2010, Olin Lathrop wrote: > > > > So, I think those first movwf port > > instructions were actually attempts to clear TRIS. > >Wow, that would be *really* bad programming. Olin - once again I'm forced to disagree with you. You live a sheltered life. You do most of your PIC programming in=20 the environment that you designed and you tweak that environment each=20 time you run across a new situation that is not handled correctly or optima= lly. That's actually really great - you've written a really nice=20 environment and are nice enough to share it with all of us. But living in that environment tends to give you tunnel vision. Its actually fairly common coding practice when working with the=20 14-bit core to treat the TRIS bits as if they were in the same=20 location as the port bits - but in a different bank. This is, of=20 course, exactly the case. They **ARE** in the same bit and register=20 locations - just in different banks. Recognizing this allows for some really neat code optimization,=20 particularly when you are writing your code to be somewhat port or=20 bit independent. I2C routines are the first thing that comes to=20 mind, but there are many others. I've seen much code written this way and I use this technique all the=20 time when writing my own code. It works, its efficient, its=20 readable, its maintainable. What more do you want? Yeah - it doesn't fit the Olin development model. That does NOT make=20 it " *really* bad programming ". dwayne --=20 Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax www.trinity-electronics.com Custom Electronics Design and Manufacturing --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .