I wrote > (like mistakes in the datasheets and errors in sample code) Here's one - well, two actually, in just 8 lines. Datasheet Example 10-1 for the 4520, a fairly recent device Initializing PortA to as i/p, RA<5:4> as o/p CLRF PORTA CLRF LATA MOVLW 07H MOVWF ADCON1 MOVWF 07H MOVWF CMCON MOVLW 0CFH MOVWF TRISA What a bloody waste of a Sunday afternoon. The MOVWF 07H is an easy one to spot. The killer was 07 into ADCON1. It should be 0F. BTW, I didn't copy that routine verbatim, but did set ADCON1 to 07 (because that's what you do on many other PICs, so it didn't seem out of the ordinary). Not until I'd pulled my code apart line by line, including cross-checking the above with the A2D section did I finally get some pushbuttons working on PortA of a 2520 grrrrrrrrrr -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist