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.

Help!!! Reg interfacing LCD to 8051 using 8255

Status
Not open for further replies.

Dhans

Junior Member level 3
Junior Member level 3
Joined
Sep 14, 2005
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,473
hi
I am interfacing LCD to 8051 using PPI(8255) using C programming. i Dont know how to define the 8255 port address and control word register. can anyone help in this ?
 

If the 8255 is connected to 8051 as per attached picture (except for A14-to-CS connection, CS should be connected to 0V) then you will be using the following addresses:
PA => 0000h
PB => 0001h
PC => 0002h
CR => 0003h
The following example shows how to address the above registers using DPTR and MOVX instruction:
Code:
#asm

test:
 	mov 	A, #80H 	; control word
	mov 	DPTR, #0003H 	; address of CR
	movx 	@DPTR, A 	; write control word
	mov 	A, #55h 	; will try to write 55 and AA alternatively

repeat:
	mov DPTR, #0000H 	; address of PA
	movx @DPTR, A 		; write 55H to PA
	inc DPTR 		; now DPTR points to PB
	movx @DPTR, A 		; write 55H to PB
	inc DPTR 		; now DPTR points to PC
	movx @DPTR, A 		; write 55H to PC
	movx @DPTR, A 		; write 55H to PC
	cpl A 			; toggle A (55àAA, AAà55)
	sjmp repeat

#endasm

Regards,
IanP
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top