6502 serial interface

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ค. 2024
  • Support these videos on Patreon: / beneater or eater.net/support for other ways to support.
    ------------------
    Social media:
    Website: www.eater.net
    Twitter: / ben_eater
    Patreon: / beneater
    Reddit: / beneater
    Special thanks to these supporters for making this video possible:
    Adrien Friggeri, Aleksey Smolenchuk, Alex, Alex Black, An Dương, Anthony Weems, anula, Ben, Ben Cochran, Ben Williams, Bill Cooksey, Bill Watkins, Binh Tran, Богдан Федоров, Bradley Stach, BRian Haug, Burt Humburg, Carl Fooks, Carsten Schwender, Chai, Chris Anders, Chris Lajoie, Chris Sachs, criis, Cristi Cobzarenco, Daniel Jeppsson, Daniel Pink, Daniel Tang, Darrell Burgoon, Dave Walter, David Clark, David Cox, David Dawkins, David House, David Sastre Medina, David Turner, Dean Bevan, Dean Winger, Deep Kalra, Dennis Henderson, Dennis Schubert, Dilip Gowda, Dirk Sperling, Dmitry Guyvoronsky, Dušan Dželebdžić, Dustin Campbell, Dzevad Trumic, Emilio Mendoza, Eric Dynowski, Erik Broeders, Erik Granlund, Ethan Sifferman, Eugene Bulkin, Evan Serrano, Evan Thayer, Eveli László, EvinSaysMarxWasRight!, Florian Bürgi, fxshlein, George Miroshnykov, ghostdunk, GusGold, Hovis Biddle, Humberto Bruni, Ingo Eble, Ivan Esparza, Jack McCracken, Jacob Ford, James Beldock, James Capuder, Jared Dziedzic, Jason Bowen, Jason DeStefano, Jason Grim, Jason Thorpe, JavaXP, Jaxon Ketterman, jemmons, Jeremy Cole, Jesse Miller, Jim Kelly, Jim Knowler, Joe Beda, Joe Pregracke, Joe Rork, Joel Miller, Joey Murphy, John Hamberger jn., John Henning, John Meade, Jon Dugan, Jonn Miller, Joseph Portaro, Jurģis Brigmanis, Justin Graziani, Kai Wells, Kefen, Ken Paul, Kennard Smith, Kenneth Christensen, Kyle Kellogg, Lambda GPU Workstations, László Bácsi, Leo K, Lithou, Lord Dorogoth, Lukasz Pacholik, Marcos Fujisawa, Marcus Classon, Mariano Uvalle, Mark Day, Martin Noble, MatrixSenpai, Mats Fredriksson, Matt Krueger, Matthäus Pawelczyk, Matthew Clifford, melvin2001, Michael Koreshkov, MICHAEL SLASS, Michael Tedder, Michael Timbrook, Michael Weitman, Miguel Ríos, mikebad, Mikel Lindsaar, Miles Macchiaroli, Muqeet Mujahid, NacOJerk, Nate Welch, Nicholas Counts, Nicholas Moresco, Nick Chapman, Oli Homer, Ori Shamir, Örn Arnarson, Paul Heller, Paul Pluzhnikov, Pete Dietl, Phil Dennis, Philip Hofstetter, ProgrammerDor, Ralph Irons, Randal Masutani, Randy True, raoulvp, real_huitz, ReJ aka Renaldas Zioma, Ric King, Rick Hennigan, Robert Diaz, Robert Keown, Robey Pointer, Roland Munsil, Sagnik Bhattacharya, Scott Gorlick, Scott Holmes, Sean Patrick O’Brien, Sergey Kruk, Shane Mulcahy, SonOfSofaman, Spencer Ruport, Stefan Nesinger, Stephen Kovalcik, Stephen Riley, Steve Jones, TheWebMachine, Thomas Eriksen, Tim Oriol, Tim Walkowski, Tim Wheeler, Tom, Tom Knowles, Tom Smith, Tyler Latham, Usseod, Vincent Bernat, Warren Miller, Wim Coekaerts, xisente, Yee Lam Wan

