Dear All, I just begin to do programming on PIC. I used pic16f84 as my target MPU. Plan to do output of PORTB '11111111', all ports are logic high. But what I found output was Bit0, 2, 4, 6 are "1", and Bit 1, 3, 5, 7 are low. I inited portB to be all outputs, but it still giving me output of '01010101', why? I tried on portA, but it still gave '10101', funny output! Following is my simple source code:- -------- LIST p=16F84 ; Target PIC, PIC16F84 #include "P16F84.INC" ; include P16F84 header file PORTA equ 05 PORTB equ 06 count1 equ 0C count2 equ 0D org 0 ; origin 0 init movlw 0 tris PORTB ; set PORT B, [B0 - B7] are inputs movlw 0 start movlw 255 movwf PORTA call wait movlw 0 movwf PORTA call wait goto start wait movlw .200 ; load count1 with decimal 200 movwf count1 d1 movlw .200 ; load count2 with decimal 200 movwf count2 d2 decfsz count2, 1 ; decrement and skip next line if zero goto d2 ; if not zero decfsz count1 ; decrement count1 if count2 is zero goto d1 ; do inside loop again if count2 nz return END -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.