Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] LCD 8 bit in Assembly

Status
Not open for further replies.

vishy71

Full Member level 2
Joined
Dec 16, 2010
Messages
126
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
Iran
Activity points
2,296
hi
I find some codes to use 8 bit LCD but I can't understand!
can you write me a code and discribe it?

thanks
 

org 00h
ljmp main
org 0100h

main: mov p0,#00h

mov a,#30h
lcall cmdrt
lcall delay

mov a,#30h
lcall cmdrt
lcall delay

mov a,#38h
lcall cmdrt
lcall delay

mov a,#06h
lcall cmdrt
lcall delay

mov a,#0fh
lcall cmdrt
lcall delay

mov a,#80h
lcall cmdrt
lcall delay


main1:
mov a,#01h
lcall cmdrt
lcall delay

mov a,#'W'
lcall dw1
lcall delay

mov a,#'E'
lcall dw1
lcall delay

mov a,#'L'
lcall dw1
lcall delay

mov a,#'C'
lcall dw1
lcall delay

mov a,#'O'
lcall dw1
lcall delay

mov a,#'M'
lcall dw1
lcall delay

mov a,#'E'
lcall dw1
lcall delay



dw1:
setb p2.0
lcall mdata

ret

cmdrt:
clr p2.0
lcall mdata
ret

mdata:mov p0,a
setb p2.1
nop
nop
nop
nop
nop
nop
nop
nop

clr p2.1
clr p2.0
ret

delay:mov r4,#70h
lpp2:mov r3,#0ffh

lpp1:djnz r3,lpp1
djnz r4,lpp2
ret


delay1:mov r4,#0ffh
lpp22:mov r3,#0ffh

lpp11:djnz r3,lpp11
djnz r4,lpp22
ret

end


analyse this .. its very simple
 
oh *** I forget say please in MPLAB!with PIC!sorry but really thanks for your code!

---------- Post added at 18:41 ---------- Previous post was at 18:40 ----------

***!it's really hard!

---------- Post added at 18:41 ---------- Previous post was at 18:41 ----------

ahora! help me!

---------- Post added at 18:42 ---------- Previous post was at 18:41 ----------

*****
thanks for your code

---------- Post added at 18:42 ---------- Previous post was at 18:42 ----------

ahora mazda
i think this is for 8085
 

Hi,

I sent you a full project and sim for a Lcd the other day - is there a problem with it ?

8 Bit lcd refers to the way data is sent out to the lcd from the pic - in that mode the 8 bits of data is sent on 8 parallel lines to the lcd and it also uses 2 or 3 lines to contrl the lcd.

The way most people use is 4 Bit mode which means with the 2 or 3 control lines they only have to use one whole port such as PortB or D.
4 bit mode is basically the same as 8 bit, just that is sends the 8 bits of data to the lcd as 2 lots of 4 bits, so saving 4 i/o lines on the Pic.

The code I sent shows how to easily insert message text into you code - not too hard to follow hopefully.
However the actual LCD routines are quiet complex for the beginner to follow even with notes, so would suggest you either just accept them for now or if you do wish to fully understand the lcd routines follow these tutorials.EPE FAQs & Resources
 
  • Like
Reactions: vishy71

    vishy71

    Points: 2
    Helpful Answer Positive Rating
oh!sorry
no! that was really strong program but 4bit! right?
 

oh!sorry
no! that was really strong program but 4bit! right?

Hi,

Yes that program is 4 bit, if thats what you mean ?

Did you get the sample programs I sent in you other thread to work on your PC ?

From your other current post seems you are struggling to start learning.
Perhaps Micros are a bit advanced for you at the moment, unless you are very keen on doing the programming side of things ?

You mentioned the 555 Timer chip, well thats an ideal one to start learning with, cheap to buy, can easily be built on a small breadboard if you are not handy with a soldering iron.
You can make so many different projects with them and just a few different cheap components.

Just download the Datasheet as a reference , then search for '555 Timer tutorials ' and you will get loads - just follow one that looks easy to you and then start learning by actually building something - all theory can be so boring..
 
  • Like
Reactions: vishy71

    vishy71

    Points: 2
    Helpful Answer Positive Rating
hi
well! if you don't know 555timer then you can not get it's datasheet! I mean is there any books about IC and what's their duty
and how we can use them!
for example I know 4017 IC and I know how can I use it!so I can take datasheet.
but if I don't know this IC how can I solve my problem about driving 7-segments?
 

Hi,

hi
well! if you don't know 555timer then you can not get it's datasheet!
? - you simply Google '555 Datasheet' and download it ..

I is there any books about IC and what's their duty
and how we can use them!
for example I know 4017 IC and I know how can I use it!so I can take datasheet.

There are so many chips around no one can cover them in detail, there are lots of books but which ones will satisfy your needs is hard for others to judge.
Again look to the web , there are so many good tutorials out there like the 555 ones I mentioned yesterday.

how can I solve my problem about driving 7-segments?
Are you meaning driivng with logic chips or from a micro ?
Again there are loads of examples/ projects on the web using both methods.
here is a good on for the micro.
Nigel's PIC Tutorial Page
 
  • Like
Reactions: vishy71

    vishy71

    Points: 2
    Helpful Answer Positive Rating
I am really sorry! you can't understatnd my mean!
 

you can see this code if u can understand

void LCD_init()
{

LCD_command(0x38 );
delay(10);
LCD_command(0x06);
delay(10);
LCD_command(0x0C);
delay(10);
LCD_command(0x02);
delay(10);
LCD_command(0x01);
delay(10);

}

void LCD_command(unsigned char comm)
{

PORTB=comm;
rs = 0; //register select=command
delay(1);
rw = 0; //write
delay(1);
en = 1;
delay(10); //Enable H->L
en = 0;
delay(10);
}

void Sendchar(unsigned char dat)
{
PORTB=dat;
rs = 1; //register select=data
delay(1);
rw = 0; //write
delay(1);
en = 1;
delay(10); //Enable H->L
en = 0;
delay(10);
}

void main()
{
LCD_init();
Sendchar('s');
}
 
  • Like
Reactions: vishy71

    vishy71

    Points: 2
    Helpful Answer Positive Rating
I find some codes to use 8 bit LCD but I can't understand!
can you write me a code and discribe it?
try to find datasheet for LCD, it will help a lot. It's very tricky, because LCD with the same controller can have different part number.
 
  • Like
Reactions: vishy71

    vishy71

    Points: 2
    Helpful Answer Positive Rating
Hi
is this assembly code?it's like as the mikroC codes!
 

I think you need to understand the LCD commands first, and how they control the display and then the code may be easier to follow.

This link explains the LCD commands and command sequences, **broken link removed**

This link is for a Microchip application note.**broken link removed**, it explains the the process in the code.
 
Last edited:
  • Like
Reactions: vishy71

    vishy71

    Points: 2
    Helpful Answer Positive Rating
Hi,
With 4-bit mode you can save I/O lines and it's NOT complex to program. So most people use 4bit mode for LCD; you can find very good introduction and sample code in Microchip-Assembly here;
PIC Tutorial* Three - LCD Modules

---------- Post added at 04:43 ---------- Previous post was at 04:41 ----------

Hi,
With 4-bit mode you can save I/O lines and it's NOT complex to program. So most people use 4bit mode for LCD; you can find very good introduction and sample code in Microchip-Assembly here;
PIC Tutorial* Three - LCD Modules
 
  • Like
Reactions: vishy71

    vishy71

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top