> http://pastebin.com/f10245624 Adjacent port pin operations can lead to read-modify-write problems bcf LCD_RS bcf LCD_E Separate with at least a couple of NOP http://www.piclist.com/techref/microchip/portpins.htm call LCD_UP Can't see that routine anywhere Here's something I'd typically use (this one on an 18F2550 @ 19.6608MHz) #define rs latb,3 #define rw latc,6 #define en latc,7 #define busy portb,7 ;================================================ ; Initialise LCD screen ;================================================ lcd_init call ms20 ;power-up bcf rs usec call write30 call msdelay ;delay > 4.1ms call msdelay call msdelay call msdelay call msdelay call write30 call msdelay ;delay > 100us call write30 call msdelay ;delay > 100us movlw b'00100000' ;20 call write_c movlw b'00001000' ;08 call write_c movlw b'00001100' ;0c call write_c movlw b'00000110' ;06 call write_c return write30 movfw portb andlw b'00001111' addlw b'00110000' movwf latb usec bsf en usec bcf en usec return ;=============================================== ; LCD commands ;================================================ line1 movlw 0x00 ;line 1, column 0 call address return line2 movlw 0x40 ;line 2, column 0 call address return address addlw 0x80 ;set high bit of address command call write_c return write_c bcf rs ;write command bra d_out write_d bsf rs ;write data ;LCD data - latb <4:7> ;Move MSN of data to MSN of PortB, preserve LSN of PortB d_out movwf temp1 ;save data movfw portb ;read port andlw b'00001111' ;clear MSN, preserve LSN movwf shadowb ;store PortB 0000LSN movfw temp1 ;get MSN of data andlw b'11110000' ;clear unwanted LSN addwf shadowb,w ;add data MSN as shadowd MSN movwf latb ;write to port usec bsf en usec bcf en usec ;Move LSN of data to MSN of PortB, preserve LSN of PortB movfw portb ;read port andlw b'00001111' ;clear MSN, preserve LSN movwf shadowb ;store PortB 0000LSN swapf temp1,w ;swap display data MSN and LSN andlw b'11110000' ;clear unwanted LSN (old MSN) addwf shadowb,w ;add data LSN as shadowd MSN movwf latb ;write to port usec bsf en usec bcf en usec call msdelay return bsf rw ;set up for Busy Flag read usec bcf rs usec bsf trisb,7 usec bsf en usec btfsc busy bra $-2 bcf trisb,7 usec bcf en usec bcf rw return -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist