Hi Barasha,
Thank you for your question.
There are 2 ways to send commands/data to LCD. --(1) Call a time delay before sending next data/command to an LCD (2) To monitor the busy flag before issuing a command / data to the LCD.
The READY subroutine follows the second method.
Note:- D7 bit of (command reg) LCD is busy flag which is connected to P1.7 of the microcontroller in my case(as D0 to D7 connected to port 1). To check that flag you need to make R/S=1 and RS=0 and a low to high pulse for the E pin. After that P1.7 reflects the state of busy flag.
READY:
SETB P1.7 ;To make P1.7 input port
CLR P2.0 ;RS=0 to access command reg
SETB P2.1 ;R/W = 1 to read command Reg
BACK:
CLR P2.2 ;E=0 to provide low to high pulse
ACALL DELAY ; give some time(pulse time)
SETB P2.2 ; low to high pulse ends
JB P1.7,BACK ; stay till busy flag=0
RET
Hope this will throw some light.
Today its already very late. I will check your code tomorrow.
Thanks
Rajsekhar