Image Map Image Map
Results 1 to 9 of 9

Thread: 8255 problem: can't communicate

  1. #1

    Default 8255 problem: can't communicate

    Hey, so I'm in a bit of trouble with a small 8052-BASIC single board computer. It has two 8255's for I/O, and I simply can't talk to them.
    I've reverse engineered the chip select circuitry, and it all looks rather standard, and I made a small program to continuously writing to the chip, to verify I addressed it correctly. I am.

    So: The 8255 receive the correct /CS signal, /WR and /RD too, as far as i can tell.
    When I read the mode register after system reset or boot, I get FF (not inconceivable for an uninitiated register, although I think the 8255 should default to mode 9B).
    If i try and write another word to the mode register, it returns 00 when I try and read it again. Regardless of what I wrote.

    So what's going on? Is it a dead chip? I mean, it's an IO device on an educational board, so It could be blown, only both 8255's act identically, so they should both be, then.
    Or am I messing up in my code? I'm writing to it from 8052-BASIC, btw.

    Thanks in advance for any hints.

    --Christoffer


    Current systems: PDP11/23, ZX-spectrum, MEK-6802D5, Ampex 210 CRT terminal, ZX-spectrum
    Current projects: 8085 Altair 8800 compatible
    Looking for: DEC RX-50 drive, QBUS ROM card, intel 8288

  2. #2
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    33,667
    Blog Entries
    18

    Default

    The mode register of the 8255 is write-only. The datasheet calls out that reading it is, according to the truth table, an illegal operation. You have to remember that the 8255 goes waaaay back--about as far back as the 8080.

  3. #3

    Default

    Great, missed that, thanks! So it might get written properly, but even then, I still don't get any output from the chip, when I set it up as output and write FF to a port.

    --Christoffer


    Current systems: PDP11/23, ZX-spectrum, MEK-6802D5, Ampex 210 CRT terminal, ZX-spectrum
    Current projects: 8085 Altair 8800 compatible
    Looking for: DEC RX-50 drive, QBUS ROM card, intel 8288

  4. #4
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    33,667
    Blog Entries
    18

    Default

    The 8255 is a very simple chip, so I'd check your signals. A logic analyzer will certainly help.

    If you're not working from the datasheet, here's a copy
    Here's a bit more about programming it
    Last edited by Chuck(G); January 14th, 2016 at 09:41 AM.

  5. #5

    Default

    Thanks for the hints, solved it! It was some strange timing phenonemon.
    When I just wrote to the chip from BASIC, it didn't get it.
    When I wrote that identical line as a program (added 10 infront of it) it worked!

    Maybe it excecutes programs in RAM a bit faster than it does commands?

    --C


    Current systems: PDP11/23, ZX-spectrum, MEK-6802D5, Ampex 210 CRT terminal, ZX-spectrum
    Current projects: 8085 Altair 8800 compatible
    Looking for: DEC RX-50 drive, QBUS ROM card, intel 8288

  6. #6
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    33,667
    Blog Entries
    18

    Default

    I don't know, but it's entirely possible that the interactive version also reads the port before/after writing to it, which, in some cases can really foul things up.

  7. #7
    Join Date
    Dec 2010
    Location
    Seattle, WA
    Posts
    1,946

    Default

    Are you using the XBY() special function operator to read and write to the memory addresses decoded for the 8255?

    I took a quick look at the source code for Intel BASIC-52 and it's not immediately obvious to me how the XBY() special function operator actually works.

    I think it would have to be using MOVX A,@DPTR and MOVX @DPTR,A instructions to read from and write to external data memory. I don't follow how that might be happening for the implementation of the XBY() special function operator.

    I should try building up a simple BASIC-52 system sometime and try to observe how some of this stuff actually works.

  8. #8

    Default

    Yes, I was indeed using XBY().
    I don't have the source code at hand, so I wouldn't really know. But if it isn't just my configuration that has this issue, it's definately a quirk in the 8052-basic one needs to remember.
    Wasn't there ever a version 2 basic?

    --Christoffer


    Current systems: PDP11/23, ZX-spectrum, MEK-6802D5, Ampex 210 CRT terminal, ZX-spectrum
    Current projects: 8085 Altair 8800 compatible
    Looking for: DEC RX-50 drive, QBUS ROM card, intel 8288

  9. #9
    Join Date
    Dec 2010
    Location
    Seattle, WA
    Posts
    1,946

    Default

    The source code that I looked at is available here, which is supposed to be MCS-51 - 8K BASIC VERSION 1.1
    http://pic-club.webcindario.com/basic_8051/bas52all.zip

    I don't know if that is the same place that I originally found it but it matches the source that I have and was supposed to have been verified against the binary extracted from a known good factory masked 8052-BASIC

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •