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.

interface multiple 8255 to single 89s51

Status
Not open for further replies.

mahaju

Full Member level 2
Joined
Mar 17, 2007
Messages
125
Helped
7
Reputation
14
Reaction score
2
Trophy points
1,298
Activity points
2,252
8255 interfacing

HI
Could you please tell me hoe to interface two or more 8255 ICs to a single 89s51 microcontroller?

Also, the Proteus 6 simulator does not compile this circuit. Could anyone please tell me what is wrong?
 

8255 circuit

Hi,
Could not read your circuit as my Tiny refused to open it. Basically you need to use different chip select lines, preferably using a 2 line to 4 line decoder like 74HC139 and connect other interface lines like data bus, A0/A1 and RD/WR of the devices in parallel. You may need to use external pull ups for the interface lines. The data bus can be connected to P0 port and other lines to pins of port P1. Connecting Rd/Wr to Rd/Wr of 8051 may be convenient if the speed matches with that of 8255.

Regards,
Laktronics
 

simulator 89s51

Hi
Thank you for your reply

The schematics were drawn in Proteus version 6 so you would need this or later versions to open and compile it

However here is a bitmap export of the schematic

I think I have used different lines for addressing the 8255, however I didnot use decoders, but different memory addresses (I used the more common memory mapped I/O)

I would like to note a fact that you pointed out. "It will be possible for me to practically use memory mapped I/O 8255 port with an 8051 based ucontroller (I will be using 89s51) if the RD/WR signals of the uController are compatible". I have read about this issue in other forums, of the 8255 being too slow to handle modern microcontrollers. How do I find out how to interface the RD/WR pins successfully to the 8255? Will such a control signal speed mismatch between 8255 and uController give me problems in a real circuit? I have successfully simulated a single 8255 interfaced to 89c51.
 

program 8255 with 89c51

Hi,
Your connections are OK. If Rd/Wr is fast for 8255, I suppose you can still use these pins as I/O pins and toggle them to read and write, by only changing the software. You can also check the data sheet and see if the chip can work using Rd/Wr signals.

It is better to use buffers instead of inverter for CS-, as otherwise when CPU is Reset, both devices will be selected. If you use a 2 bit decoder, it will not only save CPU pins, but also will ensure that only one device is selected at a time. However it may not matter since Rd/Wr are both high at that time.

I have not understood the use of transistor Q1.

You may also add a protection diode in the Controller Reset circuit.

Regards,
Laktronics
 

code c 8255a

Hi
Thank you for your reply

The transistor was just added for my own troubleshooting needs. I probably forgot
to delete the component when I posted the message.

Like I said I have successfully simulated a single 8255 interfaced to an 89c51, hence the errors shown by the simulator probably did not occur due to speed mismatch of RD/WR signals. However I am still not sure if this will work as smoothly in real life.

I dont think the error is in the circuit now, but is occuring probably because I have overlooked some of the finer details of the working of the simulator program I used.

Do you have any real life experience with such a circuit, or a working simulation file, preferably in Proteus? I will be very greatful if you could provide them.

:)
 

s52 and c52 port pins

Hi,
Sorry, I do not have any simulation files, but I can confirm that your connections are OK, as far as I could see. As I told you, if the Bussed Rd/Wr signals are faster, you can still use Rd/Wr as I/O pins and insert NOPs in the program to scale down the speed of the controller to match 8255 speed, provided, you also make a jumper provision for A0,A1 to two port pins.

You can also check the data sheets of the controller and 8255 to see if Rd/Wr pulse widths are matching with out resorting to guess work. You may need pull-up resistors on all controller pins interfacing with multiple 8255s. You can also increase Rd/Wr pulse width by using lower value crystal frequencies if it does not affect you otherwise.

Instead of LS373, you can use LS75 since you need only two outputs.

Regards,
Laktronics
 

8255 interfacing schematic

If you looked into 8051 figures – instead of running bloody simulators - you would easily find out that the /WR and /RD pulses during external operations take 6 clock cycles, and that at 11,59200MHz is an equivalent to 2MHz, or 500ns pulse width ..
On the other hand 8255 is a 5MHz device and will accept /WR or /RD pulses of at least 250ns ..
Can't see any problem there ..
See also:
Rgds,
IanP
 

89s51 programs in c

Thank you for your replys.

I have not been able to solve the problem with my simulator.

I have decided to try the circuit out practically, but I think I will only be needing one 8255 now.

None the less, I will probably start work on the circuit from tomorrow morning. I will keep this thread up-to-date with my work.

I am sure that I will continue to get your support. I will update this thread soon.

Thanks.
:)
 

pc parallel 8255

Hi again
I have put together the circuit for interfacing a single 8255 to an 89s51 (simply one of the 8255s in my schematic posted before is removed). I have used up two 89s51 ICs, both of which stopped working after connecting to my circuit. I can burn my programs into one of them, but the program simply doesn't run when I power up. the other one is not recognised by my program burning software, while it can still run the program last written to it. Is this damage to the microcontroller happening due to my 8255 circuit? My circuit is exactly the same as in the schematic I have posted before, with the second 8255 removed completely. Do I need to use a buffer IC between the uController and the 8255 data lines? PLease help.

:)

PS: Also, could anyone please give me a circuit for using my parallel port's data lines for input and output?
 

program with 8255

Hi,
Most likely your problem is not due to direct connection, if your programmer programs 89C51/52, try with one of those chips. Is your programmer a serial or a parallel one?

In any case, check your connections once again to see if there is any short of I/O pins to Vcc/Ground. If you want to use a buffer for data bus, use an LS245 and connect its CE- to ground, pin 1 to RD- . Connect its B buss to 8255 and A buss to the Micro. Keep LS373 connections as it is directly from Micro.

Regards,
Laktronics
 

how to use 8255 with 89c51

Hi

I use the 4 pins of 89s51 (MISO etc) to program it so my programmer does not program 89cxx series. I am still working on the circuit.

Do you have source code for program to read and write data using PC parallel port? I need to do an 8 bit half duplex data transfer to and from my PC. Do you have the relevant circuits and the source code, preferably in Visual C++ or Visual Basic? Also im using Win XP so the inportb() and outportb() functions of C wont work.

I appreciate your help.

Thanks in advance.

:)
 

how to interface 8255 with 89c51

Hi,
That shows your programmer is a serial programmer and can not be applied to C51/52. I have not personally faced any problem with S51/52, but happened to see here in this Forum someone complaining about S52 not working in place of C52, the reasons could be different.

Does your programmer program properly if you try to program two different Hex files one after the other without plugging into your circuit, what I want to clarify is that if the programmer is able to erase properly and reprogram.

Your circuit as such should not have affected the controller especially with one number 8255.
Another point you may note is that when three of 8255's are used in parallel, the Iol specification of the controller is exeeded both for Rd/Wr signals and for P0 pins. 8255 being a TTL product, its low level input current is 1.6mA and with three of them in parallel will have total loading of 4.8mA per P0 and Rd/Wr pins. In addition you have an LS load due to LS373 on P0 pins. So the max loading per pin exeeds the specified 3.2mA/pin and 26mA/port for P0. For Rd/Wr pins the max specified Iol is only 1.6mA. So, you will need to put buffers on these pins when interfacing more than one 8255 chips. Alternatively, you can use 82C55 chips without any buffers.

As regards PC's parallel port, sorry, I do not have any ready solutions.

Regards,
Laktronics
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top