89c52 assembly programming doubts

Thread Starter

Barasha Mali

Joined Oct 13, 2010
15
Hi,
I am facing problems programming in assembly...Need some help
I am using 8052 μc with 16*2 LCD display..wrote the initialising program but its not working .can any one help me...plz

This is the progrm-


org 0000h
AJMP HERE

ORG 30H

HERE:
mov A,#38h
ACALL COMNWRT
ACALL DELAY
mov A,#0Eh
ACALL COMNWRT
ACALL DELAY
mov A,#01h
LI: JMP LI
 

DumboFixer

Joined Feb 10, 2009
217
Can you be more specific ?

you say it's not working - if what way ?

What is it doing ?

What should it be doing ?

Do you have a schematic ?
 

RiJoRI

Joined Aug 15, 2007
536
First, please use the code tags around your code (the '#' button above).

Second, according to your code, all you are doing is sending 3 commands to your display, but NOT sending any text! The display is displaying just what you tell it to -- nothing.

--Rich
 

Jon Wilder

Joined Oct 25, 2011
23
Not only that but we also need to see your COMNWRT subroutine. When using code tags, your code should look something like this -

Rich (BB code):
              org 0000h
              AJMP HERE

              ORG 30H

HERE:         mov          A,#38h
              ACALL        COMNWRT
              ACALL        DELAY
              mov          A,#0Eh
              ACALL        COMNWRT
              ACALL        DELAY
              mov          A,#01h
LI:           JMP          LI
 

Thread Starter

Barasha Mali

Joined Oct 13, 2010
15
Since i am at the initial stage, so i want to initialise the lcd first -i mean i want the cursor to display on my LCD.
I used the sub routines
After burning my program into the uP LCD shows only boxes which means that it isnt initialised
 

Jon Wilder

Joined Oct 25, 2011
23
We still don't have enough information to go on -

Which LCD display are you using (make and model)?

Can you post the subroutine that is labeled COMNWRT?

Are you using an actual 89C52 or is it an Atmel AT89S52?

Are you using internal or external program EPROM?

Also, most LCD displays need to be pulled into a reset condition upon power up of the microcontroller. So you need to add an instruction and a delay subroutine to your code -

Rich (BB code):
              org 0000h
              AJMP HERE

              ORG 30H

HERE:         clr          P3.4          ;reset LCD (assuming reset active low)
              ACALL        DELAY
              setb         P3.4          ;release reset
              mov          A,#38h
              ACALL        COMNWRT
              ACALL        DELAY
              mov          A,#0Eh
              ACALL        COMNWRT
              ACALL        DELAY
              mov          A,#01h
LI:           JMP          LI
 
Last edited:

Thread Starter

Barasha Mali

Joined Oct 13, 2010
15
This is my Cmndwrt subroutin and i am using a 16*2 LCD
COMNWRT:mov p2,A
CLR RS
CLR P3.5
SETB P3.6
ACALL DELAY
CLR P3.6
RET
 

Jon Wilder

Joined Oct 25, 2011
23
This is my Cmndwrt subroutin and i am using a 16*2 LCD
COMNWRT:mov p2,A
CLR RS
CLR P3.5
SETB P3.6
ACALL DELAY
CLR P3.6
RET
OK..."16*2 LCD" is not a "brand and model". I need the "brand" (who makes the LCD) and model number.

Second off...with the "CLR RS" instruction you're resetting the LCD unit every time you call your subroutine.
 
Top