1. 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.
    Dismiss Notice

Z80 Homebrew with PSG

Discussion in 'General Electronics Chat' started by RetroFocus2015, Mar 8, 2015.

  1. RetroFocus2015

    RetroFocus2015 New Member

    Joined:
    Mar 7, 2015
    Messages:
    11
    Likes:
    0
    Hello,
    while searching for answers about demultiplexing I found this thread on your site www.electro-tech-online.com/threads/what-is-multiplexing.23266/page-2

    I've been gathering parts together to build a computer based on designs in the book 'Build Your Own Z80 Computer' by Steve Ciarcia (1981).

    I'm doing this as I want to design my own computer. The designs in the book are educational and although good specs for the 1970's maybe not so good by 1980's standards of just a few years later.

    As difficult to find and expensive TTL parts are used in the designs inside the book, the low spec trainer ZAP Computer with it's 2K of RAM and 2k ROM was becoming a bit of a 'white elephant' so I've added to it with the 32k RAM and ROM mentioned in the thread and my Z80 turned out to be an 8Mhz Z84 when it arrived.

    My problem is I'm also putting a Texas Instruments SN76489 PSG into the computer and I only have one chip enable line available, derived from A15 on the Z80/Z84.

    I was thinking I could enable the sound chip at the same tine as RAM as it wouldn't play sound unless told to, even if enabled.

    Is this an idea that would work?
     
    Last edited: Mar 8, 2015
  2. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,242
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi RF,
    The SN76489 datasheet does not show any input latches, so you may need a 8bit wide latch on the input.
    Which decoder for the address lines are you using.? eg: 74LS138 etc./
    E

    EDIT:
    The text suggest that the registers may be latched.????
     

    Attached Files:

  3. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,242
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. RetroFocus2015

    RetroFocus2015 New Member

    Joined:
    Mar 7, 2015
    Messages:
    11
    Likes:
    0

    I
    I was using the layout on page 111 of this book which is also online here books.google.co.uk/books?id=mVQnFgWzX0AC&pg=PA111&vq=111&output=html_text&source=gbs_search_r&cad=1 .

    Additionally there are 3 8T97's on the address lines earlier in the book.

    I now need address lines A0 through A14 for the larger RAM and ROM so was going to change this wiring completely.
     
    Last edited: Mar 8, 2015
  6. RetroFocus2015

    RetroFocus2015 New Member

    Joined:
    Mar 7, 2015
    Messages:
    11
    Likes:
    0
    I have seen that, although not for a couple of weeks admittedly - I'm one of those people with a bit of a reliance on post-it notes and scraps of paper :)
     
  7. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,242
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    What is your location.?

    EDIT:
    You may find this pdf useful fo the Z80
     

    Attached Files:

  8. RetroFocus2015

    RetroFocus2015 New Member

    Joined:
    Mar 7, 2015
    Messages:
    11
    Likes:
    0
    My location is Britain. I'm going to be mysterious and leave it at that.

    The other thread basically just uses a NOT gate to select RAM if the ROM is not being read which is fine if only those two chips are present. I'm starting to think I could use a NAND gate to enable the PSG if both the RAM and the ROM are not enabled.
     
  9. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,242
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    Have you considered using IORQ, with an address decode CS and setting the tone IC as a peripheral.?
     
  10. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,376
    Likes:
    975
    Location:
    Loveland, CO USA
    Do you have the firmware for the EEPROM?
    I probably have all the parts. Wish you were close.
     
  11. RetroFocus2015

    RetroFocus2015 New Member

    Joined:
    Mar 7, 2015
    Messages:
    11
    Likes:
    0
    I hadn't, the closest I got was thinking about adding an edge connector for a sound interface but I think I'd rather have the PSG internal.
     
  12. RetroFocus2015

    RetroFocus2015 New Member

    Joined:
    Mar 7, 2015
    Messages:
    11
    Likes:
    0
    I haven't written any software for the eeprom yet. Up until recently I was directly copying 'Build Your Own Z80 Computer'. There's a ROM Monitor listing at the back of that book. There's nothing about PSG's in there, unfortunately.

    Something I do have is an Atmel SPLD that I hoped to use in generating sound and video.
     
  13. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,242
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    The PSG would be on the Z80 PCB, as most IORQ devices are located.
     
  14. RetroFocus2015

    RetroFocus2015 New Member

    Joined:
    Mar 7, 2015
    Messages:
    11
    Likes:
    0
  15. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,376
    Likes:
    975
    Location:
    Loveland, CO USA
    Back then I had some good ROM monitors.
     
  16. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,049
    Likes:
    961
    Location:
    NJ
    Hello there,

    The Z80 is a cool chip. I loved using it back in the 1990's.

    I guess you have 32k ram and 32k rom, so you are using that A15 to switch between ram and rom, so that uses the whole 64k address space. But there is more space for I/O as Eric was saying. That's the normal way to work with i/o anyway, no matter what it is. Use a decoder and some gates to decode when an i/o operation is in progress and you can easily create 8 complete i/o ports for any use. The gating might be a little tricky but doable.

    I havent read that book so i dont know anything they tell you, but one of the things you can do at the very start is write a bootloader in rom. The bootloader such that it can read data sent from another computer and store it in ram. That way you can write all your code on your normal PC and upload it any time to the Z80 board. Once the Z80 jumps to the new code, it begins executing it. This way you can experiment with the code endlessly. If you have an EEPROM then you might be able to program that with the bootloader which could reside in regular rom or perhaps be part of the EEPROM.
    The way i did it was with 32k ram and a small rom just enough to hold a bootloader. Back then all we had was UVEPROM's. If we made a mistake in UVEPROM we just write over it with zeros and use the next available address as the starting point, until it was all used up then it had to be erased with a UV light. The nice thing about using ram was that it could be erased any number of times.
     
  17. RetroFocus2015

    RetroFocus2015 New Member

    Joined:
    Mar 7, 2015
    Messages:
    11
    Likes:
    0
    That side of things is all new to me. I had an Atari VCS and later a Sinclair Spectrum, tending to use interpretive BASIC to program.

    I'm finding learning about the hardware makes learning assembly language a lot less daunting.
     
  18. RetroFocus2015

    RetroFocus2015 New Member

    Joined:
    Mar 7, 2015
    Messages:
    11
    Likes:
    0
    The design in the book uses two 7442 IC's to create 8 I/O reads and 8 I/0 writes (I believe this is also the example in the 7442 datasheet) so, it looks like I have the start of your solution.

    I have one write only parallel port, a serial keyboard port, and one RS232 serial port so, I have five write signals and six read signals free that I could use for the PSG.

    As I already had the 2816 EEPROM (2k instead of 32k) I was toying with the idea of having my OS on a CF card connected by IDE. Not sure how practical that would be.

    I was going to build the tape interface but using a CF card makes my board smaller and cheaper :)

    Using the board as an experimenter is a great idea - can you offer any advice on making an edge connector (they scare me - I destroyed my first computer by knocking out an external interface in 1993).
     
    Last edited: Mar 9, 2015
  19. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,049
    Likes:
    961
    Location:
    NJ
    Hi,

    Oh i didnt realize that you were not using the entire 64k address space. With 32k ram and only 2k rom, you have some of that address space available, unless of course you intend to increase the size of the rom, and then you should use i/o anyway. But if you can limit the rom to say 16k, then that gives you one address line that wont be used for addressing anything when the ram isnt selected with A15, so you can use that AND'ed with A15 to access 16k of something else, like your sound chip or similar. So you would AND an inverted A15 and non inverted A14 and that would be your enable for that missing 16k space. This means that you cant use that for addition ram in the future though too, unless you provide more gating and limit the ram to something smaller than 16k. Bank switching is always an option too though if you dont mind the extra complexity.

    An edge connector...
    You mean a PC board edge connector? To plug into what, the PC computer or your own mainframe card cage? One way is to use those Datak rub on patterns before you etch. They come in various widths and spacings, although i dont know if they come in the PCI bus dimensions. I did one myself but it was for the older AT connectors which had larger prongs.
    An alternative is to buy a ready made perf board with an edge connector already on it, if they still make them. If not, maybe cut one off of an old board and epoxy it and possibly bolt it to the board you make with maybe 2-56 size hardware, or maybe 4-40.

    This is interesting to me because i used to use the Z80 a long time ago. I had two commercially made computers with the Z80 too, the well known Sinclair and the TRS-80. I also made a controller board with the Z80 and one with the earlier 8080.
     
  20. absf

    absf Active Member

    Joined:
    Jun 18, 2012
    Messages:
    206
    Likes:
    27
    Location:
    Malaysia
    Is the attached schematic how your IO decoder looks like? Which are the IO lines being used and which are still free?

    Z80 SBC by steve.PNG
    Allen
     
  21. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,376
    Likes:
    975
    Location:
    Loveland, CO USA
    I have one of Mr. Ciarcia's Z180 computers. with CPM operating system. (not using now) and some of his home control computers (not using now).
     
    • Like Like x 2

Share This Page