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.

parallel port, 8255

Status
Not open for further replies.

baftab

New Member
please see the schematic and tell whether it is fine or not?
i have made the hardware but its not working
please guide me
 

Attachments

  • h1.jpg
    h1.jpg
    139.5 KB · Views: 716
Well, the first problem I see is the 56 ohm resistors in series with the LEDs. The 82C55 can only source or sink about 2.5mA.
 
The 8255 has some peculiararities to get it started. I found this helpful.
>
> I had done some testing on a 8255 PPI chip recently, and figured some of it's more obscure behavior might be useful for SC-3000H/SF-7000 emulation. Here are the details:

> - If the port direction or mode bit is changed, the output latch is reset to zero. I think for port C this is handled individually for the upper and lower 4-bit parts.
> - Writing to an input port does not change the output latch state, due to the above reason of switching it back into an input will reset the latch anyway.
> - The control register can't be read, reading it returns the same data as reading port C.
> - On power-up all ports of both groups are mode 0 inputs.
> - Any changes to the port C output latch made with the bit set/reset function will be overwritten when port C is written to.
> - The high-order unused bits in a bit set/reset command don't do anything.

> Note that for the direction/mode changes, the output latch is reset only if the new value is different from the old one. If you wrote two identical values but with one bit changed to (for instance) set the port B direction, the output latches of ports A, C(low), C(high) would remain unchanged.
> Also, I think some later versions of the 8255 have a readable control register, but I doubt these parts were used in Sega's early consoles.

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.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top