free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Rickey's World :: Discussion Forums :: Discuss and Learn :: 8051 Discussion Forum
 
<< Previous thread | Next thread >>
any help me!
Moderators: Ajay Bhargav, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph, ExperimenterUK, DavesGarage
Author Post
vanbayhoang
Sat Oct 31 2009, 06:25PM

 User Offline
Registered Member #23375
Joined: Sat Oct 31 2009, 06:14AM

Posts: 5
Thanked 1 time in 1 posts



Here is sechematic, please any one provide me asembly code for communicate with 8255 using 89c51!
thanks!
sorry!, My english is not good!



[ Edited Sat Oct 31 2009, 08:18PM ]
Back to top

Ajay Bhargav
Sun Nov 01 2009, 05:56AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 7468
Thanked 1320 times in 1244 posts
First of all, please try not to create multiple threads.

Now, 8255 has got 4 registers, which can be selected with combination of A0 and A1 address pins of 8255.
00 = PortA
01 = PortB
10 = PortC
11 = Control register.

you need to configure control register to control the IO ports.

From the circuit diagram you posted address will be like this
E000 = PortA
E001 = PortB
E002 = PortC
E003 = Control Register

do access these registers you can use MOVX instruction. user DPTR to point to this address.

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


This post has been thanked 1 time
vanbayhoang
Sun Nov 01 2009, 06:21AM

 User Offline
Registered Member #23375
Joined: Sat Oct 31 2009, 06:14AM

Posts: 5
Thanked 1 time in 1 posts
thanks! you have code asembly beforehand ( you writed), send your code to me.
sorry!, My english is not good!
Back to top

Ajay Bhargav
Sun Nov 01 2009, 10:22AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 7468
Thanked 1320 times in 1244 posts
well i do not have the code with me. but its simple.

CODE:
mov DPTR, #0E000H
mov a,#54H ;data to move
movx DPTR,a ;send data to register 0E000
 


the above code is just example of how to move data to 8255 register. so configure 8255 in IO mode and then use it as normal IO port.

if you are new to 8255 then check this page
http://www.thesatya.com/8255.html
also see datasheet for more info.

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


This post has been thanked 1 time
DavesGarage
Sun Nov 01 2009, 09:30PM

 User Offline
Registered Member #14254
Joined: Tue Jan 20 2009, 08:14AM

Posts: 618
Thanked 115 times in 111 posts
You better check that address again, Dude... I see 0x1XXX for the address base.

In other words 0x1000, 0x1010, 0x1020...0x1FF0 all will address Port A
and 0x1001, 0x1011, 0x1021...0x1FF1 all will address Port B
and so on...

Those inverters make this so...




-Dave
"Basic research is what I am doing when I don't know what I am doing"
Back to top


This post has been thanked 1 time
Ajay Bhargav
Mon Nov 02 2009, 10:50PM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 7468
Thanked 1320 times in 1244 posts
oops!
my mistake.. address will be as given by dave

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top

 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems