Thanks kindly for all of the replies! > On Sun, 16 Feb 2003 15:31:45 -0800, Neil Bradley wrote: > movlw PORTA_IN ; Get port A's input setting > movwf TRISA ; Set up appropriate tristating > > Using MOVLW you are getting the address of the variable not its > contents. > > Try > movlw 0x40 or B'01000000' > movwf TRISA > > The PORTA_IN did you #def or EQU it in your listing? Sorry to not have been more clear. I have put in the beginning: INCLUDE "P18f252.inc" And later: ; Generic definitions go here BIT_0 equ b'00000001' ; Bit 0 BIT_1 equ b'00000010' ; Bit 1 BIT_2 equ b'00000100' ; Bit 2 BIT_3 equ b'00001000' ; Bit 3 BIT_4 equ b'00010000' ; Bit 4 BIT_5 equ b'00100000' ; Bit 5 BIT_6 equ b'01000000' ; Bit 6 BIT_7 equ b'10000000' ; Bit 7 ; Specific definitions go here ; Port A definitions PORTA_OUT equ (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5) PORTA_IN equ ((~PORTA_OUT) & 0x7f) ; Leave bit 7 alone! ; Port B definitions PORTB_OUT equ (BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7) PORTB_IN equ (~PORTB_OUT) ; Port C definitions BIT_INH equ b'00000001' ; Inhibit bit definition BIT_CHA equ b'00000010' ; Channel A definition BIT_CHB equ b'00000100' ; Channel B definition BIT_SCLK equ b'00001000' ; Serial clock (SPI) BIT_SDATA equ b'00100000' ; Serial data (SPI) BIT_DACK equ b'01000000' ; Data acknowledgement to T89C51RD2 PORTC_OUT equ (BIT_INH | BIT_CHA | BIT_CHB | BIT_DACK) PORTC_IN equ (~PORTC_OUT) I've noticed that the values being loaded up in the W register are indeed as I expect. It's just reading the values of TRISA/B/C through the MPLAB IDE after they've been set that aren't right! I can forgive bit 7 in port A since it's nonexistent/undefined, but the oddities in the remainder of port A and B are a mystery. Thanks kindly to the Dave, David, and Colin! -->Neil ------------------------------------------------------------------------------- Neil Bradley In the land of the blind, the one eyed man is not Synthcom Systems, Inc. king - he's a prisoner. ICQ #29402898 -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads