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.

What's the need for Lcdcmdout routine when initializing LCD?

Status
Not open for further replies.

theenes

Junior Member level 2
Joined
Sep 15, 2005
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,485
i'm interfacing LCD HD44780 with PIC16F877..
4 bit data transfer..when doin LCD Initialisation..i dont understand the need of Lcdcmdout Routine:

; Lcdcmdout Routine
LC02: MOVWF R4L
BCF 0x06,3
BCF 0x06,0
MOVLW 0x0F
ANDWF 0x06,F
MOVF R4L,W
ANDLW 0xF0
IORWF 0x06,F
BSF 0x06,2
NOP
BCF 0x06,2
SWAPF R4L,F
MOVLW 0x0F
ANDWF 0x06,F
MOVF R4L,W
ANDLW 0xF0
IORWF 0x06,F
BSF 0x06,2
NOP
BCF 0x06,2
MOVLW 0xD0
MOVWF R4L
MOVLW 0x07
MOVWF R4H
CALL Y001
RETURN
can anyone..explain me wats the function of the coding and how it works..

..i'm attaching the full coding..besides tht,can u explain to me bout ;Waitms Routine.
 

question about PIC LCD software

Please give your threads meaningful subject eg "question about PIC LCD software"

You will have to read the 16F877 datasheet to understand this.

You will find programs like this easier to understand if you use meaningful names instead of number eg

instead of BCF 0x06,3

You could have a define at the top of the program
#define portb 0x06

then write
BCF portb,3

Thsi makes it much more obvious what is going on , in this case you are setting pin RB3 to be logic 0. This only has an effect when the bit in the TRISB register is cleared to make pin RB3 an output. When the PIC is first turned on the pins default to being inputs.

To work out what the effect of making pin RB3 output a 0V will have you will have to look what pin RB3 is connected to.

Read the 16F877 datasheet and the datasheet for your LCD display and study the circuit diagram showing how they are connected together. Go through the software line by line working out exactly what each line does.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top