> =A0Up until now, I've only used the older (lower end?) PICs 16F and lower don't have LAT. > I think I understand the difference between PORTx and LATx, but in one > data sheet Microchip show port B being initialised like so: > > BANKSEL =A0 =A0 PORTB > CLRF =A0 =A0 =A0 =A0PORTB > BANKSEL =A0 =A0 LATB > CLRF =A0 =A0 =A0 =A0LATB > BANKSEL =A0 =A0 ANSELB > CLRF =A0 =A0 =A0 =A0ANSELB > BANKSEL =A0 =A0 TRISB > CLRF =A0 =A0 =A0 =A0TRISB > > Why bother clearing TRISB when you would be only writing to LATB anyway? > David... TRIS controls the direction of the pin (e.g. input or output). Use PORT when you want to read a digital input. Use LAT when you want to write a digital output. See http://www.piclist.com/techref/readmodwrite.htm -Scott --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .