Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/08/05 16:03
Read: times


 
#89277 - Here comes new(?) problem. ^_^;
Responding to: ???'s previous message
By setting the register before turning EN to high as everyone suggested, the program can finally get out of the WAIT_LCD loops. But here comes new(?) problem in the initialization state.


INIT_LCD:
CLR RS
SETB E
MOV D,#38h
CLR E
LCALL WAIT_LCD ; *** 1 ***

CLR RS
SETB E
MOV D,#0Eh
CLR E
LCALL WAIT_LCD ; *** 2 ***

CLR RS
SETB E
MOV D,#06h
CLR E
LCALL WAIT_LCD
RET

The only thing I see on the LCD display is a black cursor positioned around the center.

I try debugging the program and found that...

- The "Function set" initialization (MOV D,#38h) is completed and the program jumps to WAIT_LCD routine at *** 1 ***.

- The program can get out of WAIT_LCD routine called by *** 1 ***.

- After MOV D,#0Eh (turn the cursor on) and continue to WAIT_LCD at *** 2 ***, now the program get stucked in WAIT_LCD again between...

WAIT_LCD:
CLR RS ; thisline
SETB RW
SETB E
MOV D,#0FFh
MOV A,D
JB ACC.7,WAIT_LCD ; to this line
CLR E
CLR RW
RET

The full (modified by me) code looks like this...
D0 EQU P1.0
D1 EQU P1.1
D2 EQU P1.2
D3 EQU P1.3
D4 EQU P1.4
D5 EQU P1.5
D6 EQU P1.6
D7 EQU P1.7
E EQU P3.7
RS EQU P3.6
RW EQU P3.5
D EQU P1

ORG 0000h
LJMP MAIN

WAIT_LCD:
CLR RS
SETB RW
SETB E
MOV D,#0FFh
MOV A,D
JB ACC.7,WAIT_LCD
CLR E
CLR RW
RET

INIT_LCD:
CLR RS
SETB E
MOV D,#38h
CLR E
LCALL WAIT_LCD

CLR RS
SETB E
MOV D,#0Eh
CLR E
LCALL WAIT_LCD

CLR RS
SETB E
MOV D,#06h
CLR E
LCALL WAIT_LCD
RET

CLEAR_LCD:
CLR RS
SETB E
MOV D,#01h
CLR E
LCALL WAIT_LCD
RET

WRITE_TEXT:
SETB RS
SETB E
MOV D,A
CLR E
LCALL WAIT_LCD
RET

MAIN:
LCALL INIT_LCD
LCALL CLEAR_LCD
MOV A,#'H'
LCALL WRITE_TEXT
MOV A,#'E'
LCALL WRITE_TEXT
MOV A,#'L'
LCALL WRITE_TEXT
MOV A,#'L'
LCALL WRITE_TEXT
MOV A,#'O'
LCALL WRITE_TEXT
MOV A,#' '
LCALL WRITE_TEXT
MOV A,#'W'
LCALL WRITE_TEXT
MOV A,#'O'
LCALL WRITE_TEXT
MOV A,#'R'
LCALL WRITE_TEXT
MOV A,#'L'
LCALL WRITE_TEXT
MOV A,#'D'
LCALL WRITE_TEXT
END

If possible can you give me any clue on how to fix this please?

Thank you. ^_^

P.S. This field is very interesting. There's never any computer language that can give me problems in a "Hello World!" program ^_^;

List of 22 messages in thread
TopicAuthorDate
Hello World program problem.            01/01/70 00:00      
   More info            01/01/70 00:00      
      Scope ?            01/01/70 00:00      
   Suspect tutorial?            01/01/70 00:00      
      Definitely suspicious!            01/01/70 00:00      
         You are right            01/01/70 00:00      
            Craig, you are not the only one            01/01/70 00:00      
               Of course...            01/01/70 00:00      
                  been there, done that            01/01/70 00:00      
            For what it's worth (not much)            01/01/70 00:00      
      Absolutely !!!            01/01/70 00:00      
         ISIS ?            01/01/70 00:00      
            Isis manufacturer website            01/01/70 00:00      
   Here comes new(?) problem. ^_^;            01/01/70 00:00      
      Correction            01/01/70 00:00      
         Good to hear it really worked. ^_^            01/01/70 00:00      
   Be sure it solves your problem!            01/01/70 00:00      
      Re:            01/01/70 00:00      
   Its ISIS not the code            01/01/70 00:00      
      Status not supported            01/01/70 00:00      
         Polling Vs Delays            01/01/70 00:00      
            What kind of an excuse is that?!            01/01/70 00:00      

Back to Subject List