Adding GPIO - IO from Scratch - Part 1

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024

Комментарии • 106

  • @weirdboyjim
    @weirdboyjim  Год назад +2

    Join us on Discord: discord.gg/jmf6M3z7XS
    Follow me on Twitter: twitter.com/WeirdBoyJim
    Support the channel on Patreon: www.patreon.com/JamesSharman

  • @olavl8827
    @olavl8827 Год назад +15

    Oh no, GPIO. That means the computer will be able to connect to the world. Now the robot uprising is upon us and we're all doomed!

    • @weirdboyjim
      @weirdboyjim  Год назад +2

      Hmm, maybe I should do a video on Roko's basilisk one day.

    • @olavl8827
      @olavl8827 Год назад

      @@weirdboyjim I would love to hear your thoughts on that! ;-)
      Also it's going to be great to see your computer driving some interesting peripherals. I'm really excited to see what you will come up with. And have you thought about adding an ADC?

    • @weirdboyjim
      @weirdboyjim  Год назад +1

      @@olavl8827 I’ll show 2 different methods of analogue input in this series.

  • @stupossibleify
    @stupossibleify Год назад +13

    One of my favourite episodes, looking forward for the next few: how the CPU makes friends

    • @weirdboyjim
      @weirdboyjim  Год назад +5

      Thanks for that! I was worried people might find this one a bit simple.

    • @efanchen2440
      @efanchen2440 Год назад +2

      @@weirdboyjim compared to the others, yes. Its simple. But its a good addition to the CPU to have a basic interface. This makes it way more flexible. espacially for prototyping or testing of other components. Nice video, as always.

    • @catalinbadalan4463
      @catalinbadalan4463 Год назад +2

      @@weirdboyjim It's actually eight bit simple.

  • @gabrielezucchetta4407
    @gabrielezucchetta4407 7 дней назад

    I have been following you for 5 years, and you have produced an enormous amount of extraordinarily interesting videos. It must be very challenging to document everything with this level of detail and clarity. I am developing a system similar to yours, but focused on computational chemistry. Your work is an inspiration to me, and I just wanted to thank you for sharing it with us. Thank you.

  • @KingJellyfishII
    @KingJellyfishII Год назад +4

    I'd never really thought about how GPIO might be implemented in hardware on microcontrollers. Very interesting to see how simple & elegant it is!

    • @weirdboyjim
      @weirdboyjim  Год назад

      I'm going to cover a few of the fundamental IO features in this series. Maybe analogue input next.

  • @DukeofEarl1961
    @DukeofEarl1961 Год назад +4

    Like your method of showing the schematic alongside the breadboard. As well as that you show actual gate function rather than just black boxes like some RUclips channels...

    • @weirdboyjim
      @weirdboyjim  Год назад +1

      On some videos it wasn't possible to show the schematic but I'll continue to do it where I can. I try to put the information on screen that's needed to understand the circuit as I'm building it.

  • @FrankGevaerts
    @FrankGevaerts Год назад +11

    Every computer needs some GPIO pins, and you deserve something a bit simpler to recover a bit between the VGA stuff :)

    • @weirdboyjim
      @weirdboyjim  Год назад +3

      Thanks Frank! I do need something to break things up a bit, there is a lot of pcb work in the builds future!

  • @jerril42
    @jerril42 Год назад +6

    Thanks James. I thought basic GPIO would be faily easy to implement. I enjoyed this one a lot because I could understand everything you did. Take care.

    • @weirdboyjim
      @weirdboyjim  Год назад +3

      Glad you enjoyed it! Most of the circuits in this series should stay very simple.

  • @StevenIngram
    @StevenIngram Год назад +8

    Interesting as always. And I'm kind of impressed by how well you've tamed your assembler code base. You were able to expose the GPIO pins and add new functions so quickly I was honestly amazed. LOL

    • @weirdboyjim
      @weirdboyjim  Год назад +3

      Thanks Steven! Some of the way that was put together was based the needs I knew I would have later on.

  • @DaedalusRaistlin
    @DaedalusRaistlin Год назад +1

    I love how much circuitry is there just to show some different LEDs when you press a single button. It reminds me of people implementing CPUs in Minecraft - emulating simple devices using much more complicated ones. There's just something satisfying to all that complicated stuff being used to implement the basics that it started out with. Something akin to bootstrapping your own programming language in the same language.

    • @weirdboyjim
      @weirdboyjim  Год назад +1

      Hopefully you'll see with the future videos how must stuff can be added with just those simple controls.

  • @JanBruunAndersen
    @JanBruunAndersen Год назад

    We are truly blessed. On the same day as James uploads a video on connecting to the outside world, Ben Eater is uploading a video on connecting his 6502 breadboard computer to the (serial) world.

    • @weirdboyjim
      @weirdboyjim  Год назад

      Of course I already had a UART in my build, might be able to make them talk if they were ever in the same location.

  • @edgeeffect
    @edgeeffect Год назад +2

    I remember on the BBC Micro, we had the User Port 'cus I don't think anyone said GPIO back then... But some of our teachers loved it, because it was the route to connecting all manner of exotic cr... erm stuff up to the computer.... ... yeah, you gotta have some GPIO.

    • @weirdboyjim
      @weirdboyjim  Год назад +3

      I was always frustrated that my zx spectrum didn't have a user port, of course I could have added one easily enough with the knowledge I have now.

    • @edgeeffect
      @edgeeffect Год назад

      ​@@weirdboyjim ooh... if we could take "now knowledge" back to then... ... ....

  • @rauljvila
    @rauljvila Год назад +1

    That was smooooth! It really shows how mature the system is.
    I can't wait for the next videos.
    Thank you very much for the awesome content.

  • @LaserFur
    @LaserFur Год назад +2

    Making a EPP/ECP parallel port would take a lot of parts. ;)

    • @weirdboyjim
      @weirdboyjim  Год назад +1

      Yes, but not anything fundamentally different.

  • @DerULF1
    @DerULF1 Год назад +5

    As always, thanks for sharing. Just out of curiosity: Instead of using a combination of a 74LS574 and a 74LS04, you could have used a single 74LS373 as well. That chip is especially designed for that kind of application. What was your reason not to go that route?

    • @weirdboyjim
      @weirdboyjim  Год назад +7

      Well I favor the 574 because it's pin ordering is really convenient for breadboard work, and I have a bunch of them already. The 573 would be a good choice but having a board with both a 573 and 574 on it is just asking for me to make a soldering mistake!

  • @0toleranz
    @0toleranz Год назад +1

    Hi James, I very much enjoy this whole series and pick some of your designs and techniques for my own build. Regarding this GPIO circuit this would „only“ be a in- AND an output port because each pin is either in or out but not generally usable in both directions (hence the name GPIO) for this there must be an 3rd register to set the direction, and the pins of the in port an the out port have to be multiplexed by this register and an analog switch - or so I always thought. Anyway I think the point here being simplicity that’s the way to go and as a bonus there are 16 lines 8 in and out each. Wish you and everyone happy Easter!

    • @weirdboyjim
      @weirdboyjim  Год назад +2

      I would not agree that pins must be bi directional to call it GPIO. A "pin that is gpio" implies that it can do both, referring to something as gpio just implies that both features exist. Micro controller devices make the pins configurable to increase utility in a fixed package size. I'm not as space limited so I'd only make a bi-directional line if I had need of it.

    • @0toleranz
      @0toleranz Год назад

      @@weirdboyjim sure,that’s of course absolutely the privilege of the designer and saves logic, space and power. And if you never need both functionality on the same pin/ line it absolutely makes sense. Maybe I was tempted to nudge you in that direction because it may make sense for others ( knowing me and how little time I have I probably some day implement it in verilog into one of my small ice40s rather than solder up all those boards ) or for a specific use case later to have configurable functionality without using an fixed i/o-chip like an 8255 or an serial GPIO expander. 😅

  • @oetken007
    @oetken007 10 месяцев назад

    Fascinating project!! And it looks awesome 👌

  • @iamdarkyoshi
    @iamdarkyoshi Год назад

    Always nice to take a break on a complex project and work on something simple.

    • @weirdboyjim
      @weirdboyjim  Год назад +1

      Some of what I'm doing will get quite complex, but more in the software side of things.

  • @johansteenkamp9214
    @johansteenkamp9214 Год назад

    This might be a simple video, but opens up to all kinds of interesting possibilities.
    One possibility that comes to mind is access to an SD Card which suddenly gives you access to a couple of GB of storage.

    • @weirdboyjim
      @weirdboyjim  Год назад

      Indeed, I'm going to interface a few things in this series, some temporarily as examples but others to be new features in the build.

  • @theoriginalrecycler
    @theoriginalrecycler Год назад

    Awesome brainpower at work

  • @codingspace
    @codingspace Год назад +1

    I am so happy that you made your thumbnail cleaner😅

    • @weirdboyjim
      @weirdboyjim  Год назад

      Thumbnails are an art form and I'm not much of an artist. ;-)

  • @Biomancer81
    @Biomancer81 Год назад

    Ive been watching for your new video.

  • @Gorbachevfield
    @Gorbachevfield Год назад +2

    It's crazy how far you've come with this computer. I like the idea of adding more connectivity like the GPIO and UART. Do you think it would be possible to go further and add some sort of primitive networking like 10base-t with LLDP? It seems like it would be possible combining the designs you used for the VGA and UART.

    • @weirdboyjim
      @weirdboyjim  Год назад +3

      It would be possible but I'm not going that way. My plan is to finish this build fairly soon and then start on a new system that takes things a big step forward. I'd spend too much time fighting the limitations of this design. 10base-t's transfer rate really doesn't suit a system with only 64k!

  • @wesleymays1931
    @wesleymays1931 Год назад

    Suggestion:
    Add a mass storage (Compact Flash, most likely) interface;
    Make a simple filesystem driver (Any basic, optionally hierarchical file system should work);
    Write a text editor that can read and write files on that drive, as well as an assembler and runtime program that act on files on the drive
    This should make the computer entirely self-serving, provided you have a serial terminal [or an emulated version of one], since you can write files on the computer, compile them in-situ, and run them right then and there.
    Maybe even lays the groundwork for a full rework of the firmware, where the ROM doesn't have the assembler/disassembler/etc. anymore but gets a 'boot from HDD' option that loads and runs the boot sector.

    • @weirdboyjim
      @weirdboyjim  Год назад +1

      My plans already include a bit of storage, I will be able to move some features from the monitor to executable programs on the storage. There are limits to how far I'll go with this though, nobody wants to watch me spend the next year programming utilities.

  • @-lolus-
    @-lolus- Год назад +1

    thats DOPE , i have a question . the name of the cpu/computer is jam-1 , how much more are you planing to do with it before you move on to jam-2 or something like that ? what would you like to chande with jam-2 ?

    • @weirdboyjim
      @weirdboyjim  Год назад +3

      I have a plan that takes me to end of Jam-1, trying to avoid distractions now.

  • @argoneum
    @argoneum Год назад

    Brilliant. I'll be most likely using 573 in my design (due to timings), this looks like The Way To Do It. Thanks.

    • @weirdboyjim
      @weirdboyjim  Год назад +1

      I may switch to one of those if I can get a few.

    • @argoneum
      @argoneum Год назад

      I mean: 573 and 574 is The Way, depending on the needs and timings (and on when data is stable / needs to be stable) 🙂

  • @TheEmbeddedHobbyist
    @TheEmbeddedHobbyist Год назад +2

    You are changing the load signal after the output enable! which could cause problems if you were running at the limits of the chips but in this case your get away with it I expect. As the /OE only one propagation delay before the latch signal.

    • @khatharrmalkavian3306
      @khatharrmalkavian3306 Год назад +1

      I noticed this as well, but then I realized that it doesn't really matter, since the only timing that matters is when the read happens are the other end. If the read is too early in this implementation then you could get old data, but if the OE is delayed then an early read would just get all zeros from the pull-downs, which it's still bad data. In the end it's probably better to not introduce more delay, and if it needs to push the limits then just figure out the settling time like you would with a ROM or etc.

    • @TheEmbeddedHobbyist
      @TheEmbeddedHobbyist Год назад

      @@khatharrmalkavian3306 it depends if the read is on the falling edge of the signal or the raising edge. But i think that's it's better to latch the data in before enabling the output, i always feel the data should be stable before you present it to the bus. even if it's just to stop noise on the bus.
      I suppose that if the assert signal is basically just an address select and the read signal is used to read the bus then it is not a problem as long as there is a delay between the two events.
      Looking forward to see how close we get to a PIA of days of old.

    • @weirdboyjim
      @weirdboyjim  Год назад +2

      It's very difficult to build circuits and not have the off thing delayed by an inverter. Chances are if you dig into the implementation of these chips there may be subtle timing differences between the response to the load and the enable.

  • @jensschroder8214
    @jensschroder8214 8 месяцев назад

    The LC display can also be controlled with GPIO.
    Or you implement an I2C bus. This then gives you access to many sensors.

    • @weirdboyjim
      @weirdboyjim  8 месяцев назад

      Yeah, you can interface to just about anything with gpio. The LCD modules like mine that talk serial protocols usually have a little board on the back. The next video in this series (should be out in a few days) talks about SPI.

  • @twobob
    @twobob Год назад

    super chill

  • @sirnukesalot24
    @sirnukesalot24 Год назад +1

    The MCUs I've used so far seem to have more than one port. Do you have any future plans for Dev 13? The possibility of not needing an adapter board to run a 16-bit device could be useful.
    How hard is it to develop plug-and-play code? That could be a great topic for either this series or the next.
    If so, would it make any sense to add standard connectors like PS/2 or D-sub to the final GPIO board as connectivity options?

    • @weirdboyjim
      @weirdboyjim  Год назад +2

      Plug and play code isn't really that tough. You just need to be robust enough to tolerate weird things happening, there might need to be some effort put into making the circuits more tolerant as well though.

  • @stevedonkers9087
    @stevedonkers9087 Год назад

    At around 7:00 you have the pinout for the 74xx541 shown which you aren't using. Great video though! It's a great day, a James Sharman video and a Ben Eater video release around the same time!

    • @weirdboyjim
      @weirdboyjim  Год назад +1

      But I am showing one and taking about it. It was deliberate but I didn’t mean to be confusing.

    • @stevedonkers9087
      @stevedonkers9087 Год назад

      @@weirdboyjim Ok. The schematic had '574s on it and I thought you had finished talking about the '541 earlier and went on to use a second '574 at that point. No worries, I just figured I'd point out something that might have confused others.

  • @schrodingerscat1863
    @schrodingerscat1863 Год назад

    This is a nice start, would be cool to add a little state engine and a buffer to this so you can emulate some serial interfaces without having to bit bang using the processor.

    • @weirdboyjim
      @weirdboyjim  Год назад

      Well, I'm mostly going to do some bit banging with this but I may add the odd support component where it makes sense. Obviously I have the UARt series as an example of going all the way in the other direction.

    • @schrodingerscat1863
      @schrodingerscat1863 Год назад

      @@weirdboyjim Yes, but with a little effort on the GPIO side you could potentially replace the UART and have something really quite unique in the DIY processor space. Thinking UART, SPI, I2C etc. and it would be a solid series of content to.

  • @МишаБобров-и1з
    @МишаБобров-и1з Год назад

    wow, interesting, thanks

  • @yedead1
    @yedead1 Год назад +1

    I wonder if your gona go down the same route RPI did where their UART runs on the GPIO header?

    • @weirdboyjim
      @weirdboyjim  Год назад +1

      No, micro controllers do that for a variety of reason, not least they can they can often add hardware more easily than they can add pins to the package. I could make lines work like that but it would take me extra circuitry and ultimately it would be more restrictive than having the uart on a separate header.

  • @kokodin5895
    @kokodin5895 Год назад +1

    very interesting , especially the part about a switch program being the baintent underutilization of resources you have or was it overutilization .. me english not so good in technical.
    anyway as you stated blink program on arduino is making something overcomplicated to perform simple tasks i bet your cpu is not up to the task i am trying to shoehorn atmega8 ic in place of arduino :] and that being a dcc decoder for a train layout ...well if you could run at 16 mhz your cpu probably would be up to task of controlling model trains or being a train too but that is just the clock frequency for commonly used atmel and pic microcontrollers
    by the way happy easter

    • @weirdboyjim
      @weirdboyjim  Год назад

      Glad you liked it, I don't know enough about your dcc decoder to know it's performance requirements.

  • @peter.stimpel
    @peter.stimpel Год назад +2

    congrats for "success at the first try". Do you want to protect those GPIOs somehow from strange handling / abuse, or is this something you put away for jam because you consider it kind of a controlled environment?

    • @weirdboyjim
      @weirdboyjim  Год назад +3

      Do you have any suggestions for protection? Mostly the 574's sitting between test circuits and the main cpu should protect the cpu at least.

    • @peter.stimpel
      @peter.stimpel Год назад +1

      @@weirdboyjim no. Much more was I interested in how to protect a gpio. Seems to me such a protection could be quite a task, because of so many usecases.

    • @weirdboyjim
      @weirdboyjim  Год назад +3

      @@peter.stimpel Yeah, "protect against what" is the big question.

    • @peter.stimpel
      @peter.stimpel Год назад +1

      @@weirdboyjim If you wanna attach different peripherrals, maybe you would ask for a certain impedance, and protect against some overvoltage as well.

    • @JaenEngineering
      @JaenEngineering Год назад +2

      One way I've seen is to have 5v zener diodes on the input. Anything over 5v and the zener clamps the voltage to 5v (might want to include a resistor to limit the current). Also has the advantage that it protects against negative voltages on the input as well.

  • @SweetJustLikeAMango
    @SweetJustLikeAMango Год назад

    What is the piece called that you are using to short all the led array's output pins together? Currently I am only able to short the pins if I have an individual wire for each output pin. Tried looking but haven't been able to find it.

    • @weirdboyjim
      @weirdboyjim  Год назад

      That's a resistor array. It has 8 resistors all tied to a common pin that I'm connecting to ground. You don't want to short the pins!

  • @bassguitarbill
    @bassguitarbill Год назад

    What's the software you're using to make your schematic? I've googled quite a bit but I can't find any program that looks like the one you're using.

    • @weirdboyjim
      @weirdboyjim  Год назад +1

      That is “EasyEda”, it’s a free online system.

  • @ZERR0R
    @ZERR0R Год назад

    Will there be more CPU updates? Or is it in its final state? Maybe some new cool functionality like GPR banks or an arithmetic coprocessor for hardware multiplication and division? Or will it only be peripherals from now on? Also, would like to get a separate video on instruction set, what instructions there are and how are they encoded and why where they chosen, because it's been so long and all in separate videos I've already kinda forgot what instruction set limitations there are... Also would be interested to know about some cut features, something you've wanted to add to your build but decided not to...

    • @weirdboyjim
      @weirdboyjim  Год назад +4

      There will be a few more videos finishing the series of, but for big architectural differences you'll need to wait for the sequel series.

  • @RogerBarraud
    @RogerBarraud Год назад

    Fun :-)

  • @jakester1390
    @jakester1390 Год назад

    I hope you add a thermal printer. It would be extremely trivial, but would be neat nonetheless.

    • @weirdboyjim
      @weirdboyjim  Год назад +1

      I’m going to have to admit, that is not one I considered!

  • @jyvben1520
    @jyvben1520 Год назад

    a lot of soldering, reminds me of raspi or doing several pico, which was still less than here ...

    • @weirdboyjim
      @weirdboyjim  Год назад +1

      Then try not to think about all the soldering I did on the rest of the build!

    • @RogerBarraud
      @RogerBarraud Год назад

      @@weirdboyjim I'm still trying not to think about Pink Elephants! ;-)

  • @francomencacci6694
    @francomencacci6694 Год назад

    a newbie here. maybe you can replace the two 555s with a single 556? excellent videos! keep it up!

    • @weirdboyjim
      @weirdboyjim  Год назад +1

      You posted this exact comment on the analogue in video, I’ve answered it there.

  • @jaguarsrevenge
    @jaguarsrevenge Год назад

    "This isn't DOS dufus!" LOL!😆

    • @weirdboyjim
      @weirdboyjim  Год назад

      One day it might do something real!

  • @OscarSommerbo
    @OscarSommerbo Год назад

    I can see the utility and the need for GPIO, but honestly not a very exciting video series to me. That doesn't mean I won't watch, comment or enjoy them, just that it isn't very exciting to me.

    • @weirdboyjim
      @weirdboyjim  Год назад +2

      Well I hope you find something more to your taste in the later videos in this series.