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 me communicate with 8255!

Status
Not open for further replies.

vanbayhoang

Newbie level 6
Joined
Oct 31, 2009
Messages
13
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
HVB
Activity points
1,345
Please can any one provide me asemble code for communicate with 8255 using at89c51!
thanks!
 

Here is a good starting point:
**broken link removed**

Rgds,
IanP
 

thanks!
you have asembly code? I need code asembly!
sorry!, My english is not good.
 

First, map 8255 as an external memory - that's the easiest way ..
See attached picture ..
On power on all mode/direction bits in the Control Register are set to "0" and that means that all 3 ports are set to be outputs ..

To send data to, say, port A, use the following command:

Code:
MOV DPTR, #addres of A; in this example it is #4000h
MOV A, #what you want to send
MOVX @DPTR, A

Other addresses are as follows:
Address 4000H: port A
Address 4001H: port B
Address 4002H: port C
Address 4003H: configuration register

To set Port A as inputs, you have to set D4 in the Control Register.
Code:
MOV DPTR, #4003h
MOV A, #00010000b
MOVX @DPTR, A

and then:
Code:
MOV DPTR, #4000h; addres of Port A
MOV A, @DPTR
will read PORT A of the 8255 ..

Rgds,
IanP
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top