On Fri, Feb 08, 2002 at 10:37:10AM -0800, James Burkart wrote: > Hello, > > I've never used anything other than a 16F84 so I am confused > about tri-stating anything above port B. I am trying to set the > input/output status on ports C, D, and E of a 16F877 but am having > problems. I tried both the TRIS command and flipping banks and setting > the respective tristate register, but when I build the project I get an > error when I tristate portd and porte. > > Error[126] C:\PICPRO~1\TRANSM~1\XMTR.ASM 50 : Argument out of range > (0008 not between 0005 and 0007) > > I get this error on both ports. > > I'm sure it has something to do with the fact that the 16F877 > multiplexes ports D and E with other functions? Nope. It's the nature of the TRIS instruction. It's only definied for ports A through C. You'll find that TRIS isn't defined in the 16F87X datasheet even though it works fine. Frankly I'm not really sure why MChip is so hot to get rid of it. Like most things that are in non-zero banks, there isn't a truly clean way of getting it done. The obvious: bsf STATUS,RP0 movlw 0xA5 movwf TRISD bcf STATUS,RP0 Takes twice as many instructions and will generate a warning on the movwf unless you change the warning level on the assembler. But it should work just fine. BAJ -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.