ความคิดเห็น • 334

  • @sefaa4089
    @sefaa4089 ปีที่แล้ว +655

    Babe wake up! Ben Eater posted another video!! 🎉

    • @pareshmhatre4019
      @pareshmhatre4019 ปีที่แล้ว +8

      Why Babe is sleeping?

    • @N0Xa880iUL
      @N0Xa880iUL ปีที่แล้ว +1

      ​@@pareshmhatre4019 She has chronic fatigue syndrome.

    • @notgad3130
      @notgad3130 ปีที่แล้ว +17

      babe should always be awake waiting for the new ben video

    • @manishholla
      @manishholla ปีที่แล้ว +4

      Babe seems distracted.

    • @Raz82000
      @Raz82000 ปีที่แล้ว +4

      ​​@@manishholla yeah. Seems like babe is having "yoga sessions" with tyrone atm.

  • @jason3898
    @jason3898 ปีที่แล้ว +256

    Sat on the kit for a few years, spent the last 2 weeks finally following through the series, I finally finished 30 minutes ago. How delightful to come back to the playlist and find a new episode! Thanks for waiting for me :)
    This is such a great series. I showed my 6yo the final build, had him plug it in and reset it, his response: "Wow! How did you make it do that!?" Me: *starts explaining* Him (interrupting): "Can you make it say Hello, Arlo!?". I walked him through the whole process of modifying the program, building, looking at his name in HEX, pulling out the EEPROM, programming it and getting it back on the breadboard. When it printed "Hello, Arlo!" I think a new hobbyist was born.
    Then, as I'm typing this, he's in People Playground and calls me over to show me he's put "Hello, Arlo!" on a terminal looking screen you drop into the world. Yeah, he's hooked :)

    • @drivers99
      @drivers99 ปีที่แล้ว +31

      That’s so cool. Today I was doing the project where you hook up the video card to a monitor and I showed my daughter, and told her about the hex codes of the 64 color palette and the 100x75 pixel resolution. (She’s in a class learning html, css, and JavaScript so she’s aware of RGB codes in hex, and she makes a lot of digital art as a hobby).So she designed a 100x75 png file for me of a frog eating a fly (LOL) and I modified the python program to convert it since she didn’t index the colors, I had the convert program do it for me. Burned it onto the EEPROM and it shows the frog now :) I think this is helping encourage her too. (She’s 13 not 6 though, big difference.)

    • @rayzecor
      @rayzecor ปีที่แล้ว +7

      That's adorable

    • @anikinmartinez4726
      @anikinmartinez4726 ปีที่แล้ว +6

      playing People Playground at 6 years old

    • @rabidbigdog
      @rabidbigdog ปีที่แล้ว +2

      I wonder if people remember those old Radio Shack kid's electronics kits? They were absolutely brilliant. This is kinda like that, but usually for bigger kids. :)

    • @rabidbigdog
      @rabidbigdog ปีที่แล้ว +4

      Hello Arlo!!!

  • @le-manche-de-pelle
    @le-manche-de-pelle ปีที่แล้ว +107

    "Be conservative in what you do, be liberal in what you accept from others" - Jon Poster
    Man, this is turning into a philosophy channel... and I'm here for it!

    • @renakunisaki
      @renakunisaki ปีที่แล้ว +9

      This philosophy made sense at the time, but led to the utter mess that was Web 1.0, and all sorts of security issues.

    • @BitwiseMobile
      @BitwiseMobile ปีที่แล้ว +2

      It's Postel's Law, probably auto-correct got you. It's the principle of robustness that all application developers and architects should strive for. TCP is a very robust protocol and has stood the test of time indeed. Application layer protocols are a different thing entirely - HTTP I'm looking at you askance.

  • @omgwtfkthxbai
    @omgwtfkthxbai ปีที่แล้ว +29

    "...and that's what we'll be doing in the next video."
    Aww. Just when it was getting to the GOOD part! Please don't make us wait too long, Ben!

  • @fredinit
    @fredinit ปีที่แล้ว +255

    Ben... You do an excellent job of explaining both the electronic and software side of this. Not that everyone needs to be a bare-metal programmer, but we need more developers that understand what's going on "under the covers" in hardware. It's been a long time since I did 6502 assembler (back in the computer wars (C=64, Apple ][, Atari .. before the IBM PC!).

    • @GabrielPettier
      @GabrielPettier ปีที่แล้ว +14

      me, a python programmer, remembering people had to think about memory layouts, when he talks about picking a place to store his little asterisk… 😅

    • @paulmichaelfreedman8334
      @paulmichaelfreedman8334 ปีที่แล้ว +4

      I've met programmers, good ones too, that have never even had a clue what their computers looked like inside. They'd probably be able to name some components, but that's it.

    • @doug7180
      @doug7180 ปีที่แล้ว +2

      This guy's the best.

    • @spot997
      @spot997 ปีที่แล้ว +2

      @@paulmichaelfreedman8334 Couldn't have been _really_ god ones though.

    • @InfiniteQuest86
      @InfiniteQuest86 ปีที่แล้ว

      @@paulmichaelfreedman8334 That's most of them now.

  • @somilamaloyi7544
    @somilamaloyi7544 ปีที่แล้ว +134

    Ben Eater’s videos are too advanced for me now but i still watch because i love watching this whole project form together

    • @MrYerak5
      @MrYerak5 ปีที่แล้ว +4

      I leart so much in the past years from his videos

    • @hn396
      @hn396 ปีที่แล้ว +11

      Learn digital logic and computer architecture! It will really change the way you see technology in general, it's more than just educational

    • @ratvibe
      @ratvibe ปีที่แล้ว +3

      I couldn't imagine a better source to learn the relevant topics than his own videos

    • @jason3898
      @jason3898 ปีที่แล้ว +3

      I'm certain you can handle this series. I have no previous experience with breadboard builds. I've only soldered 2 pre-made PCB kits which, like Ben says at the beginning of this series, only really taught me how to solder. I sat on the kit for years because, every time I started, I felt the same way as you. But then lately I've been binging the LOOK MUM NO COMPUTER channel (curse the algorithm for not suggest the channel to me years ago), who's tag line is "Don't be afraid to try it". He knowledgeably, yet haphazardly, throws extremely cool stuff together without a single fear of making a mistake. It's incredibly inspiring. He happened to mention Ben's kit in one of the videos and I decided to embrace that mindset and just dive in to completing the kit, ignoring the voice telling me I'm not ready for it. After 2 weeks working on the clock module and this series, I finished today. You can do it!

    • @tobie9205
      @tobie9205 ปีที่แล้ว +2

      Same bro. I'm a mechanical engineering student in uni but I've always had an interest in electronics and Ben fills that need perfectly!

  • @jeromethiel4323
    @jeromethiel4323 ปีที่แล้ว +43

    The 16550 UART was an amazing achievement. That one chip replaced entire circuit cards to do the same thing.

    • @scottlarson1548
      @scottlarson1548 ปีที่แล้ว

      What does the 16550 do that the 6850 can't?

    • @jeromethiel4323
      @jeromethiel4323 ปีที่แล้ว +4

      @@scottlarson1548 It had some cache memory on it, IIRC. So if the processor was busy, you could "ride through" and not miss any data.
      There were several UART type devices out around the same time, all i know is the 16550 ended up being what pretty much every body used.
      Your experience, however, might be different.

    • @scottlarson1548
      @scottlarson1548 ปีที่แล้ว +6

      @@jeromethiel4323 The 6850 had cache memory: one byte! You better read it quick.

    • @jeromethiel4323
      @jeromethiel4323 ปีที่แล้ว +4

      @@scottlarson1548 You have exceeded my rather limit knowledge on the subject! ^-^
      Only did a very little bit of breadboarding serial comms, and it was always a 16550. So my experience is extremely limited.
      But i know pretty much every laptop and desktop i owned from the mid 80's on were all 16550's for the serial ports. Don't know why, it's just all i ever saw.

    • @tomteiter7192
      @tomteiter7192 ปีที่แล้ว +2

      @@scottlarson1548 The 16550 had a 16byte FIFO buffer. That was really something back in the day

  • @JustinRCutler
    @JustinRCutler ปีที่แล้ว +22

    You might want to consider the MAX233 (instead of the MAX232). The MAX233 is similar in price, but does not require external charge pump capacitors.

    • @shaunclarke94
      @shaunclarke94 ปีที่แล้ว +1

      Oh wow. How did they achieve the same functionality without capacitors? Or is it somehow possible to embed a capacitor in the IC?

    • @DFPercush
      @DFPercush ปีที่แล้ว +3

      @@shaunclarke94 I'm not sure exactly, but there's a lot of room inside that plastic that's not the silicon die, especially on DIP packages. Most of the space is just for the pins. The caps are probably just potted in there.

    • @tim1724
      @tim1724 ปีที่แล้ว +6

      The MAX233 is around $11. The MAX232 is around $7, and clones (including high quality ones, such as TI's version) are under $2. Capacitors are a few cents. So unless you are really tight on space, it's significantly cheaper to use the TI clone of the MAX232 with external capacitors.

    • @TerrisLeonis
      @TerrisLeonis ปีที่แล้ว +2

      But I already have a MAX232 in my parts box…

  • @graememessina7972
    @graememessina7972 ปีที่แล้ว +21

    If I tried this, I can imagine there being lots of smoke coming out of the breadboard, but man, I love watching this. Thanks, Ben

    • @SlartiMarvinbartfast
      @SlartiMarvinbartfast ปีที่แล้ว +4

      MAGIC smoke of course. 🙂

    • @DW-indeed
      @DW-indeed ปีที่แล้ว +3

      I've learned: Pay attention to your breadboard power rails. I got one that had split rails (The lines tell you! The lines maaan!) which I think meant I somehow created a short loop. The VRMs silently and smokelessly died and were passing 12v straight through into the circuit ("ooh that's a bit warm..."). Fortunately nothing else died, but that genie of the magic smoke is always there, trying to escape!

  • @MikeF1189
    @MikeF1189 ปีที่แล้ว +11

    It sure is great to really understand the functions of all the terms and protocols I've been using for almost 30 years.

    • @zzznddaaae4446
      @zzznddaaae4446 2 หลายเดือนก่อน +1

      I know right! I always loved computers since being a kid, never really tried to understand how they worked until now and its like discovering a computer for the first time ever again.

  • @thewhitefalcon8539
    @thewhitefalcon8539 ปีที่แล้ว +16

    It's worth pointing out that Postel's Law didn't work out so well for the Internet. With every implementation being liberal in what it accepts, it wasn't so easy to spot if your implementation had mistakes in what it sent to others, until certain combinations just didn't work at all. Nowadays, we want to have a clear specification and hold all implementations strictly to the specification.

    • @jasharin
      @jasharin ปีที่แล้ว +1

      heck, he immediately points out the problem with postel's law in the video!

  • @donchaput8278
    @donchaput8278 ปีที่แล้ว

    Absolutely amazing! Thank you for the great content Ben!

  • @pbezunartea
    @pbezunartea ปีที่แล้ว +2

    Thank you Ben, your videos are invaluable!

  • @Whiskey0
    @Whiskey0 ปีที่แล้ว +2

    Man, these videos are something incredible. Thanks so much for taking the time to share your knowledge with the world. I for one truly appreciate it!

  • @drivers99
    @drivers99 ปีที่แล้ว +5

    I’m finishing up the last kit now (I did the 6502, the 8-bit breadboard computer, and almost done with the video card) and a new kit just came out. Awesome!

  • @DrathVader
    @DrathVader ปีที่แล้ว +2

    Literally just yesterday I was trying to hook up a COM port on my headless server to a cheap USB UART adapter. Of course it didn't work and I bet it's because I was trying to interface RS-232 level port with 5V level adapter.
    Great video and great timing.

  • @pipboy9999
    @pipboy9999 ปีที่แล้ว +2

    What fortuitous timing! I was literally looking for a good primer on serial protocol last night.
    Keep up the fantastic work, Ben!

  • @AndersNielsenAA
    @AndersNielsenAA ปีที่แล้ว +4

    Oh Ben, all those newfangled ‘C02 instructions are making me dizzy.. tsb, trb, ror! 1975 called - “that’s not a 6502” 😅

    • @kaitlyn__L
      @kaitlyn__L ปีที่แล้ว

      Well, most 6502s had ROR :p just not the very very first ones

  • @quentidoudou6544
    @quentidoudou6544 ปีที่แล้ว +10

    It's almost like Ben heard i don't know how that i'm on my way to build his 6502 computer using his videos..
    One again, great job Ben! I'll definitely used that in a while!

  • @gregorymccoy6797
    @gregorymccoy6797 ปีที่แล้ว

    I am pretty happy you put a new video up. Always entertaining and educational.

  • @ConzKlips
    @ConzKlips ปีที่แล้ว

    Really appreciate the videos and the level of explanation. Keep it up ❤

  • @maixicek
    @maixicek ปีที่แล้ว

    Awesome video! Thank you for posting it! Looking for UART next 😍

  • @RexxSchneider
    @RexxSchneider ปีที่แล้ว +4

    I wish those chips had been around in 1979 when I faced the task of of interfacing a Commodore Pet to an ICL 2960 (I think it was) mainframe in order to download the 1861 census data for a district of Dudley which the mainframe held on magnetic tape. The Pet had no serial interface, so I had to create one using discrete logic and level shifters, and I ended up making one that ran at 300 baud. The database was 'only' about 600K in size, but that took about a day, if I recall correctly, to successfully download onto two double-sided 8-inch floppy disks, in a dual disk drive which was a custom addon for the Pet because the Commodore disks (on the IEEE interface) didn't have enough capacity.

  • @marianaldenhoevel7240
    @marianaldenhoevel7240 ปีที่แล้ว +3

    Software person here: I love the order in which you write the code for demonstration. The loop, the if-then-else-logic, and then the body for each case. I vow to steal that when I try to explain stuff.

    • @renakunisaki
      @renakunisaki ปีที่แล้ว +2

      That was one of the most important things I learned early on. Don't write code like an essay. Write it "from the outside in". First the overall structure (with comments explaining what goes here), then the interior.

  • @tobiaskarlsson7565
    @tobiaskarlsson7565 5 หลายเดือนก่อน

    I found your channel two days ago and have been glued to the screen ever since! I actually had the book you based your breadboard computer on, and built the mk 2 when I was 15-16 :)
    I just wanted to mention that that you can run timer 1 on VIA in continuous mode to generate a square wave with an arbitrary frequency. Setting it to generate an irq when it restarts lets you run your interrupt handler on every leading edge of that wave. It makes it a lot simpler to handle the read/write timings.

  • @CraftMine1000
    @CraftMine1000 ปีที่แล้ว +2

    AAAAAAAA YES! love it when there's a new video from you ben!

  • @SirKenchalot
    @SirKenchalot ปีที่แล้ว

    Thanks again Ben; another great video.

  • @phrenia7494
    @phrenia7494 ปีที่แล้ว +1

    Another top quality video. Cant wait to watch it.

  • @DevineOne
    @DevineOne 8 หลายเดือนก่อน

    Awesome video. Thanks for sharing. The binary code representing * is 00101010 which matches the scope reading with an extra 0 on the end.

  • @DebuggerKnight
    @DebuggerKnight ปีที่แล้ว +8

    this guy's talent in reading standards absolutely amazes me

  • @rajeshshah1092
    @rajeshshah1092 ปีที่แล้ว

    Thank you Ben! 😍

  • @ShelldonWells
    @ShelldonWells ปีที่แล้ว

    I have no idea why TH-cam stuck this in my feed but I've now watched pretty much every one of these videos and have been fascinated. I have also understood not a thing, but I eagerly await the next video.

  • @wChris_
    @wChris_ ปีที่แล้ว +26

    I believe you can implement send and receive at the same time by using one of the timer interrupts of the VIA chip and handling receive in the Interrupt routine. Sending is done synchronously in the main routine. You can also use the second timer of the VIA for better timing.

    • @johncochran8497
      @johncochran8497 ปีที่แล้ว +14

      Doing that would cause a fair amount of jitter in the send routine. Namely because it's unaware of any timing issues caused by interrupts for the receive. Additionally, send and receive are not necessarily synchronized as to the start of each byte. But since he's gonna use a UART in the next video, there's no need to go extreme low level bit-banging with microsecond level timing and frankly, both send and receive would be well served via interrupts at that point.

    • @threeMetreJim
      @threeMetreJim ปีที่แล้ว

      @@johncochran8497 If you want full duplex with no jitter, use one timer interrupt running at more than twice the speed (from sampling theorem) you need to keep up with 10 x 104uS (single byte time). It's not exactly high speed even for a 6502 (about 2kHz). Poll receive, and transmit when a byte to send is required, using two buffers. As far as I know, old 8 bit 6502 home computers were only half duplex, and used interrupts for send and receive (at least my Atari 800 worked like that).

    • @johncochran8497
      @johncochran8497 ปีที่แล้ว

      @@threeMetreJim Since the hardware is doing pure bit banging, you need that interrupt at twice the bit frequency, not the byte frequency. So call it 52 uS. The Apple // had a clock speed of 1.023MHz, so we're talking an interrupt every 53 clock cycles. There is a 13 clock cycles overhead for taking the interrupt and the rti to return. So you've got only 40 clocks to handle the send/receive plus what ever else you're doing that isn't directly involved with handling the data communications. Not very practical.
      The next video will use an UART so right there the need to handle individual bits goes away and the interrupts happen on xmit empty or recv full. This means that on average interrupts only happen 1920 times per second, or 520 uS which is 533 clock cycles on an Apple // or 520 clocks after excluding mandatory interrupt overhead. Much more reasonable for processing data outside of direct I/O support.

    • @threeMetreJim
      @threeMetreJim ปีที่แล้ว

      @@johncochran8497 Not bit banging, using the UART. Nowhere near fast enough to bit bang. My mistake of getting ahead as soon as Ben mentioned UART. Apologies for that.

    • @johncochran8497
      @johncochran8497 ปีที่แล้ว

      @@threeMetreJim No problem. I assumed that you had read and knew that the context of this subthread was bit banging. And the interrupt frequency of the UART may actually be even lower, depending upon whether or not the UART has any FIFO queues for send and receive. Assuming no FIFO and Apple // clock speeds, I'd estimate the fastest practical RS232 speed would be 38400 baud giving an average of 133 clocks to handle each byte and other processing.

  • @MattyEngland
    @MattyEngland ปีที่แล้ว +1

    Nice. Always love your vids.

  • @sergeyd5777
    @sergeyd5777 ปีที่แล้ว +4

    How many people are out there now who can do this? I deal with Electrical Engineers and Software Developers a lot at my work. The former cannot design a circuit without a CAD simulator, and the latter cannot write an application without C#...
    Ben, you are a gem! Hope you have a good employer.

    • @kaitlyn__L
      @kaitlyn__L ปีที่แล้ว +1

      That’s wild, my electrical engineering class in school did cover CAD but only after we’d gotten good at laying out circuits by pencil and bresdboard. Like the CAD lessons started by translating a breadboard design into CAD. But that was 13 years ago now. Maybe they’re not bothering anymore

  • @solcloud
    @solcloud ปีที่แล้ว

    Awesome video! Thank you 😍

  • @biggjimble
    @biggjimble ปีที่แล้ว +2

    Your videos have so much charm and it's hard to explain why. But the fact that I had the following interaction is a good example;
    "The computer only has this five volt supply, but we need to generate this +-10v or so..."
    "Didn't he just put out a video about a really simple way to do that? I think it was even his most recent-"
    "Well in my last video I talked about how a charge pump is..."

  • @naderhumood1199
    @naderhumood1199 ปีที่แล้ว

    You outdid yourself today, Sir thank you so much.

  • @I.____.....__...__
    @I.____.....__...__ ปีที่แล้ว +4

    4:22 "TCP Robustness Principal - Be conservative in what you do and liberal in what you accept from others" - That's just good general life advice. 🤔

  • @eliotmansfield
    @eliotmansfield ปีที่แล้ว +3

    and ironically his rs232 interface probably has a max232 inside it converting back to ttl

  • @computerkiller1494
    @computerkiller1494 ปีที่แล้ว +3

    i'm being motivated by all of your videos and i think i'll create my own 6502 computer. thanks for all the expalations and help you give :D (maybe i'll get the kit as a birthday gift)

    • @velmuruganr9321
      @velmuruganr9321 ปีที่แล้ว

      And gift it to myself

    • @computerkiller1494
      @computerkiller1494 ปีที่แล้ว

      @@velmuruganr9321 i'll ask my parents actually or maybe yes i'll buy it for myself

  • @StevenHokins
    @StevenHokins ปีที่แล้ว

    Awesome video! Thank you

  • @AJMansfield1
    @AJMansfield1 ปีที่แล้ว +13

    There's also an intermediate level you can go at for serial communications aside from that sort of "raw bit banging", using interrupts and a generic timer peripheral. The CPU never actually runs a delay loop, it just sets a virtual alarm clock for whenever it needs to next send a bit, and sets an interrupt for any transitions on the recieve line to record splits with a virtual stopwatch.
    This style of programming is one that a lot of people aren't really aware is possible, and it can get you out of a lot of sticky situations when you need to deal with multiple tasks with tight timing and/or less-conventional protocols.

    • @harveyxing2329
      @harveyxing2329 ปีที่แล้ว

      Do you mean protothreading?

    • @AJMansfield1
      @AJMansfield1 ปีที่แล้ว

      @@harveyxing2329 Not quite, though that style of event-loop control is also useful. I'm talking about just a more advanced way of using interrupts and timer peripherals.

    • @jeremoisde9928
      @jeremoisde9928 ปีที่แล้ว

      Is this scheduling?

    • @harveyxing2329
      @harveyxing2329 ปีที่แล้ว +1

      @@jeremoisde9928 looks like some form of cooperative scheduling, with the cpu interrupting for a task switch

    • @ZincSpray
      @ZincSpray ปีที่แล้ว +1

      Problem with interrupts with slow processors like 6502 here, is that in a high speed communication the actual interrupt takes tens of cycles already. Interrupt, saving/restoring registers and returning from there all take their time. So in a worst situation, cpu is 'stuck' at re-firing the same interrupt all the time. It gets even worse if both send/receive are firing their own interrupts. (Have to remember there are only 2 interrupt lines in 6502 chip, IRQ and NMI, and they have priorities.)

  • @_ab_6490
    @_ab_6490 ปีที่แล้ว +15

    I hope in future u talk about 8086,8259 PIC,8254 PIT
    Because you are the only person on TH-cam who explains things in a detailed and organized way, you deserve a medal

    • @bayareapianist
      @bayareapianist ปีที่แล้ว +1

      I don't understand why learning these stuff are so hard? He never explained why there was a negative voltage used for rs232. I don't think he knows.

    • @adrianstovall
      @adrianstovall ปีที่แล้ว +4

      ​@@bayareapianist you could always say "hey Ben, why does the serial standard use positive and negative voltages?" You know, actually ask.

    • @melkiorwiseman5234
      @melkiorwiseman5234 ปีที่แล้ว +5

      @@bayareapianist I think it was because that explanation isn't fully relevant to this lesson.
      But to satisfy your enquiry, the RS-232 standard was intended to operate reliably in electrically "noisy" environments. In such an environment, making the voltage "swing" across a larger voltage range makes the connection more likely to reject any interference.
      Or to put it another way, a "pulse" of voltage induced into the communication wiring by electro-magnetism from nearby electrical equipment is less likely to be misinterpreted as being part of the data transmission if you use positive and negative voltages which are widely separated from each other. That is also why the standard allows the voltage swing to go all the way from positive 25 volts to negative 25 volts (a swing of 50 volts).
      TL;DR: It makes the data connection more reliable.

    • @trentborth3589
      @trentborth3589 ปีที่แล้ว +2

      Sounds like "robustness" ;-)

    • @bayareapianist
      @bayareapianist ปีที่แล้ว

      @@adrianstovall I don't think he knew. Otherwise he would have mentioned it.

  • @Lampe2020
    @Lampe2020 หลายเดือนก่อน +1

    I love the increasingly angry "104 _micro_ seconds" text whenever you say "104 milliseconds" XD

  • @kennethhicks2113
    @kennethhicks2113 ปีที่แล้ว +2

    Memories... breadboarding 6502 and C64 projects in the early 80's : )

  • @likebot.
    @likebot. ปีที่แล้ว +1

    Well! 6502s still available in the marketplace. Colour me happy.

  • @akashpratapsingh8959
    @akashpratapsingh8959 6 หลายเดือนก่อน

    Finally someone worthy, explained like no one ever 🔥❤️

  • @StreuB1
    @StreuB1 ปีที่แล้ว

    I have been hesitant to embark on a relatively simple learning project for work where I need to communicate via Modbus over RS485 using a simple microcontroller. I haven't started it due to really having a hard time understanding a lot of this stuff and finding anything on youtube that is straight and to the point was very hard. And now, you come out with this video. While its not exactly the same, it does give me enough to go on to feel a bit more comfortable with my project. I really an looking forward to your next video as it will likely also be very helpful. Thank you, Ben!!!

    • @quinndtxd
      @quinndtxd ปีที่แล้ว

      You should check out Ben's video about RS-232 if you haven't already then

  • @RBJelectronics
    @RBJelectronics ปีที่แล้ว

    Parabéns Ben seus vídeos como sempre são magníficos !!

  • @SB-qm5wg
    @SB-qm5wg ปีที่แล้ว

    Your board designs are so cool.

  • @AlexanderBukh
    @AlexanderBukh ปีที่แล้ว

    Great! Liked the quality of the video.

  • @PeterWillard
    @PeterWillard ปีที่แล้ว

    Thank You.

  • @jumhig
    @jumhig ปีที่แล้ว

    Great video, great explanation of RS232 serial. Thankfully I have been able to use "TTL serial" for most of my projects, which is far simpler to imp!cement.

  • @mikecimerian6913
    @mikecimerian6913 ปีที่แล้ว +6

    The 6502 is in my opinion the best teaching CPU ever built. People who owned Commodore computers could get into machine language in a few months thank to the kernel built routines. The memory addressing scheme by page memory and offset is simple compared to i386 base address and segment/offset scheme. This is the CPU to experiment and have fun with.

    • @bjbell52
      @bjbell52 ปีที่แล้ว

      I didn't know about the page memory system in the Commodore. I had an Atari 8-bit that just addressed everything by address directly. Was the Commodore harder to program in 6502 than the Atari ?

    • @mikecimerian6913
      @mikecimerian6913 ปีที่แล้ว

      @@bjbell52 I don't about the Atari. 8 bit addressing must be closely related. 256 pages each with 256 words (bytes). I really enjoy the symmetry. :)

    • @bjbell52
      @bjbell52 ปีที่แล้ว +1

      @@mikecimerian6913 I think we're talking about different addressing schemes. I think you're talking about index addressing like (address),y . I'm talking about direct addressing like lda #5 sta address. my bad.

  • @sirnukesalot24
    @sirnukesalot24 ปีที่แล้ว +32

    Ben, sometimes I think your in-video mistakes work out to being great teaching tools. I don't think anyone here will ever forget that 9600 baud works out to 104 microseconds per bit for the rest of our lives 😁

    • @dbuezas
      @dbuezas ปีที่แล้ว +4

      Haha so true!
      Btw, in case you didn't realize, the 104us comes from 1s/9600 (that's what bauds mean)
      The exact value is 104.16us

    • @vurpo7080
      @vurpo7080 ปีที่แล้ว +2

      @@dbuezas Yeah baud means symbols per second, so if your symbol is a bit then 9600 baud just means 9600 bits per second

    • @dbuezas
      @dbuezas ปีที่แล้ว +1

      @@vurpo7080 i didn't know it was a generic "symbols per second". I thought it was "bits/s including error detection and control signals". Thanks!

    • @sirnukesalot24
      @sirnukesalot24 ปีที่แล้ว +2

      @@vurpo7080 That's a great catch, actually. It's not just that the symbol could be more than one bit, a quick search showed a way in which an entire nibble (one digit of hexadecimal) can be jammed into the space of one pulse using a complex signal. I doubt that's the limit, either.

    • @paulstelian97
      @paulstelian97 ปีที่แล้ว +1

      @@sirnukesalot24 I believe modern fast Ethernet and Wi-Fi can go as far as one of 2048 options jammed in a single baud (11 bits per baud, though probably 3 of them are error correction)

  • @philipp04
    @philipp04 ปีที่แล้ว

    Nice, was waiting for this

  • @petermuller608
    @petermuller608 ปีที่แล้ว

    Outstanding!

  • @MrDannesboe
    @MrDannesboe ปีที่แล้ว

    This is Excellent.!

  • @timbersrcadventures
    @timbersrcadventures ปีที่แล้ว

    Holy I was just catching up on this series yesterday and wanted more can there be more than one video a month please?

  • @joshuaarulsamy1561
    @joshuaarulsamy1561 ปีที่แล้ว

    The legend is back!

  • @adamthethird4753
    @adamthethird4753 ปีที่แล้ว

    I'm finally in a place where I can start spending money on fun stuff. I'm so glad your store is still online.

  • @LuigiTrabacchin
    @LuigiTrabacchin ปีที่แล้ว

    looking forward to the UART video!

  • @khatharrmalkavian3306
    @khatharrmalkavian3306 ปีที่แล้ว +2

    I've always loved Postel's Law. It can solve so many issues, especially around file format support.

    • @spot997
      @spot997 ปีที่แล้ว

      And in life.

  • @waltermeerschaert
    @waltermeerschaert ปีที่แล้ว +8

    I write programs for a living and the projects are all complicated and deep. They are also existing on several layers of abstraction at the same time, from very high level libraries to very low level numeric type implementations (think 128 bit floating point). Even this video (awesome, as always), which feels like bare metal tinkering compared to my daily work, is actually already several steps up the ladder of abstraction. You aren't making logic circuits from discrete components, each chip represents hundreds or thousands of such components. In actual fact, the abstraction goes all the way down, as levels of reality are based on the abstraction of realized properties in emergent realms arising from the generalized increase in complexity at each layer. As far as I know, this doesn't stop until you get to the "spacetime foam", which might itself be some from of reality arising from still more detailed underlayment, and itself is just an effect.
    Whoa.

    • @waltermeerschaert
      @waltermeerschaert ปีที่แล้ว +2

      Upon reflection, I wonder if it goes up forever as well - once the complexity arises, the new level of abstraction emerges from the chaos. Humans aren't the limit, not even on earth. None of this abstraction would be possible if the complex human interactions among billions of us didn't exist first. The abstract layer of the group undoubtedly leads to interactions between groups of humans, and then that complexity leads to further abstraction as long as it keeps being complicated.

    • @enjibkk6850
      @enjibkk6850 ปีที่แล้ว

      Whoa indeed 😳

    • @waltermeerschaert
      @waltermeerschaert ปีที่แล้ว

      Upon furhter reflection, it is the groupings of items throuout the universe, then groupings of universes??? then more groupings of shit, then some fat guy sitting in his mothers basement.

    • @kaitlyn__L
      @kaitlyn__L ปีที่แล้ว

      Sounds like someone’s been watching PBS Space Time :)

  • @FixedUntilBroken
    @FixedUntilBroken ปีที่แล้ว +1

    That keysight scope is nice. I use a tek mdo3034 at work and have siglent gear at home but it's tempting to go to keysight at home.

  • @brenocoutinho4512
    @brenocoutinho4512 ปีที่แล้ว +1

    Looking forward to see a video on I2C someday
    Cheers!

  • @arifmahmud828
    @arifmahmud828 ปีที่แล้ว

    Nice upload

  • @okiedokie9430
    @okiedokie9430 ปีที่แล้ว +1

    ...and hopefully we'll see the next video before the snow melts 🤗

    • @enjibkk6850
      @enjibkk6850 ปีที่แล้ว +1

      You mean the polar ice caps 😆?

  • @LeWolfYT
    @LeWolfYT ปีที่แล้ว

    Yay! He’s back!

  • @stevedonkers9087
    @stevedonkers9087 ปีที่แล้ว +3

    I imagine it'll be the WDC version of the 65c51 UART chip. I used it for a bit with my SBC but I've gone with the MAX3100 SPI UART and just bitbanged the SPI which was a great learning experience on it's own, but now I just can't go back to the older chips.. :)

  • @Bob3519
    @Bob3519 ปีที่แล้ว

    I've worked in computer hardware and software since 1986. The best way to understand how a computer works is to watch Ben Eater's TH-cam channel.

  • @ke9tv
    @ke9tv ปีที่แล้ว +2

    I remember from back in the day, that RS-232 had rise and fall time restrictions. With some cables and some devices you needed to add a tiny bit of capacitance (330 pF would usually do it) between the transmitter output and ground, or you'd be able to hear computer hash on every AM radio on the block. I don't know if Maxim loads the outputs of the MAX232 with an internal cap, and frankly I'm too lazy to pull up the data sheet right now. But it might be something to be aware of.
    Then again, there's probably enough stray capacitance around the breadboard that you don't need to worry.

    • @bob4702
      @bob4702 ปีที่แล้ว +1

      Yup, slew rate is specified: SR Driver slew rate RL = 3 kΩ to 7 kΩ, see Figure 4 30 V/μs

  • @Mr_ToR
    @Mr_ToR ปีที่แล้ว

    Hi Ben, could you please make a video about the differences between the various chips such as the 4000 Series CMOS range, original 74 series and LS, F, S etc. There isn't a single video explaining this. I found one diagram showing the voltage differences but I think there is also power, speed and impedance differences? A video about this from YOU would be great.

  • @N0Xa880iUL
    @N0Xa880iUL ปีที่แล้ว +1

    The king has returned.

  • @erikhaag4250
    @erikhaag4250 ปีที่แล้ว

    for the TI-83 and related calculators (expect the newer TI-84s) have a Link port, and the serial protocol across it works no matter how fast either calculator is

  • @ailijic
    @ailijic ปีที่แล้ว

    Amazing

  • @jeffm3865
    @jeffm3865 ปีที่แล้ว

    Great videos. Glad to see a new one. Do you have any information or links describing your camera and lighting setup? I tried to make similar videos but I can’t come near the quality and sharpness of your setup.

  • @xvier777
    @xvier777 ปีที่แล้ว

    insightful

  • @tonykaze
    @tonykaze ปีที่แล้ว

    He's back!

  • @s000x
    @s000x ปีที่แล้ว

    Awesome!

  • @AK-ep8ok
    @AK-ep8ok ปีที่แล้ว

    Toady I celebrate 🎉 new video hurrah!!

  • @BAgodmode
    @BAgodmode ปีที่แล้ว +1

    Instructions unclear, Cheerios stuck in breadboard. I don’t think it’s interfacing, I might have used too much milk.

  • @TheUnofficialMaker
    @TheUnofficialMaker ปีที่แล้ว

    well done

  • @paulstubbs7678
    @paulstubbs7678 ปีที่แล้ว +1

    An easier way is to buy an RS232 interface board with built in level converters, they are kind of targeted at the Arduino fraternity, however that does not matter, they talk 5V for direct connection to your VIA

  • @esra_erimez
    @esra_erimez ปีที่แล้ว

    RIP Jon Postel a true pioneer in computing.

  • @FrankGraffagnino
    @FrankGraffagnino ปีที่แล้ว

    wow.... the "conservative in what you do, liberal in what you accept from others" hit a nerve with me! This reminds me of the ancient Stoic principle and quote from Marcus Aurelius... "Be tolerant with others and strict with yourself." Very cool. Thanks for including nuggets of learning like that!

  • @lasersbee
    @lasersbee ปีที่แล้ว

    I use 5V levels using a PIC program to read (with a 10K resistor in series) and talk (with a 1K resistor in series) to RS232.

  • @vojtatesar9239
    @vojtatesar9239 ปีที่แล้ว

    NIce video!

  • @PankajKumar-zr3tv
    @PankajKumar-zr3tv ปีที่แล้ว

    Love you buddy! you are back.

  • @BrainSlugs83
    @BrainSlugs83 ปีที่แล้ว +1

    Funny story -- I encountered the same microsecond/millisecond issue recently. -- I found a bit of old Amiga keyboard interface code that worked with Microcontrollers (i.e. to make a bluetooth keyboard out of an [un]dead computer); and something just didn't seem right... like it seemed like it was missing keystrokes at regular intervals... -- I think most people just assumed that's how those keyboards are? -- But it turns out, there was a bit of protocol code that was calling a delay_milliseconds, but it should have been microseconds (according to the data sheet even) -- I changed that bit of code and everything started working great, no more dropped keys! :D

  • @debarjo
    @debarjo ปีที่แล้ว

    Oh my god!!! Ben Eater's videos drop like Marvel movies!! Blockbusterrrrr!!!!!!

  • @maddsua
    @maddsua ปีที่แล้ว

    Oh yes the content that makes me love engineering

  • @murasaki848
    @murasaki848 ปีที่แล้ว +2

    One of the frustrating things in my job is to match a RS-232 to USB serial interface to the equipment I'm trying to interface. My job has many devices, both operational and test equipment, with craft terminals and other old data ports that require it. As Ben stated in the video, manufacturers of the interfaces very often cut corners, both in the adapter and in the equipment.

  • @realbyte2048
    @realbyte2048 ปีที่แล้ว +2

    i dont even know whats happening in this video but i'm always excited for benny boy's new videos nonetheless

    • @realbyte2048
      @realbyte2048 ปีที่แล้ว

      where did the bot go :(

  • @chexo3
    @chexo3 ปีที่แล้ว

    That cliffhanger at the end, oof

  • @JKTCGMV13
    @JKTCGMV13 ปีที่แล้ว

    Heck yeah 😎

  • @edgeeffect
    @edgeeffect ปีที่แล้ว

    I've been trying to sell a MAX232 like chip on E. Bay for months... I wonder if the release of this video might prompt a sale. ;) Great video as ever.

  • @StefanoBorini
    @StefanoBorini ปีที่แล้ว +2

    When Ben posts a new video, I feel young again.

    • @enjibkk6850
      @enjibkk6850 ปีที่แล้ว

      When Ben posts a new video, I remember why I love computers (now let's head back to javascript for real life stuff 😞)

  • @flleaf
    @flleaf ปีที่แล้ว

    no way.. i finished watching series on 6502 about a week ago and now there is more