I had this problem with a 452 which stumped me for some time. I still don't know why the PIC should do this. I've checked manuals and errata but find no mention of a connection between ADCON1 and PortB. Tried this on four 452s and three LCDs, same thing A 4-bit LCD is on PortB and 1 analogue i/p on PortA. No inputs are floating, no shorts, no nothing. Once code is running properly everything works as expected If ADCON1 is set (to 0x07 digitals) before TRISB, no problem. ADC and LCD work fine together. If ADCON1 is set after TRISB, the code hangs in the Busy routine and flow never returns from LCD initialisation Is there some subtlety I've missed in the documentation ? Normally I have port code in the order as below so never experienced this before. More of a curiousity than a show-stopper now I realise what happened. Wish I'd realised at 4am the other morning ;-) !!! TIA ======================== #define busy portb,7 #define rs porte,0 #define rw porte,1 #define en porte,2 ;PortB 4-7 - LCD data mov 0x07,adcon1 mov b'00001001',trisa ; 1 opto input ; 1 4-20mA i/p movwf dig_out0a ;output mask, clear xorlw b'00011111' ;output mask, set movwf dig_out1a mov b'00000111',trisb ; 0000 LCD data ; 1 pushbutton ; 1 Ring ; 1 external tick movwf dig_out0b ;output mask, clear xorlw b'11111111' ;output mask, set movwf dig_out1b (further down in code) mov b'11001110',adcon1 ; 1 right-justified ; 1 Fosc/64 high bit ; 1110 a.0 as analogue (further down still) mov b'10000111',trisb ;b7 as i/p bsf en rdbusy btfsc busy ;wait for Busy Flag clear bra rdbusy bcf en nop nop bcf rw mov b'00000111',trisb ;b7 as o/p return _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist