1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Scratch Build – In Progress Z80 computer project

Discussion in 'Project Logs' started by Kipman725, 22 Oct 2007.

  1. Kipman725

    Kipman725 When did I get a custom title!?!

    Joined:
    1 Nov 2004
    Posts:
    1,753
    Likes Received:
    0
    Intro

    I posted earlier in the electronics section of the modding forum to say that I had won a Z80 cpu and planned to build a computer/games system using it.

    The CPU has now arrived and I have started work on this mamoth project:
    [​IMG]

    Before I show any of the progress so far I should introduce myself. I am a final year of 6th form collage student studying maths, as further rmaths, phyisics and electronics. I am slightly obsesed with electronics but most of the things I design I never get round to buiding due to the lack of challenge (once something works in my head why build it). therfore this time I'm diving straight on in and getting on with building it. I am using a Z80 cpu for this project as I have only worked with PIC's before and want to use something without such a highly intigrated architecture.

    Usefull links:
    PAL video timings
    Basic how to get a Z80 up and running
    Spectrum clone design blog
    Utilites for Z80 + datasheets

    Total spent so far:
    £50.75
    (many parts haven't been used yet and lots I already have)

    1. Power supply:
    The only power supply I have that outputs 5V is a very dodgey ATX one with nasty 20kHz sawtooth ripple so desiring a nice stable 5V supply I set about building my own. The circuit is very simple just a bridge rectifier, capacitor bank and regulator so I will ommit any secematics.

    The psu case is thick aluminimum and holes for power inlet, fuse, speaker terminals and switch were cut out with various drill bits and jigsaw by my dad (last time I used a drill I made a huge mess).

    I constructed it using the art of super glueing components to the case after soldering them together with solid core wire, the transformer is tiny and made no noise once the psu was turned on, very impresive:
    [​IMG]

    After constructing testing was complicated by my multimeter breaking (shows random values - not battery) and the power switches neon not operating:
    [​IMG]

    The problem with the neon was that it needed neutral connecting to the other side of the switch:
    (left no connection - neon not work, Right - working neon!)
    [​IMG]

    And working psu with an LED connected (only form of volt meter I have at the moment due to dead multimeter):
    [​IMG]

    as can be seen from these pictures the case is connected to mains earth and so is the ground of regulated supply. I will post some osciloscope traces of it's ouput ripple under various loads tommrow if my osciloscope is sensetive enough.

    Parts used:
    C14 SCHURTER INLET WITH SOLDER TABS (3 prong power inlet)
    TWO POLE CHASSIS SOCKET (speaker terminals)
    20MM PANEL MOUNT FUSEHOLDER 10A 250V
    500mA 20X5MM SLOWBLOW GLASS FUSE
    L7805CV +5V 1A VOLTAGE REGULATOR
    4700U 25V AXIAL ELECTROLYTIC (x2)
    MINI ENC TRANSFORMER 230V 0.5VA 9V
    187X118X82MM DIECAST ALUMINIUM BOX
    W005G GLASS BRIDGE RECT 1.5A 50V

    Parts that were free:
    100N regulator output cap
    1uF regulator input cap
    Neon switch
    wire (mains/hookup)
     
    Last edited: 23 Oct 2007
  2. 500mph

    500mph The Right man in the Wrong place

    Joined:
    22 Jun 2007
    Posts:
    2,129
    Likes Received:
    32
    hmm, this looks to be a very interesting custom project.
    can wait to see more
     
  3. r4tch3t

    r4tch3t hmmmm....

    Joined:
    17 Aug 2005
    Posts:
    3,166
    Likes Received:
    48
    Subscribed looking forward to seeing this built.
     
  4. antiHero

    antiHero ReliXmas time!

    Joined:
    19 Jan 2005
    Posts:
    2,037
    Likes Received:
    13
    Awesome idea. I watch this one closelly
     
  5. DXR_13KE

    DXR_13KE BananaModder

    Joined:
    14 Sep 2005
    Posts:
    9,120
    Likes Received:
    364
    interesting.........
    subscribed.
     
  6. radodrill

    radodrill Resident EI

    Joined:
    14 Mar 2006
    Posts:
    870
    Likes Received:
    1
    haven't you ever heard of heatshrink; that wiring looks whack.
     
  7. ledbythereaper

    ledbythereaper New Member

    Joined:
    2 Jan 2007
    Posts:
    131
    Likes Received:
    1
    I use electrical tape on all my solder joints... nothing wrong with it, especially as no ones going to be looking inside the PSU
     
  8. radodrill

    radodrill Resident EI

    Joined:
    14 Mar 2006
    Posts:
    870
    Likes Received:
    1
    I've used electrical tape too; but the taping could have been done a lot better. Though I prefer using heatshrink just because it looks a lot nicer.
     
  9. Nexxo

    Nexxo Stopped treating this country as if it was his own

    Joined:
    23 Oct 2001
    Posts:
    33,809
    Likes Received:
    1,357
    I've heard of Old Skool modding, but this... :p

    Nice.
     
  10. Kipman725

    Kipman725 When did I get a custom title!?!

    Joined:
    1 Nov 2004
    Posts:
    1,753
    Likes Received:
    0
    The wiring is electrically safe and no one will ever see inside the case so it's fine, although if you have a compelling need to heart shrink wires your welcome to come over and do it for me ;)

    I have done some more building, although less than I would like due to lack of concentration. Firstly I tested the power supply with various resistive loads from no load to 50 ohms all of which were unable to produce any measurable output noise (using my Philips PM3232).

    2. The clock:
    Almost every microprocessor needs a clock signal to control the refresh of registers (if DRAM registers present), to synchronize the internal components and to inform the processor when to start the processing of the next instruction. The maximum clock speed of the Z80A is 4MHz so that is the frequency of the square waveform I will feed it. (makes you realize how fast multi GHz computers are).
    I constructed the following circuit:
    [​IMG]

    the basic operation is as follows. The NAND gates inputs are connected together to form a not gate (inverter) and the output is connected to the input through the crystal. The not gate tries to keep it's output the opposite of it's input so the output goes low,high,low.... etc. because the crystal is in there though the output changes at 4MHz as this is the frequency the crystal tries to vibrate at. The capacitors are there to provide a path to ground that has lower impedance at higher frequencies and so damps overtones of the crystals fundamental frequency (4MHz).
    The net result is this waveform (clock):
    [​IMG]

    the overlaid waveform is the power supply rails ac coupled voltage, for the purposes of illustration I have amplified it to show how logic gates cause noise. The amplitude (peak to peak) of this noise is only 5mV. The output of the clock reaches the supply rails (5V peak to peak) and therefore is 1000X the magnitude :)

    I should be able to get the Z80 to do something to show it works next, then I will need to construct an adaptor for serial EEPROMS for it.. as I can't find any parallel ones and also figure out a way of programing it.

    Parts used:
    74HC00 QUAD 2-INPUT NAND GATE
    1UF 100V MKS4 POLYESTER CAP (use 1uF of capacitance per logic gate on its supply pins to mentian reliable operation)
    CRYSTAL 4.0MHZ
    2x 22pF ceramic capacitors
     
    Last edited: 23 Oct 2007
  11. Supra55

    Supra55 New Member

    Joined:
    10 Oct 2006
    Posts:
    423
    Likes Received:
    0
    Uhh.... Since I'm confused in all aspects.... Its awesome 5*
     
  12. Brett89

    Brett89 Active Member

    Joined:
    15 Dec 2005
    Posts:
    1,320
    Likes Received:
    21
    it's a humbling experience, is it not? but yes, beautiful work. this is old school
     
  13. Kipman725

    Kipman725 When did I get a custom title!?!

    Joined:
    1 Nov 2004
    Posts:
    1,753
    Likes Received:
    0
    I built a test circuit where the idea was the present a halt instruction opcode (H76 = 118 = 01110110) to the Z80 on its data bus causing an LED connected to the HALT pin to turn off showing htat the CPU was working. Unfortunately this failed to work but after probing around with my multimeter I think I found the problem. Basically the clock when connected to another logic input stoped oscillating, I'm not exactly sure why but its something to do with a lack of posotive feedback I think so I connected a 100kohm resistor across the crystals pins. This fixed it and I then used it to drive another NAND which I have connected the inputs together of to form an inverter: (the extra capacitor in the picture is just from supply to ground as although the avrage current draw of logic chips is very low the instuntanious draw can be very and so to prevent the supply droping too much causing malfunction capacitors are placed as close to posible to the supply pins to provide this instuntatnious current pulse).
    [​IMG]
    [​IMG]

    My new multimeter arrived today, it's most spiffy far better than the last one in quality and has the bonus feature of a thermocouple:
    [​IMG]

    I also encountered another problem, this time with my powersupply. Basicly I miscalculated the VA rating of transformer I needed and even with just the Z80 and some logic chips the transformer output voltage dipped low enough for the regulator to drop out of regulation. I needed a new transformer so I tried getting one from an old flymo power supply, but as can be seen I managed to cut through the windings while extracting it :sigh:. But lukily I had an old pc power supply which can provide 5V. You can probobly see what I mean about needing some practical experiance by now :p
    [​IMG]

    anyway not much progress more finding out how I messed up even the simple stuff, it's a good job I am very persistant with my electronics. :D
     
  14. Kipman725

    Kipman725 When did I get a custom title!?!

    Joined:
    1 Nov 2004
    Posts:
    1,753
    Likes Received:
    0
    omg I just got the Z80 to proccess its first instruction I'm rather excited and shall post video with an explination of what is happening :D
     
  15. Timmee

    Timmee New Member

    Joined:
    12 Feb 2005
    Posts:
    38
    Likes Received:
    0
    I hated the Z-80 class I had to take in college (although it may have been the teacher more than the class). Do you have a Z-80 specific programming book for your project?
     
  16. Kipman725

    Kipman725 When did I get a custom title!?!

    Joined:
    1 Nov 2004
    Posts:
    1,753
    Likes Received:
    0
    I don't have a book of any kind. I found a website with some tutorials and loads of info though:
    http://www.z80.info/ <--- can't recomend this site enough its awsome for anyone doing anything with the Z80
    I have done some simpler asyembler programing for PIC's before but they have significantly less instructions and only have 8bit registers (unlike the 8bit but bondable to 16bit registers of the Z80) and are genraly much less complex. I'm more interested in building the computer and proving it works than writing my own OS. As a long term goal I would like to make my own version of a DOS game called "is it a fish" which built a web of knowlage about object by starting with that one simple question and then gettign you define a characteristic which made it different from previous objects. Thats quite far away though, at the moment we don't have anywhere to even load more than one instruction from!

    anyway here is a video which will probobly seem bizzare so also an explination!:


    (hmm not showing http://www.youtube.com/watch?v=mGMpF_I7ODs )


    the halt instruction is put on the data bus via dip switches. The halt output (LED) is active low. Initialy the halt instruction is set and the cpu is reset, when the cpu is reset it cannot proccess the instruction and so the LED is lit. As soon as the cpu starts it procceses the instruction and goes into a halt and the LED is thus turned off. In the second portition of the video I start the cpu with another instruction (just random 8bit sequance) and then change the dip switches to the halt instruction (01101110 D0 - D7) causing the cpu to halt and the LED to turn off. Once halted the cpu can only be resumed through an interupt.
     
    Last edited: 27 Oct 2007
  17. Solaris

    Solaris New Member

    Joined:
    26 Apr 2006
    Posts:
    31
    Likes Received:
    0
    I don't understand a word you're saying but that makes this project all the more interesting. :D
    Subscribed.
     
  18. Kipman725

    Kipman725 When did I get a custom title!?!

    Joined:
    1 Nov 2004
    Posts:
    1,753
    Likes Received:
    0
    Apologies for the lack of updates as half term has ended and so I am tired all the time I'm not in college. I managed to get some static rams to use for the main system ram and for the graphics ram they are each 128kB, initialy I won't use the full capacity as the Z80 can only directly address 64KB of ram and having more memory means implimenting memory pages (which is abit far in the future considering this system dosen't even have a boot rom yet). At the moment most of my thinking time is devoted to my Alvl electronics project but as I think I have figured out most of how thats going to work I should be able to devote some time to designing the EEPROM interface. Anyway as I am a firm beliver in pictures been esential for every project log post here is one of the ram:

    [​IMG]
     
  19. mattthegamer463

    mattthegamer463 New Member

    Joined:
    26 Nov 2004
    Posts:
    2,804
    Likes Received:
    1
    When does overclocking begin?

    Ill definitely be watching this. It will give me an interesting perspective on how things used to be done.
     
  20. MoRBiD

    MoRBiD Member

    Joined:
    27 Jun 2007
    Posts:
    174
    Likes Received:
    0
    looks like a couple of centerpede's uNF uNF'ing .....
    w000t keep it up geek boy!
     

Share This Page