The LCD constantly shows nothing even though I built program sucessfully and found no error. I tried for many times in the past days but it doesn't work. I tried appling this code on PIC16F877 by replace some necessary instructions and it worked . Below is my code in assembly language:
PROCESSOR PIC18F4520
#include <p18f4520.inc>
CONFIG WDT=OFF
CONFIG BOREN=OFF
CONFIG OSC=HS
CONFIG LVP=OFF
CBLOCK 0x20
COUNT, COUNT1, TEMP
ENDC
#DEFINE RS PORTD,0
#DEFINE RW PORTD,1
#DEFINE E PORTD,2
ORG 0X000
MAIN:
CLRF PORTD
CLRF TRISD
CALL INIT_LCD
MOVLW 'D'
CALL SEND_DATA
GOTO $
INIT_LCD:
MOVLW 0X20
CALL SEND_CMD
MOVLW 0X28
CALL SEND_CMD
MOVLW 0X0E
CALL SEND_CMD
MOVLW 0X06
CALL SEND_CMD
MOVLW 0X01
CALL SEND_CMD
RETURN
SEND_CMD:
MOVWF TEMP
ANDLW 0XF0
MOVWF PORTD
BCF RS
CALL ALLOW
SWAPF TEMP,0
ANDLW 0XF0
MOVWF PORTD
BCF RS
CALL ALLOW
CALL DELAY
RETURN
ALLOW:
BSF E
NOP
BCF E
RETURN
SEND_DATA:
MOVWF TEMP
ANDWF 0XF0
MOVWF PORTD
BSF RS
CALL ALLOW
SWAPF TEMP,0
ANDWF 0XF0
MOVWF PORTD
BSF RS
CALL ALLOW
CALL DELAY
RETURN
DELAY:
MOVLW 0XFF
MOVWF COUNT
DEL:
MOVLW 0XFF
MOVWF COUNT1
DEC:
DECF COUNT1,1
BNZ DEC
DECFSZ COUNT,1
GOTO DEL
RETURN
END