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.

Keil + LCD 44780U display

Status
Not open for further replies.

buffalo101

Newbie level 5
Joined
Jan 23, 2011
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,352
Hello,

I am supposed to play a little with a HD44780U (LCD-II) display and this platform:
Code:
http://www.cs.ucv.ro/~lemeni/Downloads/Sistem%20de%20dezvoltare.pdf

A template for the C program is included here:

Code:
http://www.cs.ucv.ro/~lemeni/labmicro/Lab45.zip

I can't understand certain things about interfacing the LCD display. For instance, the *ports* are defined like this:

Code:
#define IR_WR	0x100
#define STAT_RD 0x102
#define DR_WR	0x101
#define DR_RD	0x103

Then, I would address these ports with the XBYTE keyword.
Code:
XBYTE[IR_WR]=0x00;

From the LCD documentation:

**broken link removed**

A short example is given:

For the "Clear display command", RS=0, R/W#=0 and DB(7:0)=0000_0001b=01h. To send this instruction, we use:

Code:
XBYTE[IR_WR]=1;

My question is this: how do I include the RS, R/W# in a 8bit instruction?! or how precisely do I form the instructions?

And also, how do I read the BusyFlag? I think I should first set RS=0, R/W#=1 and then check for Bit7 on the DR_RD (data_register read?) port.

Thanks in advance!
 

rs r/w and enablepins are bit addressable so you need to declare it as bit addressable....

you need to declare it as
sbit rs=P3^5;
sbit en = P3^4;

if you dont want to use busy pin then permanently ground the r/w pin on the hardware....
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top