Developing ZX Spectrum using 8 chips

edited April 2014 in Hardware
Hello. Sorry, my english is not perfect. I am developing new realising of ZX Spectrum. There are 8 chips in my sch. Central processor and video processor is ATMega128 Atmel, keyboard controller is ATTiny2313 is for interfasing with standart IBM keyboard. There are also IS62C1024 (RAM) with octal latch 74ac373, MC78M05CDT - 5 V stabilisator, SN74S257 for video and SN74S04 for in.out.
Post edited by Vasil on
«134

Comments

  • edited September 2010
    there's no way you can emulate a z80 AND generate spectrum resolution colour video in a '128.

    why not just use a real CPU?
  • edited September 2010
    guesser wrote: »
    there's no way you can emulate a z80 AND generate spectrum resolution colour video in a '128.

    why not just use a real CPU?

    I have allready wrote: for video signal i am using one processor, but for emulator - another. ATMega 128 comfortly work at frequency 21 MHz - it is 6 times faster then Z80 and it is anougth for boths purposes.
  • edited September 2010
    Vasil wrote: »
    I have allready wrote: for video signal i am using one processor, but for emulator - another. ATMega 128 comfortly work at frequency 21 MHz - it is 6 times faster then Z80 and it is anougth for boths purposes.

    I still don't understand why you aren't using a Z80... why have an overclocked microcontoller emulating a chip that you can buy and plug in? :confused:

    The spectrum ULA can be implemented in a single CPLD, so you could build a spectrum using only 4 chips (Z80, CPLD, RAM, ROM) and have no emulation at all.

    I don't mean to belittle your effort, and I'll be interested to see the results of your project, I just don't really understand the point of it :)
  • edited September 2010
    guesser wrote: »
    I still don't understand why you aren't using a Z80... why have an overclocked microcontoller emulating a chip that you can buy and plug in? :confused:

    The spectrum ULA can be implemented in a single CPLD, so you could build a spectrum using only 4 chips (Z80, CPLD, RAM, ROM) and have no emulation at all.

    I don't mean to belittle your effort, and I'll be interested to see the results of your project, I just don't really understand the point of it :)

    Thank you, guesser, for your questions. Answer in my situation is simple: i do not know how to work with CPLD. That is all.
  • edited September 2010
    Vasil wrote: »
    Developing ZX Spectrum using 8 chips
    ... I am developing new realising of ZX Spectrum.
    I think the name of the thread is not quite right.

    What you do is developing a hardware emulator not a new Spectrum.

    What is your reason to do that? To know you can do it?

    Because I think there are much real Spectrums for sale for low budget. There are a lot of emulators for a lot of platforms and so on. So you build a new platform to emulate a Spectrum. What's the sense of this?

    Greets Ingo.
  • edited September 2010
    Vasil wrote: »
    Thank you, guesser, for your questions. Answer in my situation is simple: i do not know how to work with CPLD. That is all.

    It's not hard: you'd just need the ULA files from Chris Smith and a JTAG lead (and the analogue side of course :-)).

    As for ingo's point: there really isn't any point in a retrocomputing project. The only point is that it should be fun to do. There's not much point to a Speccy ethernet card either, but it *is* fun!
  • edited September 2010
    You go for it Vasil!
  • edited September 2010
    I'm pretty sure this thing will suffer from the same problem like emulators on slow computers: not enough resources to 100% emulation, so no contention, multicolors, etc - not actually ZX Spectrum, but something software compatible. I guess, it will not work in realtime as well, like all other software emulators.
  • edited September 2010
    And maybe Vasil doesn't know about the Harlequin (I suspect most people outside WOS don't).
  • edited September 2010
    No way that an 8 bit microcontroller @21 MHz can (properly) emulate another 8 bit CPU @ 1/6'th that speed - so this emulation won't be normal speed, timing accurate or anything. No overclocking potential. And written in assembly for a microcontroller, thus: non-portable to other hardware.
    Vasil wrote:
    Answer in my situation is simple: i do not know how to work with CPLD. That is all.
    When all you have is a hammer... :D But seriously: I suggest you do try to learn using CPLD's then, Vasil... not saying it's easy, but not as difficult as coding an emulator in assembly. Especially if you consider that what you can put into that CPLD, has already been figured out (see Harlequin project). No shortage of *real* Z80's either, for the next couple of decades or so... ;)
  • edited September 2010
    I think it is better not to discourage the author. If he finish the project, it would be good example for other people with similar ideas (there are not so few of them, actually), which will show all the drawbacks of this approach.
  • edited September 2010
    Slightly off Topic...have a look at this, maybe someone can translate some of it? Photos are interesting though.

    http://znoxx.wordpress.com/projects/speccy-2007/


    attachment.php?attachmentid=6731&d=1197106505
  • edited September 2010
    It was popular recent development, 48K clone with few ICs (actual Z80, ROM, CPLD), PC keyboard and SD card. Later it was upgraded to 128K+AY+TR-DOS. It has limited compatibility, lower than emulators, but enough to play old games. It is now obsoleted by Speccy2010, FPGA-based.
  • edited September 2010
    Shiru wrote: »
    I think it is better not to discourage the author. If he finish the project, it would be good example for other people with similar ideas (there are not so few of them, actually), which will show all the drawbacks of this approach.

    Thank you, Shiru. You are really integraiting faith in me.
    Thanks others for Criticism. But do not forget: i am russian and have some problems with english. Please, do not use technical slang and difficult forms of speech in order me to understand.
    It is nor great problems with emulating and making of colour video signal using 2 ATMega 128. I will tell more: i have allready made video signal and wrote about 80 % emulating commands in correct time (accept DAA and XOR). I am ready to show the results of my work as soon as anyone tell me how to send zip-files to current forum: i do not know how to do this.
  • edited September 2010
    No way that an 8 bit microcontroller @21 MHz can (properly) emulate another 8 bit CPU @ 1/6'th that speed - so this emulation won't be normal speed, timing accurate or anything.

    A 21MHz AVR is not 6 times the speed of a 3.5MHz Z80, it's more like 20-30 times the speed. Simple instructions on the Z80 take 4 cycles to run, most of the time the instructions are taking between 7 and 15 cycles to execute. You also must remember in his design he's using two AVRs (one to emulate the Z80 and one to provide video processing).

    The AVR on the other hand is a pipelined RISC architecture with 32 registers. It executes most instructions in a single cycle, so clock for clock is conservatively [0] five times faster than a Z80, probably faster if you write your code in a way to avoid the pipeline interlock or a pipeline flush (disclaimer: I don't know any details on the AVR's pipeline, I've only programmed it in C). If you're basing your thoughts on 8 bit MCU speed on what the Z80 or PIC does, don't - the AVR is a much faster design than either of them clock for clock.

    However, I would agree it'll be a huge challenge to get it 100% timing compatible. Emulating the Z80, I doubt will be much of a problem. Emulating the ULA will be much harder; if it were me, I'd be asking Chris Smith about the CPLD implementation of the ULA, and use that for the video side since it'll give a faithful rendition.

    [0] I think the AVR ISA is also a lot more orthoganol, with the Z80 you tend to be restricted to A or HL for many operations, but if I'm not mistaken, general purpose AVR registers really are general purpose, which vastly reduces the amount of shuffling stuff around uselessly to get it into the accumulator or HL. I wouldn't be all that surprised if you could get ten times the performance out of an AVR compared to a Z80 at the same clock speed, it has to count for something not having to be constantly shuffling stuff around between registers. It's also noted that the newer Z80s (such as the eZ80) are also pipelined designs and generally take fewer clock cycles to execute an instruction than the classic Z80, but even in the eZ80 there are plenty of very slow instructions.
  • edited September 2010
    Thank you, Winston, you are really right. For example, cicle M1 (fetch instruction from memory) with testing of masceble interrupt takes in my project 17 cycles (with indirect jump to emulated instruction address).
    So, who can help me to understand how to send files to forum? I have SCH, PCB and video record of video signal i formed.
  • edited September 2010
    Vasil wrote: »
    So, who can help me to understand how to send files to forum? I have SCH, PCB and video record of video signal i formed.

    You can't send files to the forum but images etc. can be linked.
    Store your files in the Cloud using a free utility like dropbox.com
    You can then capture the url of the file and post that here.

    I hope this is available in Russia.

    Cheers.
  • edited September 2010
    You can finde results of my work in zx.pk.ru (in the russian forum.) Go to "Unsorted", then "ZX Spectrum: аппаратная реализация на восьми микросхемах". My name is Лисицын Василий Николаеви. You can find there .SCH, .PCB, video file and example of program.
  • edited September 2010
    Or you can write me Vasil_78@mail.ru
  • edited September 2010
    I found the topic:

    http://zx.pk.ru/showthread.php?t=1374

    But I'm having trouble finding the links to those four attachments. Are they all posted in just one of the 8 pages?
  • edited September 2010
    zxbruno wrote: »
    I found the topic:

    http://zx.pk.ru/showthread.php?t=1374

    But I'm having trouble finding the links to those four attachments. Are they all posted in just one of the 8 pages?


    Try this:
    http://zx.pk.ru/showthread.php?t=13747&page=3
    There are Spectrum.zip (96.7 Кб, 48 просмотров) - .SCH
    RAM.zip (20.7 Кб, 33 просмотров) - .SCH
    OPCODE_DDCB.zip (8.9 Кб, 29 просмотров) - ASM
    ZX-ATmega.rar (192.0 Кб, 64 просмотров) -SCH PDF
    Page 5: Spectrum.zip (82.8 Кб, 28 просмотров) - .PCB
    Page 6: CVBS (100907-195324).zip (289.4 Кб, 65 просмотров) -video.
  • edited September 2010
    Now there is RAM in my project. I read and write it at fool speed with both processors.
  • edited September 2010
    Hi Vasil,
    Can you post us any photos of your development. I think some of us will be interested to see it. Sounds like fun.
  • edited September 2010
    BloodBaz wrote: »
    Hi Vasil,
    Can you post us any photos of your development. I think some of us will be interested to see it. Sounds like fun.

    I have no photo now and photodevice too. I will dend one you when i have it. But you can see mu "fun" reading your e-mail as i send you .PCB, .SCH and video record of video signal. You only must tell me your e-mail or you can visit russian forum
    http://zx.pk.ru/showthread.php?t=13747&page=3
    You can also asc me any technical question about how i am realising now this project. Thank you.
  • edited September 2010
    But i still do not understend: if i have .PDF how can i paste it? Can anyone explane me?
  • edited September 2010
    There are a lot of free file sharing services in the internet, http://rapidshare.com/ for example. Just upload the file to one of these services and provide the link here. There are similar services for image sharing as well, like http://imageshack.us/
  • edited September 2010
    ingo wrote: »
    I think the name of the thread is not quite right.
    What you do is developing a hardware emulator not a new Spectrum.

    And I'd rather say it's still a new ZX Spectrum computer.
    Simply it is developed with contemporary chips that are available nowadays.
    I don't like to "kill" people's enthusiasm, you know.
    ZX Spectrum 48K BEEPER Music:
    http://mister_beep.republika.pl/
  • edited September 2010
    Thank you, Mr Beep.
  • edited September 2010
    Do anybody still think it is only fun?
Sign In or Register to comment.