VIC 20 build. Raster generator HSYNC and VSYNC

Поділитися
Вставка
  • Опубліковано 17 січ 2025

КОМЕНТАРІ • 71

  • @BalugaWhale37
    @BalugaWhale37 3 місяці тому +9

    I now understand why FPGAs, like the Lattice ICE40, are made up of Look Up Tables (LUT) and Flip Flops. They have placed the EEPROM and the Flops into a single ASIC. With that architecture, they can generate any kind of combinational logic. Thanks for building this VIC-20 video generator.

    • @DrMattRegan
      @DrMattRegan  3 місяці тому +5

      Yes, a look-up table with a flip-flop lets you make a finite state machine. Add a memory (with the appropriate addressing system) and you have a Turing complete machine that can execute any computable function.!

  • @FlyGamingChannel
    @FlyGamingChannel 3 місяці тому +3

    Thank you again for your amazing content. I’ve been really looking forward to this series continuing.

  • @laser-sj
    @laser-sj 3 місяці тому +3

    Nice work.
    I have recreated some 80s video games using off the shelf TTL and am now converting one of thrm to directly use VGA rather than use an external upscaler.

    • @DrMattRegan
      @DrMattRegan  3 місяці тому +1

      Great. VGA is pretty simple to use. It’s essentially 2x NTSC.

  • @Kabodanki
    @Kabodanki 3 місяці тому +1

    Thank you for what you are doing, I'm learning at lot, together with my nephew we are building our own little micro

    • @DrMattRegan
      @DrMattRegan  3 місяці тому

      Great. Let us know how you go with it!

  • @alanclarke4646
    @alanclarke4646 3 місяці тому +1

    This an excellent series, Matt. I'm definitely looking forward to the next episode. 😁

  • @GrandpasPlace
    @GrandpasPlace 3 місяці тому

    Thank you, this was well explained and wonderfully presented. I look forward to the next one.

  • @The65c02
    @The65c02 3 місяці тому

    Great video showing your excellent design.

  • @_wave64_
    @_wave64_ 3 місяці тому +3

    19:25 I'm going to declare VICtory

  • @paulspark7287
    @paulspark7287 2 місяці тому

    I'm really enjoying this. I've been trying to get an FPGA to interface with my Vic on and off.. so it's quite timely that I saw your latest video.. And its always nice to see solutions that don't use FPGAs. Looking forward to more of these videos.. I wonder if you do something similar with the C64.. OK.. so I'm thinking more along the lines of sprites rather than a C64 clone. :)

    • @DrMattRegan
      @DrMattRegan  2 місяці тому +2

      Yep, will probably move to C64, but in the short term, I want to replace the 6502 with TTL logic.

    • @paulspark7287
      @paulspark7287 2 місяці тому

      @@DrMattRegan I should probably take time out and watch your 2 videos but something I'm confused with on my own project is the rate at which VGA needs to draw a pixel (1 clock cycle on my 28MHz clock) and how long it would normally take for the Vic chip to read the RAM (using the 1MHz P01). I'm thinking I need a framebuffer to handle the difference in rates. Which part of your video handles the buffering between the different clock domains? Or are you going to read the screen/character and colour RAM at much faster rate than the original Vic would? Maybe I did recall you saying your RAM was faster than the original 2134 chips so maybe that's what you're doing? Shame we couldn't connect on Facebook/Discord. It would be nice to bounce idea off you since you obviously know what you're doing.

    • @DrMattRegan
      @DrMattRegan  2 місяці тому +1

      So, in VGA, HSYNC needs to be ~31500 Hz, but the dot clock is more flexible. I have a VGA dot clock of 8 MHz, which works just fine. Normally the actual VIC 20 has a dot clock of ~4 MHz and it produces 8 pixels every two CPU clock cycles.
      The SRAMs i'm using are about 4-5x faster, but i use that to do all the lookups required.

    • @paulspark7287
      @paulspark7287 2 місяці тому

      @@DrMattRegan At 12:25 I got a bit lost. I'm starting to get it now I think - you get a 16-bit value from your "linked list" because you get 16bits from the 2 EPROMs. The bit I'm missing is how you step through the addresses within those EPROMS. I'm looking at the VIC20 Part3.pdf schematic.. Ah!! I get it now, you're feeding the outputs back into the inputs so that's how it knows where to go. So out of interest, how does this actually start? Do you just get a random address and the ball starts rolling from there? I guess you'd fill the unused EPROM memory with 0's so that if it hits one of those locations it goes back to the start?
      I am quite fascinated to see how this fits together with simple logic. Being a developer I (unfortunately) try to solve problems as a programmer when playing with FPGAs rathern than thinking in terms of discrete components. It's caught me out many times!

    • @DrMattRegan
      @DrMattRegan  2 місяці тому +1

      You got it exactly correct. It doesn't really matter where it starts in the linked list, it's circular. All address outside are set to zero, so a random start will either work directly or jump to zero.
      For UA-cam videos, i think discrete logic makes a more watchable video. I've tried software only playlists (like the SAP6502 microcode) and they don't do as well. Also, i still feel like i'm a bit far away from what's going on with an FPGA. That said, a C64 may necessitate it.

  • @envenomator
    @envenomator 3 місяці тому

    Awesome video; thanks a lot!

  •  2 місяці тому +1

    While less important in (relatively) slow digital signals, I'd guess this kind of prototype wiring will have less parasitic capacitance issues than the breadboard one

    • @DrMattRegan
      @DrMattRegan  2 місяці тому +2

      Yeah, i think breadboard is OK up to about 3-5 MHz, although good boards will go a bit higher. I've found this sort of wiring can go to ~10 MHz. A bit higher if wired carefully.

  • @gomberfu
    @gomberfu 3 місяці тому

    So cool, thank you so much

  • @NuritLeemow
    @NuritLeemow 3 місяці тому

    Amazing content, thanks! Interesting thoughts on the upcoming market changes! If you want to explore further, more information is available in my bio. Looking forward to your next video!

    • @DrMattRegan
      @DrMattRegan  3 місяці тому

      @@NuritLeemow welcome. Will have a look!

    • @SomeMorganSomewhere
      @SomeMorganSomewhere 2 місяці тому

      @@DrMattRegan pretty sure that's a bot ;)

  • @bobweiram6321
    @bobweiram6321 3 місяці тому

    On 10:48, you circle the screen refresh rate and vertical refresh, but not horizontal refresh rate. Is this an error?

    • @DrMattRegan
      @DrMattRegan  3 місяці тому

      Hmm, i circle horizontal then vertical but not at the same time. Thanks for the feedback though.

    • @bobweiram6321
      @bobweiram6321 3 місяці тому

      ⁠​⁠Oops. I think I confused you. At 10:35 on the VGA timing web page, you mention horizontal sync rate, but you have vertical refresh circled in red. ⭕️ There's no horizontal anywhere on the page.

    • @DrMattRegan
      @DrMattRegan  3 місяці тому

      You are right, i think there is a mistake on the TinyVGA website,
      www.tinyvga.com/vga-timing/640x480@60Hz
      Screen refresh rate is the VSYNC rate (60Hz)
      What is labeled "Vertical Refresh 31.46875 kHz" is actually the HSYNC rate.
      Well spotted.

  • @leechatt9709
    @leechatt9709 3 місяці тому

    Another awesome video. Look forward to experimenting with this. I always find the massive border's ugly. How in logic could you say stretch the images width or height? 🤔 I suppose in code we can scale the image for a certain screen size and get the best fit.
    But wouldn't it be great to have to rotary controls where you stretch vertically and Horizontally🤐

    • @DrMattRegan
      @DrMattRegan  3 місяці тому

      Thank for that. We can actually make the active area as big as we want by changing parameters. The monitor i use though wants a blank period around HSYNC of the colours doen't work properly, but it can be pretty small.

  • @_Agent_86
    @_Agent_86 3 місяці тому

    It’s really hard to tell what you’re doing with the point to point soldering the way you have it sped up. I’d love to see at least a portion of it at normal speed so I could understand and try this method out. Great project and I’m looking forward to next instalment!

    • @DrMattRegan
      @DrMattRegan  3 місяці тому

      No problems, i can show a couple slowly. I've previously done videos with long builds and people tend to skip over them. The purpose is really to give a sense of progress moving forward, but i'm happy to include some slower clips.

  • @AndyGraceMedia
    @AndyGraceMedia 3 місяці тому

    You prototyped your own VIC20 memory expansion card as a kid too? hahah! My goodness!! You rock Dr Matt!
    This is the best comp-eng content anywhere on UA-cam. I see your subs are increasing nicely - I think you have a seriously popular and profitable channel in the making here. You certainly deserve it because it's easy see the extraordinary amount of work that goes into it. Brilliant. The next generation of comp-sci/engies have an amazing resource.

    • @DrMattRegan
      @DrMattRegan  3 місяці тому +2

      Thanks Andy. Yep, some 6116 SRAMs from Dick Smiths and a perf board from Tandy that had an edge connector that fit into a VIC-20. Was good for the cartridge games.
      I really appreciate the feedback. I do want to create a resource that helps the self taught and those going through the education system. Particularly with the link between theoretical CS (which is badly taught IMHO) and computer architecture.

  • @zenithparsec
    @zenithparsec 3 місяці тому

    have you done wire wrapping for circuit prototyping? I've tried it after it was suggested on a robot combat related project. it's quite fast and easy to undo stuff if you make a mistake.

    • @DrMattRegan
      @DrMattRegan  3 місяці тому +1

      I did use wire-wrapping many years back, but when i was younger, the sockets were too expensive for my self funded projects. Now i'm just use to doing point to point wiring. I have thought of doing a video where i compare myself at the two techniques (and maybe bread board as well).

    • @SomeMorganSomewhere
      @SomeMorganSomewhere 2 місяці тому

      @@DrMattRegan yeah, sadly wirewrap sockets are pretty spendy these days :(

  • @SomeMorganSomewhere
    @SomeMorganSomewhere 2 місяці тому

    FWIW the schematic you posted on github for part 2 doesn't have the part numbers for U25 and U28 shown.

  • @moshly64
    @moshly64 3 місяці тому

    The schematic has U17 pins 11 & 12 connected to RA0 ? shouldn't it be RA3 ?

    • @DrMattRegan
      @DrMattRegan  3 місяці тому

      Well spotted. It should be RA3, and pin 10 should be CA3. Looks like i relabeled the wrong pin. Thanks for that.

  • @gilbertojunqueira314
    @gilbertojunqueira314 3 місяці тому

    I think it could be using one 74hc4040 instead of three 74hc161. 74hc4040 is a 12-bit counter and has all the outputs (Q0 - Q12)

    • @DrMattRegan
      @DrMattRegan  3 місяці тому +2

      That was actually Ben Eater’s design with the multiple 74ls161s, but thanks for the suggestion.

  • @Malcrom1967
    @Malcrom1967 3 місяці тому

    Where do you get your perf boards?

    • @DrMattRegan
      @DrMattRegan  3 місяці тому +2

      Ebay, but the originate in China.

    • @Malcrom1967
      @Malcrom1967 3 місяці тому

      @@DrMattRegan Could you post a link, please?

    • @DrMattRegan
      @DrMattRegan  3 місяці тому

      The ebay seller i used is called royal2016888 but it looks like they are out of stock. If you search for "perfboard 30cm" there are some available.

  • @LanceHall
    @LanceHall 3 місяці тому

    The most important concept of the 19th century might be... logic gates

    • @DrMattRegan
      @DrMattRegan  3 місяці тому +1

      And I think one of the most important concepts of the 20th century is Turing Machines, which is where I’ll that this series!

  • @EricStringer
    @EricStringer 3 місяці тому

    I point-to-point wire myself.

    • @DrMattRegan
      @DrMattRegan  3 місяці тому

      Cools, what technique do you use for the insulation? Cut to size, stretch the wire and move, or burn through?

    • @EricStringer
      @EricStringer 3 місяці тому

      @@DrMattRegan I use a wire stripper, normally strip one end of the wire on the spool, solder at the start point, and cut/strip at the next point. or I will
      Measure, cut, and strip both ends.
      I want to add a great video, I have been working on a Z80 build. The next project is to do some type of video output and have a bunch of old video chips that I may try to use.
      But a few years back Ben Eater's video and videos like yours on generating a VGA signal with EPROMs over having to use a stander Video output on my list to look into.
      I do not go into a lot of video production quality, but he is a point-to-point wired Z80 board and demo test of the board.
      Since that video made a PCB for the whole system, programming board, and Z80 board.
      ua-cam.com/video/c3qlp9yG5nc/v-deo.html

    • @DrMattRegan
      @DrMattRegan  3 місяці тому +1

      Cool, i had a look at your video, have you done one on setting up and using sdcc?

  • @SirKenchalot
    @SirKenchalot 3 місяці тому

    Were EEPROMs too expensive for 8 bit computers to generate video this way back in the 70s and 80s as it seems to be a cimple way to avoid complex custom chipsets?

    • @briancampbell179
      @briancampbell179 3 місяці тому +2

      They were relatively expensive and more importantly, smaller.
      I designed and built a video card for my SYM-1 computer as my final year electrical engineering project. Admittedly, I didn’t think of using EPROMs at the time, but they were only 4K in those days, so I would have needed 16 to do the job of one today. Instead, I used the 6845 CRT chip that had all the counters and generated the sync pulses.
      As an aside, back in those days, computers needed serial Video Display Units. What was then called the Software VDU where the video memory was mapped into the CPU memory as the VIC-20 and other computers had was new. My video card did both. It’s video memory was directly accessible to the CPU but it also had a serial port and onboard processor so it could act as a serial VDU simultaneously.

    • @DrMattRegan
      @DrMattRegan  3 місяці тому +2

      Yeah, the best solution at the time was custom logic, which is what they did. The main reason I use them is to 1 minimize wiring and 2 demonstrate finite state machines which I’ll eventually use to replace the 6502

    • @AndyGraceMedia
      @AndyGraceMedia 3 місяці тому +2

      EEPROMs were horrendously expensive and weren't widely available until the late 80s. Regular UV erasable PROMs were available from the late 70s but 1k (2708/2508) and 2k bytes (2516/2716) only. By the early-mid 80s, the 2764 - 27256 (8k - 32k) were available and quite usable as combinatorial logic devices - but not on the scale of what Matt's doing here with those half Megabyte parts. Mask-programmable ROMs and fusible link PROMs were used in manufactured devices, but on a huge scale it was cheaper to create custom ICs. The intermediate option was the ULA common in the mid 80s too - Uncommitted Logic Arrays - which offered a bunch of standard logic gates which could be effectively blown at the factory to create the required circuit.

    • @DrMattRegan
      @DrMattRegan  3 місяці тому +2

      Correct, sometimes they also allowed different metal masks for the top layer of the ULA, which effectively allowed different connections. At NVidia, when i was there we still relied pretty heavily on fuses.

    • @senilyDeluxe
      @senilyDeluxe 2 місяці тому +2

      They also were a lot slower. A standard EPROM from the mid 80s can't keep up with the dot clock, even when targeting CGA resolution instead of VGA. Trust me, I tried (it kinda sorta worked, but it sparkled a lot and everything had an edge to it. If you tried using that as a linked list, it's gonna crash and burn and might even damage your monitor). Also if you look at, for example, Galaxians from 1979, it outputs 8 pixels parallel at 1/8 the dot clock and these then get shifted by a bank of 74LS194s which can handle the higher frequencies without a problem.

  • @ianbuxton525
    @ianbuxton525 2 місяці тому

    Great Video, Thank you.
    This is a clever way of replicating functionality without resorting to more complex solutions.
    I will be interested to see you try it out with some of the more demanding Vic20 software e.g. Expanded screen games like
    Star Defence
    ua-cam.com/video/ymJ4r0VslnY/v-deo.html
    and
    Bongo
    ua-cam.com/video/VGGzSkBFfmA/v-deo.html

    • @DrMattRegan
      @DrMattRegan  2 місяці тому +1

      Thanks for the feedback. They are good examples.
      From a screen resolution perspective, i can probably handle 16-32 different combinations of x and y already because the EPROM size.
      I'm undecided about handling the scroll down/up left/right (at least in this version of the machine), i could do it with some extra hardware, just have to decide whether the benefit is worth the extra cost. (Might save scrolling for the C64)

    • @ianbuxton525
      @ianbuxton525 2 місяці тому +1

      @@DrMattRegan Please do it for the VIC20, I am really interested to see how far you can push the compatibility. It is a quirky computer but it is The Friendly Computer. Even William Shatner said so.