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 Project

Status
Not open for further replies.
hello alls

Well my problem is that, i have to sumbit a project using 8255 any one... my idea is to interface 8255 through prallel port and using some relays or stepper motoer on the output port by control the port through prallel....like when i send high bit...relay or motor get active or on low bit vise versa.... now i need help for schematic and programing... the condition is that langauage should b assembly....Can any one help me... i have limited time...
 
Is your project supposed to use a PC to drive it?, the 8255 is an antique memory mapped PIO device, it's designed to connect to a microprocessor, not a port.
 
yes u r right i want to control it through prallel port by using Pc...... as i send perticular instruction though prallel port to 8255... it'll follow the instruction... as i mentioned it in my 1st post.. is it possible well i know about it that its used in motherboards for PCI manufectured in the chipset... but what am i thinking is it possible ? if not then kindly tell me any other simple project using 8255....with assembly code...
 
This is obviously a school project, the idea is that YOU do it, how is cheating going to help anyone?, least of all you!.

Download the datasheet for the chip, and figure out how to connect it - although it seems a stupid chip to use on a parallel port! - and I've always thought it was a particularly rubbish chip anyway.
 
hmmmmm ya u r right well i know its configuration of pins...and it's really a school project i tried alot but unable to do something with it any way... can u tell me any other project by using this PPI 8255...
 
This site gives some good info
http://www.geocities.com/SiliconValley/Garage/1288/index.html

I don’t remember where I found the next 2 articles but they helped me.

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:
**broken link removed**
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.
 
That info was from about 4 years ago. The data sheet should be easy to find.
 
You can't program a port directly with assembly code any more.Unless you are using DOS. Linux won't do it and windows xp won't do it because they are multitasking operating systems. So while you are trying to run your program it is switching between it and all the other tasks that are running. In Linux this will at least mess up your timing. In windows there is a whole layer on top of the hardware that you have to go through. I have been installing rtai on linux to get my timing problems fixed.

How do you plan to program the parallel port?
 
CP/M. If only I'd been around then! =) The more I read about the beginning of computing the more I think I was born a generation late. Reminds me of the MCP program from Tron, The acronym transfer seems humorous to me. In Tron it was Master Control Program.

Reminds me of book I read a few years ago about the origins of hacking, wish I could recall the title or author. But it goes back as far as the 60's when the game "Spacewar" was made for a DEC PDP-1 which is the first reference to a computerized game I have ever found (before pong even)

I really have respect for people that could turn the technology of the times (roomfuls of it) into something as seemingly innocuous and yet incredibly sophisticated as a video game, especially considering it's 17 full years before I was born. Not enough credit is given to those kinds of people.
 
Last edited:
Sceadwian said:
CP/M. If only I'd been around then! =) The more I read about the beginning of computing the more I think I was born a generation late. Reminds me of the MCP program from Tron, The acronym transfer seems humorous to me. In Tron it was Master Control Program.

Do you remember the computer called 'HAL' in "2001 AD A Space Oddessy", presumably you know the source of that name?.

Reminds me of book I read a few years ago about the origins of hacking, wish I could recall the title or author. But it goes back as far as the 60's when the game "Spacewar" was made for a DEC PDP-1 which is the first reference to a computerized game I have ever found (before pong even)

You mean you've never played Spacewar? - doesn't count as a game like Pong though because it's purely textual. Likewise Colossal Cave was a purely textual game - bear in mind they were written to run on teletypes!.
 
Must be talking about a different spacewar. The one I'm talking about was a vector based two person game. Basically a combat version of asteroids.

https://www.computerhistory.org/pdp-1/index.php?f=theme&s=4&ss=3

Not bad for 1961. 18 years before asteroids. I know of know other 'video game' before that date, then again it's a little difficult to research things that old.
 
Last edited:
Well....

hmmm i am really happy to see ur respone really really thankfull to all of you... well people i tried alot but cant interface that damn 8255 with prallel through assembly ... as u all said to me
so now do any one provid me any other circuit using ordinory mircoprocessor interfaced with prallel port and performing any action such as swtiching the relays, controlling stepper moter, using assembly langauge...
 
If this is a school assignment I'm not sure what you are supposed to do.
Is the assignment just to control a relay or to control a relay using a specific method?
Do you just want the computer parallel port hooked to a relay OR a microprocessor hooked to a relay?If you want a microprocessor I think you need a microcontroller.

Does it have to be assembly code? If you use linux you can program the parallel port in c as long as the timing is not important because if you try to send a signal every 10ms for example, you might get one at 10ms the next one at 12ms the next one at 11ms etc..

If you can use C and a parallel port in Linux you can find the circuit and program very quickly.

I've never done a stepper motor hooked to a parallel port .Maybe you can learn and come back and show us. :)
 
If you boot your computer in older DOS like 6.2 you can use GWBASIC, QBASIC, MASM and many others for easy direct access to LPT1. MASM was a DOS program and I would hate to have to make a Windows program in assembly.
Visual C++ will take asm instructions and has easy access to LPT1 in Windows if you use inpout32.
You can find inpout32.DLL with code examples at:
**broken link removed**
**broken link removed**
All of these have to be in Project\ Settings\ link\ object/library modules:
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib inpout32.lib
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top