This is a multi-part message in MIME format. ------=_NextPart_000_0014_01C52187.7A1F2450 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Hi all i am having some problem here hope some one can help me on this I have written a program o recieve command from the rs232 to change the reg on the 18F The REG is access by indirect addressing attach is the main code the odd this is that when i write 255 to DDRD and then some thing to PORT D the port become a output!!! then i read back the DDRD value it is still 255 what can be wrong The odd this is that there is no problem when i use it on portB. what can be wrong can some one enlighten me? ------=_NextPart_000_0014_01C52187.7A1F2450 Content-Type: text/plain; format=flowed; name="code.txt"; reply-type=original Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="code.txt" CommandLoop =09 call Rx_Byte=09 movf Rx_Data,w movwf COMMAND =09 call Rx_Byte=09 movf Rx_Data,w movwf ADDRESS =09 movlw high JUMPSTART movwf PCLATH RLNCF COMMAND,W RLNCF WREG,W ADDWF PCL,F =09 JUMPSTART GOTO READ_ADDRESS GOTO WRITE_ADDRESS GOTO AND_ADDRESS GOTO OR_ADDRESS GOTO HIGH_PIN GOTO LOW_PIN GOTO COMMAND6 GOTO COMMAND7 GOTO COMMAND8 GOTO COMMAND9 GOTO COMMAND10 GOTO COMMAND11 GOTO COMMAND12 GOTO COMMAND13 GOTO COMMAND14 GOTO COMMAND15=09 =09 =09 READ_ADDRESS MOVLW #0x0F MOVWF FSR0H MOVF ADDRESS,W MOVWF FSR0L MOVF INDF0,W movwf Tx_Data call Tx_Byte GOTO CommandLoop WRITE_ADDRESS call Rx_Byte=09 movf Rx_Data,w movwf W_DATA MOVLW #0x0F MOVWF FSR0H MOVF ADDRESS,W MOVWF FSR0L MOVF W_DATA,W MOVWF INDF0 GOTO CommandLoop AND_ADDRESS call Rx_Byte=09 movf Rx_Data,w movwf W_DATA =09 MOVLW #0x0F MOVWF FSR0H MOVF ADDRESS,W MOVWF FSR0L MOVF W_DATA,W ANDWF INDF0,F GOTO CommandLoop OR_ADDRESS call Rx_Byte=09 movf Rx_Data,w movwf W_DATA MOVLW #0x0F MOVWF FSR0H MOVF ADDRESS,W MOVWF FSR0L MOVF W_DATA,W IORWF INDF0,F GOTO CommandLoop HIGH_PIN =09 MOVF ADDRESS,W ANDLW #0x70 SWAPF WREG,W ANDLW #0x07 =09 ADDLW #0x80 MOVWF FSR0L =09 MOVLW #0x0F MOVWF FSR0H =09 MOVF ADDRESS,W ANDLW #0x07 CALL PIN_TABLE =09 IORWF INDF0,F =09 GOTO CommandLoop LOW_PIN MOVF ADDRESS,W ANDLW #0x70 SWAPF WREG,W ANDLW #0x07 =09 ADDLW #0x80 MOVWF FSR0L =09 MOVLW #0x0F MOVWF FSR0H =09 MOVF ADDRESS,W ANDLW #0x07 CALL PIN_TABLE COMF WREG,W ANDWF INDF0,F GOTO CommandLoop PIN_TABLE movwf TEMP movlw high PIN_TABLE_ADDRESS movwf PCLATH=20 =09 movf TEMP,w ANDLW #0x07 RLNCF WREG,W ADDWF PCL,F PIN_TABLE_ADDRESS RETLW #0x01 RETLW #0x02 RETLW #0x04 RETLW #0x08 RETLW #0x10 RETLW #0x20 RETLW #0x40 RETLW #0x80 COMMAND6 COMMAND7 COMMAND8 COMMAND9 COMMAND10 COMMAND11 COMMAND12 COMMAND13 COMMAND14 COMMAND15 =09 =09 GOTO CommandLoop =09 =09 ;;-----------------------------------------------------------------------= ------- Rx_Byte nop RECEIVE_Loop=09 BTFSS PIR1,RCIF ; (5) CHECK FOR RECEIVED DATA bra RECEIVE_Loop MOVF RCREG,W movwf Rx_Data RETURN =09 Tx_Byte movf Tx_Data,w movwf TXREG RETURN ------=_NextPart_000_0014_01C52187.7A1F2450 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist ------=_NextPart_000_0014_01C52187.7A1F2450--