RAM and bus timing - 6502 part 6

Поділитися
Вставка
  • Опубліковано 16 лис 2024

КОМЕНТАРІ • 775

  • @waswat
    @waswat 4 роки тому +1977

    "No-one needs more than 16k of memory" Such a great quote to take out of context :)

    • @funnelfpv9435
      @funnelfpv9435 4 роки тому +256

      when you try to do something with an arduino nano with 2k ram you see 16k as unlimited memory.

    • @tylerufen
      @tylerufen 4 роки тому +62

      @oH well,lord! I think it's just that he was shy about making the joke, not knowing if people would get it, and not knowing how appropriate it was to make the quote without naming the source...

    • @misterhat5823
      @misterhat5823 4 роки тому +34

      @@funnelfpv9435 Try being used to PICs that have less than 1K and you have to bank switch for more than 80 bytes.

    • @misterhat5823
      @misterhat5823 4 роки тому +29

      @@tylerufen That and the original quote was 640k.

    • @IFS
      @IFS 4 роки тому +11

      @@Kelan-pn6em And as consequence, the original IBM-PC had addresses 640k < ISA Bus & Peripheral I/O < 1024k mapped and then when more RAM was needed/available all sorts of hoops about paging memory had to be pursued. When they had looked into the crystal ball the designers chose to allow for easier expansion of the peripherals... Woops.

  • @ajreukgjdi94
    @ajreukgjdi94 4 роки тому +356

    What I learned today is that there's a 30 page manual for a 1" x 1/2" piece of electrified plastic, but it doesn't actually tell You anything. Just gives You a bunch of clues to do Your own detective work.

    • @amunak_
      @amunak_ Рік тому +31

      Its actually a piece of rock encased in plastic.

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

      ​@@amunak_Silicon, to be precise

    • @xoxogamewolf7585
      @xoxogamewolf7585 29 днів тому

      WhY do You capitalize all Your Y's?

    • @ajreukgjdi94
      @ajreukgjdi94 29 днів тому +1

      @@xoxogamewolf7585 I used to capitalize the words "you" and "your" as an exercise in humility. It forced me to constantly think of the person I was talking to. That was until it just became blind muscle memory. When I didn't have to actively think and remember to capitalize them, I gave it up. Honestly, I'd forgotten about this. I thought it was longer ago than 4 years, but maybe the muscle memory seeped through a bit longer.

    • @Yehor-v7y
      @Yehor-v7y 11 днів тому

      ​@@ajreukgjdi94 backstory

  • @RoamingAdhocrat
    @RoamingAdhocrat 4 роки тому +703

    I used to be a bus driver. Was much easier to maintain bus timing when I didn't have to sell tickets to passengers as well as drive the route.

    • @DarthZackTheFirstI
      @DarthZackTheFirstI 4 роки тому +8

      ^^

    • @renakunisaki
      @renakunisaki 4 роки тому +62

      I bet you're glad you didn't have to be precise to the nanosecond though.

    • @Elios0000
      @Elios0000 4 роки тому +15

      welcome to the concept of bus mastering and DMA

    • @renakunisaki
      @renakunisaki 4 роки тому +25

      @@Elios0000 Direct Money Acceptance?

    • @blameyourself4489
      @blameyourself4489 4 роки тому +13

      I used to drive an Airbus.

  • @andrewkieran8942
    @andrewkieran8942 4 роки тому +462

    Special shout out for the graphics overlays. I'm sure that they took a lot of extra time and effort on your part, but I think they really enhance the explanations. Thanks Ben.

    • @AlanCanon2222
      @AlanCanon2222 2 роки тому +10

      Yeah, just one more layer in the Ben Eater toolkit of kick-ass videos. I'm in awe of all of it, not just the subject matter, but the pedagogy. Top flight.

    • @dominiquedeveaux361
      @dominiquedeveaux361 4 місяці тому

      +

  • @PastaAivo
    @PastaAivo 4 роки тому +366

    This really makes you appreciate the engineers and scientists that get your home computers running in the GHz range... And Gb/Tb... And so much more...

    • @RealCadde
      @RealCadde 4 роки тому +62

      It's an iterative process really. They make the chips smaller and more energy efficient, as such they can run them faster without causing meltdowns.
      And they make them more tolerant to fluctuations, as well as improve power supply units to maintain a steadier voltage at higher loads.
      But we have already reached the physical limit of processor clocks a long time ago. That's why today it's all about parallelisation.

    • @WarrenGarabrandt
      @WarrenGarabrandt 4 роки тому +25

      Yeah, any circuit that runs over a few hundred MHz is designed to crazy tolerances, and anything that runs in the GHz range is JFM.

    • @AlexanderKrivacsSchrder
      @AlexanderKrivacsSchrder 4 роки тому +32

      @@WarrenGarabrandt Probably says a lot that we've started running into quantum tunneling issues with our smallest circuits...

    • @stefankrause5138
      @stefankrause5138 4 роки тому +2

      ...military byproducts...

    • @dionyzus2909
      @dionyzus2909 3 роки тому +9

      That's true. However, a single engineer or scientist would not be able to do that, since it requires so much investment and industry problems just to make a single chip. I wish it was possible to do that, though, can you imagine how amazing it would be to just make your own 2.0ghz dual core processor at home ? Surely not comparable to industry standards, that nowadays are like almost 4ghz and at least quad-core, but if that one day could be something that one very intelligent and dedicated person could make by him or herself, that would trully be fucking amazing.

  • @berylliosis5250
    @berylliosis5250 4 роки тому +436

    Interesting how these half-hour videos never seem long enough. Well done

    • @heavenstone3503
      @heavenstone3503 4 роки тому +3

      OMG IT WAS 30mn
      It felt like 15mn !!!

    • @lxathu
      @lxathu 4 роки тому +3

      In the first 10 minutes, the layout is a piece of art itself. The rest is """only""" what ifs during which I heard more than I could have ever thought about.

  • @Oli1974
    @Oli1974 4 роки тому +85

    Never ever in my 46 years I encountered anyone who could explain me RAM timing better than this guy.

  • @DillsArtThing
    @DillsArtThing 4 роки тому +140

    Never before in my life have I thought 32kb of data was a lot until I started watching Ben's videos

    • @RealCadde
      @RealCadde 4 роки тому +13

      Well, 32 thousand characters is quite a bit. Let's assume you wrote that on A4 pages at 3000 characters per page. That's 10 pages and you still have room for an introduction on another page.
      And a computer at this low level generally only deals with very simple I/O tasks.
      The Apollo 13 spacecraft had 32 KBit of memory (that is, 4 kilobytes) just to put things into perspective.

    • @davidmcgill1000
      @davidmcgill1000 4 роки тому +4

      @@RealCadde and double that size if it was written in 16-bit Unicode for some reason instead of ASCII/UTF8.

    • @RealCadde
      @RealCadde 4 роки тому +4

      @@davidmcgill1000 Or get 36,571 characters if you use 7 bits per character.
      And 42,666 characters with 6 bits per character.
      And if you ignore upper/lowercase you can even get 51,200 characters with 5 bits per character.

    • @AlanCanon2222
      @AlanCanon2222 2 роки тому +4

      I'm one of those "I had a Commodore 64 when I was 13 types" so it did seem like a lot, back then. It was enough, anyway, for a great deal.
      I've been looking at the WDC 65c816, which can bank switch up to 16MB while still having an 8 bit data path: it's basically a 6502 with a 24 bit address space, and wanting to build one....but it occurs to me that a 6502 with just 32KB (or 64KB, in the theoretical max for the C64) could in every way hold a program that could communicate enough with the outside world in order to download new code for execution: in the case of the C64, it did this through modem and disk drives. So even Ben Eater's rudimentary 6502 based computer could, in principle, even with its 8 bit limitation, be stitched into larger scale computing through clustering: 32 KB RAM is way more than you need for a simple supervisory program that can download further assignments over a serial line (network).
      Ben's earlier 8 bit computer on breadboards doesn't hand you that, the way his 6502 kit does: the nybble-wide address space sees to that. It would be interesting to see the parallel universe of Ben Eater videos detailing 10 bit computing, 12 bit, etc (each jump allowing double the instruction set as well as double the address space). I'd like to see the video where someone does what Ben did for 8 bit, but with 10 bits, one extra bit each for opcode and address/constant.

    • @AlanCanon2222
      @AlanCanon2222 2 роки тому +6

      @@RealCadde Those Apollo computers were really cleverly programmed, too. They represented all real values as greater than 0 and less than or equal to 1, so you could never, ever, have a divide by zero error: the computer just wasn't capable of representing 0 as a number. I think Margaret Hamilton is the name of the person who figured out how to make it that way: her idea was to make computers that can be mathematically proven to never fail, never to get themselves into a state they can't be gotten out of. It totally worked, too.
      I also think all the gates on the Apollo computers were NOR gates, four to a chip: the NOR gate is one of the "universal gates" that you can make any other gate out of. Of course we laugh at those giant (by modern standards) NOR gates and say, we can make much better, but the Apollo people could come right back at us and say, "And how recently have YOU landed people on the Moon?"

  • @studennison5434
    @studennison5434 4 роки тому +132

    Many 8-bit computers simply share their I/O address within the RAM space. Programmers simply know that those address are verboten for program/data use, but conveniently also hold a copy of the I/O registers.
    Absolutely love your videos, Ben. I look forward to every one of them!

    • @subDimensionUK
      @subDimensionUK 4 роки тому +9

      How does that work with the data bus? If you put an IO address out to read from the IO device, wouldn't the RAM also try to output on the data bus at the same time as the IO device?

    • @n3ttx580
      @n3ttx580 4 роки тому +17

      @@subDimensionUK afaik those computers usually have more advanced R/W decode logic. Early made by logic gates, later implemented in GAL/PAL ICs. Look up some more advanced homebrew PCs with like 65C816 and focus just on decode logic.

    • @MAYERMAKES
      @MAYERMAKES 4 роки тому +20

      Is verboten really a word English speakers use? That's a germanism I haven't encountered before.

    • @subDimensionUK
      @subDimensionUK 4 роки тому +18

      MAYER MAKES yep, I've used it. It means *really* forbidden 😉

    • @YellingSilently
      @YellingSilently 4 роки тому +6

      @@MAYERMAKES It's not a common word, but I have used it/heard it used.

  • @stefanhennig
    @stefanhennig 4 роки тому +16

    I just stumbled upon this video and all I can say after over twenty years of professional experience in designing hardware and writing software for it: being able to read and understand datasheets is among the most important skills in my craft. I spend about 20-35% of my time brooding over documentation and not overlooking details is essential for my job. Your videos could be made obligatory training material for any newcomer. Great job!

  • @MrUnix-xf8dq
    @MrUnix-xf8dq 3 роки тому +23

    Ben Eater, your channel helped me understand 4 years of school I went to... I knew everything we studied, but didn't understand it, and your channel made everything just click together.
    Almost too good to be true.

  • @IncredibleMD
    @IncredibleMD 4 роки тому +118

    "If you're into overclocking, you can give it a try and hope for the best. But in our case we've got other limitations-"
    *looks at the breadboard crisscrossed with wires*
    ... Ya think?

    • @jimtekkit
      @jimtekkit 2 роки тому +3

      Yeah, breadboard computers are great for learning but terrible at preventing crosstalk.

  • @NotMarkKnopfler
    @NotMarkKnopfler 4 роки тому +415

    Ben: "So in the next video...."
    Me: "Nooooooooooooooooo!"

    • @catogtp
      @catogtp 4 роки тому +4

      yup, just happened to me too

    • @zulqarnayeenschaftler9323
      @zulqarnayeenschaftler9323 4 роки тому

      Can we use another eeprom instead of Ram?

    • @4n0ngaming
      @4n0ngaming 4 роки тому +7

      @@zulqarnayeenschaftler9323 No, EEPROM is read-only when it's in the computer.

    • @ValentineC137
      @ValentineC137 4 роки тому +7

      *_Laughs in the future where he's already done_*

    • @Martin.Krischik
      @Martin.Krischik 4 роки тому +1

      @@zulqarnayeenschaftler9323 EEPROMs write speeds are too slow to be used in a computer. Note that RAMs can read and write with the same speed.

  • @byronwatkins2565
    @byronwatkins2565 4 роки тому +36

    Your videos are a welcome review for an old guy that doesn't do this stuff full time. For a RAM write it is essential that the address be valid early so that the garbage on the data bus corrupts ONLY the byte that we will ultimately write with valid data anyway and that the data and address remain valid until the 8 memory cells have firmly latched. For a RAM read it is essential that we allow the memory enough time to decode the address and to buffer the data byte onto the data bus before we read it. But it is also essential that we transition from read to write and from write to read while maintaining these two capabilities. This is why RAM timing can seem complex to those who have not considered these three points.

  • @payloh_3328
    @payloh_3328 2 роки тому +8

    I am finishing my junior year of college as an electrical engineering major and this series has taught me more practical skills than any one of my proffesors

  • @paulstelian97
    @paulstelian97 4 роки тому +302

    "Noone needs more than 16k of memory" Lovely quote that aged well

    • @blayral
      @blayral 4 роки тому +10

      Paul-Stelian Olaru Wasn't it 640k ?

    • @paulstelian97
      @paulstelian97 4 роки тому +19

      @@blayral Eh, the actual value doesn't matter, in the original quote it did indeed say 640k but it's irrelevant in my view.

    • @haraldmbs
      @haraldmbs 4 роки тому +10

      @@paulstelian97 xD *looks up modern servers, sees values of several TB* Hmmm, yep, only 640k

    • @blayral
      @blayral 4 роки тому +11

      @@haraldmbs No one needs more than 640kTB of memory... :o

    • @thatrandomperson1562
      @thatrandomperson1562 4 роки тому +10

      malloc(100000000000000000000000000);

  • @isbestlizard
    @isbestlizard 4 роки тому +85

    huh.. I finally understand why memory maps are important!! it's literally turning a logical address space into a physical 'this chip needs to store/retrieve this' thing :D

    • @duality4y
      @duality4y 4 роки тому +5

      yep and it makes life a whole lot easier

    • @VulpeculaJoy
      @VulpeculaJoy 4 роки тому +31

      Yes and while I always thought, adresses are holy and only a concern for memory, it is actually a valid thing to hook up logic to them and do all sorts of I/O etc. stuff with certain bus adresses. During our Digital Engineering class we just did it on an FPGA so the internal processor circuitry was essentially virtual, but we had a bunch of hardware hooked up and it was just amazing to figure out how it works. In the end I managed to display a cat gif on an lcd, because that's what technology was made for: cute cat gifs.

    • @renakunisaki
      @renakunisaki 4 роки тому +6

      @@VulpeculaJoy on the Game Boy, everything is mapped to memory. There's one address you read the buttons from, a few that control the sound generators, one that's hooked up to a shift register for the multiplayer link, a range that contains the attributes of sprite graphics displayed on screen (and that's shared with the GPU so you can only access it at certain times)...

    • @VulpeculaJoy
      @VulpeculaJoy 4 роки тому +7

      @@renakunisaki Well that's not really true for dedicated GPIO ports. With those you have a bunch of dedicated registers that you adress, and the IO procedure itself is happening completely independent of the bus.

    • @AlanCanon2222
      @AlanCanon2222 2 роки тому +1

      @@VulpeculaJoy This business of doing I/O by mapped memory addresses is one of the things that's key to implementing a 6502 in only 3,514 transistors (or whatever it was). I don't even know how many transistors are in the CPU I'm using to type this.

  • @Robert_McGarry_Poems
    @Robert_McGarry_Poems 4 роки тому +26

    You make this topic very digestible, thank you for your work.

    • @RogerBarraud
      @RogerBarraud 2 роки тому

      Digestible, Eater, I get it :-)

  • @aviadshimalkovski7711
    @aviadshimalkovski7711 3 роки тому +2

    For anyone wondering why he didn't do anything with the WE signal, if I understood correctly, it's because in the WE signal there isn't time delay, it's just goes up immediately. In the CE signal the problem is that it could be that even though we already changing the address the CE signal still could be low(because the microprocessor didn't change it), but it isn't not the case for the WE signal because it's goes up without delay in the RAM itself ( the RAM chip doesn't wait for a couple nano secends like in CE).
    I hope I understood well and hopefully if I didn't I would love to hear the right answer and correction for my saying.
    And of course, thank you very much to ben! Amazing and well explained video!

  • @TonyGingrich
    @TonyGingrich 2 роки тому +3

    Almost 20 years ago, before I changed careers into IT, I was a residential and industrial electrician. Was also very obsessed with my wire layout and organization. Neither myself, nor anyone I knew, was as good as the man in this video. His wiring organization, alone, makes him look like an artist!
    To my defense, service electrical wiring also requires at least 3 loops of excess. I left 4. Nonetheless, I suspect this man would easily best me on that level too! Very impressive craftsmanship.

  • @your_utube
    @your_utube 4 роки тому +14

    Thanks Ben. This helps us appreciate modern systems so much more that operate correctly with amazing time constraints beyond what these classic systems had to deal with. Great technical tutorial for us would-be tinkerers.

  • @jameshansen1903
    @jameshansen1903 4 роки тому +117

    It's interesting to learn that microprocessors have similar timing limitations as Matt Parker's 10,000 Domino Computer.

    • @keiyakins
      @keiyakins 4 роки тому +11

      Heh, honestly I think that the tolerances on that are tighter, if we scale to the size of the switching devices :P

    • @Red_Eagle
      @Red_Eagle Рік тому +1

      yeah, but on a nanosecond scale, not on a days scale...

  • @xtdycxtfuv9353
    @xtdycxtfuv9353 4 роки тому +54

    13:29 “we’re interested in reading data right?”
    that’s write we are

    • @snapsecond
      @snapsecond 4 роки тому +1

      Great pun

    • @nikkiofthevalley
      @nikkiofthevalley 4 роки тому

      @@snapsecond I agree with that assessment!

    • @youdonotknowmyname9663
      @youdonotknowmyname9663 3 роки тому

      Interested in reading data?
      I know lots of government agencies that would agree with that
      ;-)

  • @mapleshaft
    @mapleshaft 4 роки тому +3

    You really are a great teacher. Your use of visual aids and the pointed questions really help in understanding something very complex. As soon as you eloquently walked through the problem and ensured I understood, I immediately knew the solution was an inverted AND gate with the clock. You give the audience the feeling of accomplishment and discovery which is something many teachers fail to do.

  • @high_runner
    @high_runner 4 роки тому +1

    You consolidated my belief of you being the best teacher I ever had for digital electronics, when you considered propagation delay by introducing a NAND gate to mitigate the compatibility issue between the processor and the ram. Kudos to you!

  • @TalathRhunen
    @TalathRhunen 4 роки тому +10

    I had wondered about that "clock into ram chip select" on the circuit diagram since the start of this project, and now we finally have the answer.

  • @vcothur7
    @vcothur7 4 роки тому +72

    7:57 "Reality is often -complicated- disappointing"

    • @lxathu
      @lxathu 4 роки тому +4

      Hence banned in many countries.

    • @youdonotknowmyname9663
      @youdonotknowmyname9663 3 роки тому

      Well, if you don't have any expectaions, you won't be dissapointed. Only positiveley surprised!

  • @oscill8ocelot
    @oscill8ocelot 4 роки тому +7

    I just got home from a really long day at work and this right here is the highlight of my day :3 Thanks Ben ^.^

  • @vuurniacsquarewave5091
    @vuurniacsquarewave5091 3 роки тому +2

    This is honestly the first one I'll have to re-watch. These timing diagrams are the one thing I've never quite grasped before and I'm sure watching this video a few more times will help with that.

  • @jammin023
    @jammin023 4 роки тому +1

    One of the things I most appreciate about these videos is how you take the time to explain your design decisions; in particular, the fact that often there are various different optimisations to choose from, that compete with each other to some extent. Like choosing to only have 16K of addressable RAM for the sake of making it easier to wire up in hardware: even though at first glance that seems "wasteful", it might actually be more wasteful to spend ages trying to make every last byte of RAM accessible, when we're unlikely to need it all for this project. In many walks of life you have to choose what to optimise for, and the best answer may not be the first optimisation you think of.

  • @telbee
    @telbee 2 роки тому +2

    This is *exactly* the problem I was having with a 65C02 with a 62256 SRAM. I could not see why it would work with a NEC 43256 but not a 62256. Now it is working with either - This video has explained it perfectly - thanks! :)

  • @tlniec
    @tlniec 3 роки тому +1

    This is the clearest explanation of timing/margin analysis that I've seen.

  • @Egon3k
    @Egon3k 4 роки тому +3

    the entire playlist is pure treasure! thank you for all your awesome work!

  • @xtdycxtfuv9353
    @xtdycxtfuv9353 4 роки тому +2

    welcome back lord Ben. once again we thank u for ur devine knowledge and explanatory methods. Bless u lord Ben. Amen. 🙏🙏🙏🙏🙏🙏🙏🙏

  • @charlesjmouse
    @charlesjmouse 2 роки тому +3

    As always, very good. I'm no expert, but here's a thought or two for anyone reading as belatedly as me:
    As the 6502 doesn't see a difference between I/O and memory one could have 'nearly' 32k of RAM simply by ignoring the overlap between the I/O and RAM. In effect when you address your I/O you will also write those values to the RAM at those locations, and the I/O devices will do the same thing. As long as one is aware if this behaviour, and the RAM is fast enough, that overlap won't matter. Being able to 'read' 'unreadable' I/O might be useful.
    PS:
    If one were so inclined a memory-mapped display could play the same game. If you use a 64k SRAM half of it would be overlaying your ROM. Most of the time that's a waste... until you realise you really only ever read from ROM and write to display RAM. With a bit of wiring jiggery-pokery you get your display RAM effectively for 'free'. As set up with 32K of video memory (or more sensibly 16k with a 16k ROM) without cutting in to system RAM would be a nice thing.
    ...personally I wouldn't bother - something like a Ti9918a for video is easier to interface and handles all the video/sprite stuff without any real thought required as to how.

  • @sirflimflam
    @sirflimflam 4 роки тому +1

    Been following this series and have been with you 100% until now. But this part is what fried my brain.

    • @rzeka
      @rzeka 3 роки тому

      Same. I don't understand why the RAM is inacessible sometimes, and nothing on those diagrams makes sense to me.

  • @320mb
    @320mb 3 місяці тому

    Man "O Man, I am getting so good at reading Schematics ... I just love this stuff. I've put up Videos on my youtube channel documenting this whole 6502 Adventure. The RAM, The Stack and Sub-routines along with very detailed explanation of the Read/Write timing of the Chips.... Electronics education at it's Best. Thanks Ben!

  • @VaradMahashabde
    @VaradMahashabde 4 роки тому +199

    When half the video is deciphering "helpful" documentation

    • @cjay2
      @cjay2 4 роки тому +20

      Because it is highly critical information to understand in order to design with these components.

    • @clonkex
      @clonkex 4 роки тому +57

      @@cjay2 I think he's just joking at how convoluted datasheets can be.

    • @cjay2
      @cjay2 4 роки тому +8

      @@clonkex Ah! But it was true that everything one needs was in the data book. You just had to study it well. It was all there, you just had to put it all together. But anyone who succeeded became a very knowledgeable designer.

    • @VaradMahashabde
      @VaradMahashabde 4 роки тому +14

      @@cjay2 But why doesn't the datasheet spend more time to explain, say, the timings?

    • @cjay2
      @cjay2 4 роки тому +22

      @@VaradMahashabde First, it's not a datasheet. All the earliest 8bit CPU's had User Manuals, where his timing diagrams come from. These were usually several hundred full-size pages, and had full written descriptions of both the Read and Write cycle timings, as well as full descriptions of every instruction in the instruction set of that CPU. I started with the Signetics 2650, an early 8 bit CPU, then graduated to the venerable Z80. Both had complete User Manuals with full descriptions of every aspect of the chip, and both needed to be studied well, in order to use the CPU's properly.

  • @shivakumara0749
    @shivakumara0749 4 роки тому +12

    Nice editing,👍

  • @hoerbschmidt618
    @hoerbschmidt618 2 роки тому

    I really could never make a sense of these timing diagrams.
    Now with your explanation I can finally read them. Thank you so much!

  • @radio-ged4626
    @radio-ged4626 2 роки тому

    23 mins into the video you mention that the margins for timing are crucial and should not be exceeded or get too close to the limits because of effects such as thermal variance....Tell that to Cisco. Seriously this is a great tutorial. It has been some years since I studied this stuff and this has been a fascinating refresher. Thank you.

  • @ciabok92
    @ciabok92 2 роки тому

    As a hardware enthusiast i've never got so in-deep into the communication in PCs. It's an amazing lecture.

  • @aquadap219
    @aquadap219 Рік тому

    the things i learned from your videos are like a gift from god as a computer engineering student thanks ben!

  • @nagualdesign
    @nagualdesign 4 роки тому +3

    These videos are fascinating to watch just for fun, but they'll be a fantastic resource for anyone who actually builds things for years to come. _impressed emoji_

  • @BobBeatski71
    @BobBeatski71 4 місяці тому

    Thanks for the detailed explanation, Ben. I'm currently working on a 6502 / 65C816 version of John Winan's Z80 CPM adventure using my old Xilinx Spartan3A Starter Kit that I never got around to using till now. I had a sorts of glitches in the scope waveforms that I couldn't put a finger on (and it doesn't help I'm a newbie to Verilog), but after watching this video it clicked why I was having problems, so thank you again for really helping me out today. :D

  • @Malaphor2501
    @Malaphor2501 3 роки тому +1

    40 Minute video to say that we need to hook up a NAND gate to the clock and A15, and I ate up every minute of it. Bravo.

  • @lars1588
    @lars1588 2 роки тому +2

    This was a lot to process, but it was really eye-opening, as I now understand why we have limitations in overclocking and such, along with the delay factors of even the simplest physical components.

    • @kaitlyn__L
      @kaitlyn__L Рік тому

      Especially all the fiddling with waitstates to make marginal overclocks behave better!

  • @pyramidschema8668
    @pyramidschema8668 3 роки тому +4

    Makes you appreciate the incredible engineering that must go in modern motherboards. Hundreds of components running at 4000x this speed, all synchronized.

    • @kaitlyn__L
      @kaitlyn__L Рік тому

      They get really sensitive to trace length at that speed too, which is why layouts are done in software rather than by hand I guess! By hand you could move a set-length piece of tape or string around to keep the length the same, often with a lot of negative space, but software can do many iterations to find decently compact trace spacing.

  • @hoodaly
    @hoodaly 4 роки тому +79

    But at the end, the falling edge of the clock is only propagated with a delay of guaranteed 15ns, which is greater than the t_AH of 10ns, so the write would fire even later than without the nand gates....

    • @bluekeybo
      @bluekeybo 4 роки тому +8

      Exactly! So I don't know if that's 100% guaranteed at all cases the way it's designed

    • @hxka
      @hxka 4 роки тому +9

      He addresses that at 36:31. The write stops when either CS or WE go high, and WE is not delayed by gates.

    • @F3Ibane
      @F3Ibane 4 роки тому +21

      @@hxka But WE is not guaranteed to change before the address lines, so still seems like a possible issue.

    • @TheBigHolox
      @TheBigHolox 4 роки тому +15

      ​@@hxka But wasn't the whole point introducing the gates, because we can't be sure WE goes high before any other address line changes? So we made sure CS definitely goes high before anything else changes, which might not be given anymore because of the delay?!

    • @hxka
      @hxka 4 роки тому +10

      @@F3Ibane Yeah, you're right, he only solved the issue of CS being low too early.

  • @fundi_mike
    @fundi_mike 4 роки тому +1

    excellent - the last few days I had been thinking about how cpu's and rams' interface with each other - this video is perfectly timed to make my mind wrap around the timing issues!

  • @stephenillingworth151
    @stephenillingworth151 4 роки тому

    Your walk-through of the CPU/RAM timing diagrams is genuinely useful. I've been trying to decipher the Atari 2600 timing diagrams and have had great difficulty. It doesn't help that they are hand drawn but none-the-less your description has clarified some points I was unsure about. Thank-you.

  • @markusa.9931
    @markusa.9931 4 роки тому +57

    Love the idea of gating the write with the clock! I just don't understand why you chose to gate the chip-select line rather than the write-enable line. Wouldn't that also impact the read cycle and potentially break the data-hold requirements for a read? tCHZ on the memory chip has a minimum of 0ns and since the nand-gate doesn't guarantee a minimum delay either, the total delay before the output of the memory chip goes to high-impedance might be well below the tDHR requirement of the processor. Or am I missing something? :) Great videos, btw! Many thanks for all your hard work!

    • @eliford9826
      @eliford9826 4 роки тому +5

      I was wondering that as well. For what it's worth, it looks like Nintendo used a similar approach to what's shown in the video: console5.com/wiki/Nintendo_NES-001#Schematics
      If I'm reading the schematic correctly, the NES main RAM is only enabled (CE) when address 13/14/15 are all low and the clock is high. The RAM's write-enable pin is tied directly to the CPU's RW.

  • @BlackKingdomEnterprise
    @BlackKingdomEnterprise 4 роки тому +2

    All your videos makes me very curious to learn...thank u for these videos

  • @jamieosh70
    @jamieosh70 2 роки тому

    These videos are amazing. Such high quality, super clear, and so well presented. Ben, you are fantastic, thank you so much.

  • @square444
    @square444 4 роки тому

    This is by far the most challenging video in this series. In the future, be sure to keep walking through timing in great detail like you do here -- If I was doing this on my own without your help, I would have been totally lost here. Thanks for explaining things so clearly

  • @aperson6187
    @aperson6187 4 роки тому

    I am sure that you know this already, but taking the time to use the print outs to walk through your thinking as i would be forced to do is a major part of what makes these videos so good.
    Doing this and the step by step approach you take to assembly with testing as you go obviously takes a great deal of time and effort on your part.. I really, really appreciate this! Thank you!

  • @nasergunono8937
    @nasergunono8937 4 роки тому +8

    cool i am happy this came out faster than the last

  • @aerodigital
    @aerodigital 4 роки тому +10

    What a glorious day, a new Ben Eater video has arrived!

  • @aymensekhri
    @aymensekhri 4 роки тому +1

    That summarizes two semesters of Computer Architecture & Microprocessor Design in 38 min video !!

  • @recklessroges
    @recklessroges 4 роки тому +2

    I don't know what the improvements were that the Patreon's made were, but thank you: I could not find a single fault with the finished video.

  • @douglasmaclean5836
    @douglasmaclean5836 4 роки тому +3

    Absolutely love these videos.

  • @mikea683
    @mikea683 4 роки тому +2

    You sir, are a wizard!

  • @N9TAX
    @N9TAX Рік тому

    So 2 things. First this is an amazing series. I have learned so much building this. Second. I am building the RAM section now. I received a Cypress cy62256N ram chip with your kit. The pinout on this chip is wonky. The address lines do not jump around like they do on the EEPROM or any 27... whatever EPROMS from days of yore. They are all in a row. Pin 1-10 is A5-14 and A0-4 is on the other side. I had to double check this as I was a bit taken back that someone was making a non pin compatible chip to all of the others. I hooked it up as the datasheet described and it works perfectly. I did however dig through comments on your website and there were a number of folks thinking they received bad ram and ordering replacement chips. So you may want to put something with the video or in the description that lets folks in on this issue.

    • @drivers99
      @drivers99 Рік тому

      Ah interesting, I have the same chip. But if you think about it, it doesn’t actually matter. All that matters is there are 15 different address pins. If you write to the “wrong” address by changing the pins it will read the same “wrong” address. Thus it doesn’t actually matter how they are numbered.
      Same story applies to data pins.

    • @N9TAX
      @N9TAX Рік тому

      @@drivers99 I agree totally. I wired the chip as per its datasheet and it works perfectly. I only pointed this out as there were a number of folks on Ben's forum that likely downloaded the datasheet from Bens site. There was much discussion of their having bad ram and seeking to purchase the identical chip in the video. I only noticed this because I read the actual chips part numbers and got the datasheets form the manufacturer. I wasn't implying that the different pinout was an issue. It actually made it easier to wire up the way I laid my board out.

  • @erygion
    @erygion 4 роки тому

    Great video Mr. Eater. I hope to someday be on your level, I would have never even thought to look at that, much less be able to find a solution but thanks to you I have an idea on how to go about it. Thank you, this is knowledge I'll always have now.

  • @cryptearth
    @cryptearth 4 роки тому +4

    Ok, although it's a 40min video (with some sic! good explain of how to understand those diagrams) that cliffhanger at the end - oh, you teasing us all ...

  • @pickoftheglitter
    @pickoftheglitter 2 роки тому +3

    Great project! What a pity (at least for me) that part hasn't subtitles and it was hard to fully understand everything, since I'm not native english. I lost some info but I guess I got enough to understand, more or less. This is a wonderful channel, I'm going to build one; I have most of the components here, so I'm just waiting for a couple of ICs to arrive. Thank you so much for your lessons, I now know things that nobody was able to teach as clearly as you did. Thumbs up!

  • @ThePilhuhn
    @ThePilhuhn 3 роки тому

    This is again an awesome video. I knew a lot of the stuff in the previous ones having hacked my c64 in assembly some 30+ years ago. But here I am learning so much. Keep up the good work. Thanks

  • @nostalgia5031
    @nostalgia5031 3 роки тому

    I think that the pictures he makes to show the connection between chips are really cool. They make understanding this a lot easier :)

  • @MultiSchuman
    @MultiSchuman 4 роки тому

    You keep up the good work. Beautiful work explaining all the details. Made me wiser to these difficult to read timing diagrams.

  • @marcelmayer7538
    @marcelmayer7538 4 роки тому +4

    I really like your videos. 😍 I would love to see (for example as a next project) how to communicate via the CAN bus (OBD2) in cars.

  • @chicoern
    @chicoern 2 роки тому

    This series is absolutely amazing. Beautiful work!

  • @SimonCash
    @SimonCash 2 роки тому

    Such a good series of videos. I wish this was available 20 years ago..

  • @adi5381
    @adi5381 4 роки тому +2

    im a programmer and have never done any hardware stuff like this but i love these videos!

  • @gyanvistaar655
    @gyanvistaar655 3 роки тому

    You are doing a great job.

  • @FritsvanDoorn
    @FritsvanDoorn 4 роки тому +1

    Very very very very interesting and joyful. Thank you.

  • @bassome3000ify
    @bassome3000ify 4 роки тому +1

    You're well worth the support 💪👍
    Learned a lot

  • @mrembeh1848
    @mrembeh1848 4 роки тому +27

    Will this work on my local bus too? The timing is really bad .... I always miss it and have to walk...

  • @osirisgolad
    @osirisgolad 4 роки тому

    Fantastic video. This is exactly why it's so hard to get chips to run faster at the same efficiency target.

  • @spider853
    @spider853 3 роки тому

    This really gets you to appreciate interplanetary hardware/software, change in temperature and everything works differently...

  • @AKZP87
    @AKZP87 2 роки тому

    Damn, really need your "Complete 8-bit breadboard computer kit bundle"!!! Greetings from Finland ! ! !

  • @username17234
    @username17234 4 роки тому +2

    Such an interesting and useful video going in-depth about timing, nice job, looking forward to the next episode ;)

  • @JKTCGMV13
    @JKTCGMV13 4 роки тому +6

    I probably shouldn't have been as excited as I was when I saw "bus timing" at the top of my sub feed

    • @cjay2
      @cjay2 4 роки тому +1

      No, you are right to be excited about bus timing, because it is highly critical information to learn, so you can design these systems. Once understood, this stuff is gold.

  • @toddp6104
    @toddp6104 4 роки тому +1

    Excited to build my own system😀 thanks so much for your content, my goal after this system works is to incorporate a controller for stepper drives kind of like Cnc machines I run at work😀 since my career path branched off back in the days of early microprocessors. Keep up with the awesome content👍 You Rock👊👍

  • @S0NOSMANLl
    @S0NOSMANLl 4 роки тому

    As much as I tried to get all my friends to like and share his videos; I don't think he still get enough attention. He is awesome.

  • @MlokKarel
    @MlokKarel 2 роки тому

    This taught me sooo much in a few minutes it makes me a little bit angry I haven't seen this long time ago... :)

  • @aaronr.9644
    @aaronr.9644 4 роки тому +4

    20:40 but that is the max set up time at the 14 MHz case. The datasheet shows higher values when running the clock slower though it looks like you'd still have plenty of time to satisfy the RAM.

  • @sparsam117
    @sparsam117 4 роки тому +4

    I've been building along with these videos, and greatly enjoying them. They've all been crystal clear so far, but this one has me a bit confused.
    From my understanding, once the clock goes low at the end of the write cycle, the processor then goes into a fixed 10nS "hold" period in which the address and data lines are valid for a write. In other words, once the clock goes low, we have 10nS to get the "latch" or "write" signal to the ram before the data (and address) becomes invalid. Typically, that NAND gate has a delay of 8nS. Since the clock only goes through one NAND gate, (and the other input of this NAND gate will be satisfied much earlier in the cycle from the address becoming valid) that would delay the "latch" signal getting to the ram by 8nS, so everything would work. The problem becomes if our propagation delay is longer than 10nS, which can happen with this particular NAND gate.
    You do address this issue, but then say that it won't be an issue because the Write Enable of the RAM will go low on time anyway. To my understanding, this is not the case. The Write Enable, driven by the R/W signal from the cpu, will return high "at the same time" as the address and data becomes invalid, which means it is not guaranteed to be 0nS before the data becomes invalid.
    Hopefully I'm wrong, because faster NAND gates are not avaliable from cheapo ebay and aliexpress :p Keep up the great work!

    • @TIMoXA27
      @TIMoXA27 Рік тому

      It seems to me too. Just watched the video very carefully and came to the same conclusion. But one note. The problem becomes if our propagation delay is no longer than 10nS, but longer than address hold time. And yes, mentioned 25 ns for worst propagation in NAND will cause the problem in writing.

  • @neonsilver1936
    @neonsilver1936 4 роки тому

    I'm so tired from watching the previous videos last night that I had a "Math class" moment. I spaced out for a second, and then at 9:00, I come back to reality and he says "So on the surface, that seems pretty simple". Thank goodness for the pause button and ability to go back and re-watch what I spaced out over, because I missed that whole segment, lol

  • @lapischicken
    @lapischicken 4 роки тому +52

    Best youtuber, while not being an actual "youtuber"

  • @CorinBaurmann
    @CorinBaurmann 4 роки тому +4

    In 29:47 Ben said that Write Enable hooked up to the Read/Write on the 6502 isn't necessarily going to go high at least 0 nano seconds before the address becomes invalid. But at 36:50 he says the Write Enable isn't delayed by the worst case 50 nano seconds like the Chip Select is and it will go high on time so the RAM stops writing before the address goes invalid. But the Write Enable Validity is still tied to the address validity like shown in 29:47, at least according to the spec sheet of the processor, isn't it?

    • @fogh1
      @fogh1 5 місяців тому

      CS will go high some time after the clk falls, typically 8pm but could be more. Basically I think this works bc the NAND gate rarely has a max propagation delay, and even if it did, invalid address or data sent to the ram would have very little time to allow the ram chip to actually corrupt any data, but there is no guarantees.

  • @orangus01
    @orangus01 4 роки тому +25

    Just as I was thinking "When will he upload a new video?" notification pops!

  • @ownpj
    @ownpj 4 роки тому +3

    If you don't need to read from I/O, put it in the same address space as ROM and use /WE as another chip select signal. Then you have address space for all the RAM.
    Or use spare IO lines to bank in chunks of ROM/RAM.

    • @george8bitsworth
      @george8bitsworth 4 роки тому +1

      Note that in the pinout of the 65C22 there is an R/W line (pin 22). There are times when you might want to read from it (I/O -- input-output).

  • @oscarwahlstrom5426
    @oscarwahlstrom5426 Місяць тому

    Regarding the CE setup time, the margin that is affected by the nand gates is not 970ns but closer to 500ns, since the relevant nand delay is after CLK goes high and not low.

  • @RetroRogersLab
    @RetroRogersLab 4 роки тому +1

    In your graphic showing the Address Range 0000-3FFF it might help to add a third row with 4000 to show that is when A14 & A15 begin to not both be low. I enjoyed your approach. I knew the gotcha was coming and getting there was a fun journey.

  • @rattehalliravishankar5606
    @rattehalliravishankar5606 4 роки тому

    You are really genius. Very good explanation.

  • @grantharris8332
    @grantharris8332 4 роки тому

    Fantastic videos. I wish I had these resources when I was doing my computer hardware courses during my CS degree. Thanks!

  • @AntonMikhaylov
    @AntonMikhaylov 4 роки тому

    Thank you very much! This episode perfectly explains timings which I commented about under one of your previous videos.

  • @LL-we9vq
    @LL-we9vq 4 роки тому +1

    Excellent video!

  • @retronexusnet
    @retronexusnet 4 роки тому +2

    amazing videos. please more of that!!

  • @syrus3k
    @syrus3k 4 роки тому +2

    wow... timing is everything.