On Sep 1, 2005, at 9:07 AM, Augusto Yipmantin wrote: > The original program was working well in a pic16f84a, but when I change > the headers and compile it for a pic16f628 never works. > The 628 has peripherals not present on the 84a that share the IO pins, and must be turned off in order to use those pins and normal digitial IO. The usual problem is the analog comparator module (unfortunately it makes a lot of sense that pins that might be connected to analog voltages power up in analog mode!), and you need to insert initialization code like: CLRF PORTA ;Initialize PORTA by ;setting ;output data latches MOVLW 0x07 ;Turn comparators off and MOVWF CMCON ;enable pins for I/O ;functions (This from "example 5-1" of the 628a datasheet.) BillW -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist