+ Reply to Thread
Results 1 to 9 of 9

Thread: 8255 ic MODE question

  1. #1
    celocider Newbie
    Join Date
    Nov 2004
    Posts
    10

    Default 8255 ic MODE question

    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?


  2. #2
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,794

    Default

    Quote Originally Posted by celocider
    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?
    You read the datasheet!, or use a better PIO chip (such as a 6522).
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  3. #3
    Analog Okay
    Join Date
    Jul 2006
    Location
    Michigan USA
    Posts
    476

    Default

    Quote Originally Posted by celocider
    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.
    "Everything that is done in the world is done by hope." -Martin Luther
    "There are two ways to live your life. One is as though nothing is a miracle. The other is as though everything is a miracle."-Albert Einstein

  4. #4
    ClydeCrashKop Newbie
    Join Date
    Apr 2005
    Location
    Florida
    Posts
    318

    Default

    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.

  5. #5
    celocider Newbie
    Join Date
    Nov 2004
    Posts
    10

    Default

    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.

  6. #6
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,794

    Default

    Quote Originally Posted by celocider
    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!.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  7. #7
    celocider Newbie
    Join Date
    Nov 2004
    Posts
    10

    Default

    thanks guys, i posted a new thread as a follow up so this thread maybe closed.

  8. #8
    tdg8934 Newbie
    Join Date
    Oct 2006
    Location
    Somerset, KY
    Posts
    147

    Default 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.

  9. #9
    tdg8934 Newbie
    Join Date
    Oct 2006
    Location
    Somerset, KY
    Posts
    147

+ Reply to Thread

Similar Threads

  1. Using Oscilloscopes
    By mechie in forum Electronic Theory
    Replies: 9
    Latest: 29th November 2007, 09:49 PM
  2. Question about HT 8870 in the TELESWITCH circuit !?!
    By zambalik in forum General Electronics Chat
    Replies: 11
    Latest: 6th September 2007, 12:11 PM
  3. parallel port, 8255
    By baftab in forum General Electronics Chat
    Replies: 3
    Latest: 29th April 2006, 03:17 PM
  4. How to stop the Counter mode is Timer 1 in the PIC16F877
    By avinsinanan in forum Micro Controllers
    Replies: 1
    Latest: 11th April 2005, 07:13 PM
  5. 555 Timer, Astable Mode Question
    By micro571 in forum Electronic Projects Design/Ideas/Reviews
    Replies: 3
    Latest: 17th October 2004, 04:25 AM

Tags for this Thread