> The LCD doesn't seem to initialize and for sure my characters aren't being > displayed. I'm getting quite frustrated with this project. I'm hoping > someone out there can spot the error of my ways for me and help me get back > on the straight and narrow. High Voltages near the module can prevent initialization from working. I made a Geiger counter and had tons of problems trying to get my LCD to initialize in 4 bit mode. The problem turned out to be NOT the code, but that the 650V circuitry was too close to the data lines feeding the LCD. I shortened the data lines and shielded with some foil, and everything started working great! Here are segments of the code I used (uses internal 48KHz clock) Regards, Allan include "P16F628A.INC" list p=PIC16f628A __CONFIG _CP_OFF & _PWRTE_OFF & _WDT_OFF & _MCLRE_OFF & _INTOSC_OSC_NOCLKOUT & _LVP_OFF & _BODEN_OFF ; ------------- ; LCD Data ; RA0 DB4 O/P ; RA1 DB5 O/P ; RA2 DB6 O/P ; RA3 DB7 O/P ; ------------- ; RA6 for E O/P ; RA7 for RS O/P ; Ground RW #define LCD_E PORTA, 6 #define LCD_RS PORTA, 7 ORG 0 goto Start org 0x4 ; Interrupt Vector Start call LCD_init ; rest of code here LCDstr addwf PCL, f DT 0x33,0x32,0x28,0x01,0x0c,0x06,0 ;======================================== ; LCD INIT ROUTINE ;======================================== LCD_init clrf PORTA call MEDDELAY ; wait 20 mS call MEDDELAY bcf LCD_RS ; clear RS bcf LCD_E ; clear ENA clrf MSGPTR movf MSGPTR, W call LCDstr ; Get first byte from string into W register movwf CHAR ; Store in string get_LCDstr ; Initialization string for LCD bsf LCD_E ; Drive ENA High swapf CHAR, w ; swap nibbles andlw 0x0f ; mask out the upper nibble iorlw b'01000000' ; ensure ENA stays High movwf PORTA ; send upper nibble bcf LCD_E ; Drive E low so LCD will process input call MEDDELAY ; Wait 10ms bsf LCD_E ; Drive ENA High movf CHAR, w andlw 0x0f ; mask out the upper nibble iorlw b'01000000' ; ensure ENA stays High movwf PORTA ; send lower nibble bcf LCD_E ; Drive E low so LCD will process input call MEDDELAY ; Wait 10ms incf MSGPTR, f movf MSGPTR, W ; increment pointer - put the offset in W register call LCDstr ; fetch the next byte from the string into W Register movwf CHAR ; Store in string andlw 0xff ; sets the zero flag if W = 0 btfss STATUS, Z ; skip if zero bit set goto get_LCDstr call MEDDELAY ; Wait 10ms bsf LCD_RS ; set RS clrf MSGPTR return ; finished if W = 0 SHORTDELAY ; Delay of 550uS clrwdt nop nop return MEDDELAY ; Delay of 10mS movlw 14 movwf STORE2 LOOP2 call SHORTDELAY decfsz STORE2,1 goto LOOP2 return -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist