William Chops Westfield wrote: > and you need to insert initialization code like: > > (This from "example 5-1" of the 628a datasheet.) Argh. See rule 1. > CLRF PORTA ;Initialize PORTA by > ;setting > ;output data latches The bank must be set for access to PORTA before this instruction. > MOVLW 0x07 ;Turn comparators off and > MOVWF CMCON ;enable pins for I/O ;functions Another banking problem waiting to happen. In addition, if you do an IFDEF on CMCON you can put it as standard intialization code to turn off the comparator if it exists. This same snippet would then produce no instructions on a 16F84, but init the comparator to off on the 16F628. It's a good idea to use the same strategy for the A/D converter. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist