Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

8255 ic MODE question

Status
Not open for further replies.

celocider

New Member
Can anyone help me with 8255 mode 2 control word?

How do you know what mode to use and how do you get the control word for it?
 
celocider said:
Can anyone help me with 8255 mode 2 control word?

How do you know what mode to use and how do you get the control word for it?

These words are readily described in the INTeL data sheets. PDFs of the data books are available online using Google.
 
I don't remember where I found this but it helped me.
Using an 8255 PPI chip
Well I had the hardest time getting one of this chips to work so I thought I'd post some information on how to use the chip (namely what I was doing wrong).
When working with these chips it is very handy to have a white paper (data sheet) in your hand:
8255A.PDF
Mode 0
Since my application was working with all outputs, I'll assume we're going to work in Mode 0. The basic steps needed to get one of these chips initialized are:
1. power on
2. reset the 8255 using the RESET pin
3. set the write pin (WR) high
4. put the control word on the data bus (selects the Mode)
5. set A0 and A1 pins high
6. set the write pin (WR) low for a very short duration, keeping A0 & A1 high
7. set the write pin (WR) high again
When step seven happens, it causes the chip to "take note" of the data bus and pins A0 & A1. When both of the Ax pins are high, the 8255 knows that the data present on the data bus is a control word and from that data, it goes into the appropriate mode. You only have to do the above seven steps once (on power up), unless one wishes to reset the chip during operation. Then just start from step 2 (since you already have power to the chip). Please note that when an 8255 is reset, all three of it's ports go into input mode.
Now that the chip is initialized, the steps to use it are as follows:
1. set A0 & A1 to what 8255 port (A, B, or C) you want to work with
2. make the data bus look like what you want the 8255 port you're working with to look like (highs and lows)
3. set the write pin (WR) low for a very short duration
4. set the write pin (WR) high again
5. go back to step one
Please note that we are assuming 8255 mode 0 here (all three 8255 ports are outputs). One needs to keep the write pin (WR) high at all times until you're ready to "program" the chip. This is where I messed up. I left WR high all the time, assuming that would keep the 8255 in 'write' mode. It needs to go from high to low and back to high in order to 'program' the chip.
 
Ok sorry to inform you guys... but this 8255 ic is interfaced in a z80 trainer, the Analab.. the project i am currently working on is a digital clock using the user's port of that trainer which is configured with the 8255 ic.

I was able to make the hardware work and configure the hardware to use Port A0 to A3 and Port C0 to C5 of 8255 as bidirectional ports to run my circuit.. i'll post the circuit later after i edit it with eagle software.

Just to give you an idea of how circuit uses the ic, I'm currently doing a digital clock hardware project for microprocessors which is purposed to be interfaced with an ANALAB z8 Emulator User's port which is equivalent to an 8255 ic. The power supplied to the emulator is seperated with the +5 V supplied to my circuit.

My circuit uses six common anode 7 segment display to show time with an active low bcd-to-7segment decoder that are limited with 470K ohms resistors. The bcd inputs A,B,C and D are connected to the ports A0, A1, A2, and A3 respectively of the 8255. The six 7 segment displays have been alloted one BC547B NPN transistor each with their collectors connected to +VCC and their bases connected to 330 ohm resistors. The Bases of the transistors are then connected to Port C0,C1,C2,C3,C4,C5 of the 8255. Assuming nothing more is to be done, my problem now is initializing 8255 in my main program to use handshaking of signals.
 
celocider said:
Ok sorry to inform you guys... but this 8255 ic is interfaced in a z80 trainer, the Analab.. the project i am currently working on is a digital clock using the user's port of that trainer which is configured with the 8255 ic.

That makes more sense! - you're using an antique IC, because you're using an antique trainer!.

Just download the datasheet for it, it explains what the different modes are and how to use it - personally I've always thought it a very poorly designed and limited chip!.
 
8255 to Basic Stamp II circuit and test code

I have been searching everywhere on the web over the last year to find information on how to interface to an 8255. I saw this posting about a year ago and used the comments to write a program for a BASIC STAMP 2 chip to interface it to an 8255. It worked initially but later died and I thought it was due to it maybe getting statically shocked. A friend of mine in the ZX81 community told me some problems he saw and I re-wrote the code and drawing. I hope this will help others as I have long needed to find ANY information on interfacing the 8255. I did find out that my chips were ok and work well with the new BS2 code. Hopefully you should be able to follow my comments.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top