On 2010-09-22 13:28, ivp wrote: > >> That's why I thought it odd that Microchip clear both (effectively the >> same) in their example. It wouldn't be the first time their examples >> were not the best. > > In some datasheets this is the initialisation example and commenting > > eg 18F1x20 > > CLRF PORTA ; Initialize PORTA by clearing output data latches > CLRF LATA ; Alternate method to clear output data latches If one look at the port schematics in the datasheet ("FIGURE 10-1:") one see that electricaly/electronicaly writing to PORTx or LATx is exactly the same thing. There is only one line going into the CK line of the output latch marked "WR LAT or Port". So the two commands above not only have the same end effect, they actualy do exactly the same thing in the processor. Reading is another matter and there are separate "RD LAT" and "RD Port" lines in the port schematic. Jan-Erik. > MOVLW 0x7F ; Configure A/D > MOVWF ADCON1 ; for digital inputs > MOVLW 0XD0 ; Value used to initialize data direction > MOVWF TRISA ; Set RA<3:0> as outputs, RA<7:4> as inputs > > Some comments have not been included in the 16F1934 code > > Joe > > * > * > ********** > Quality PIC programmers > http://www.embedinc.com/products/index.htm --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .