Simple STM32 Mechanical Keyboard PCB Design in Kicad

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

КОМЕНТАРІ • 42

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

    So we're back with some more advanced PCB stuff, I highly recommend watching my previous Kicad videos before this if you haven't already.
    Keyboard Matrixes: ua-cam.com/video/7LyziNdFlew/v-deo.html
    Kicad for Keyboards: ua-cam.com/video/8WXpGTIbxlQ/v-deo.html

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

    Fiiiine I'll open up my stupid KiCAD so I can make another stupid keyboard so I can throw my stupid money at my stupid screen! You made me do this Joe!
    Great video, learned a ton!

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

    Good stuff. Some notes:
    Decoupling caps should be as “manufacturably” close to the VDD pins as possible, bulk cap is more forgiving. Typically you would do Via, bulk cap , decoupling cap then vdd pin. Also take into account your power planes and reference planes depending on how many layers you have . It is better to have a solid ground layers and use copper pours for power connections for better impedance but at the expense off potential increased capacitance.
    USB is harder to impedance match on 2 layers because of the distance of the ground plane to the diff pairs for 90 Ohms but if the distance is really short and not close to other tracks, you can usually get away with it.
    Low speed GPIO won’t be as susceptible to crosstalk but it is usually better to fan out your tracks after leaving the ICs pads.

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

      Thanks for the feedback, I've had a few people reach out about some design choices here and I'm nearly ready to release V2. It should follow better practices and be more reliable: github.com/joe-scotto/scottokeebs/pull/18

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

    Finallllyyyy!!! I have been waiting for this for so long. Thanks joe!

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

    Can't wait to see your rp2040 module.

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

    If I am not mistaken the resistors on CC1 and CC2 are to be able to use USB-C to USB-C cables, otherwise you can only use USB-A to USB-C.

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

    This is priceless... I have been looking for a straightforward tutorial about making integrated mcu boards for a while now, mainly because I wanted to slim down my pcbs and keyboards (for wrist placement and health). Can't wait for the rp2040 tutorial as I've grown quite fond of those.
    Thank you for the video... much appreciated!

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

    This is awesome work. I'm really looking forward to your RP2040 module version.

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

    An absolute masterpiece of a guide. Thanks a ton for putting this out.

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

    When the MCU is switching (doing logic), it causes sudden current draws. The caps are there to provide a source of current, so the voltage can stay stable (drawing too much current causes noise)

  • @spicywater761
    @spicywater761 16 днів тому

    I would love to see a video about what it takes to make a split keyboard e.g. what needs to change when you have two controllers, two halves connected via USB-C, etc.

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

    you should do a guide on kicad footprint and symbol library guide. covering import and exporting. good places to find footprints. you have good guides and i would love to have one of these guides done by you.

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

    Awesome video! Ive recently got into keyboards and started looking into kicad to make a personal custom design. Would love to see a video including RGB into the design, great work

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

    Hello, nice video. I have a single comment regarding the ESD protection, the input and the output of the ESD should not be the same net, and as such should not be directly connected. That negates the protection.
    Example from what I know:
    D+, D- from usb c conector are a differential pair that goes to the protection
    And then you should create another differential pair (DM and DP) that goes from the protection to the MCU.
    Hope this helped

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

    Great video, few things:
    1. You probably want to provide a more powerful voltage stabilizer. Some people might want to add LEDs, and other perioherals which might draw extra power that the current one wont be able to provide. I recommend an LM317M. Its super widely available, been produced for ages, and can supply up to 500mA.
    2. Its not bad to spread the decoupling caps out for the STM32 a little bit, this will improve solderability of the board in case something goes wrong and you have to fix it by hand.
    3. Watch out for acid traps. While most modern PCB manufacturers arent affected, it is still considered good etiquette to avoid them.
    4. The BOOT0 pin on the STM32 does nothing but select wether to jump to the standard bootloader or application code. This feature is seldom used on most boards, however if you don't plan on using an external debugger, this will suffice.
    5. The STM32F072 is not the most common chip. A much more common and widely available one is an STM32F103, there are also a lot of clones, making this chip available basically everywhere.
    6. Good etiquette is also naming the global labels that youre using on an STM32 to the respective rows and columns on the switch matrix

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

    Some interesting comments. Awesome video I was thinking of designing a keyboard myself and doing research on that matter. I was watching from a perspective of someone who designs PCB for a living. Feedback from me (explaining some concepts in as simple words as I can but there is much more depth to it then stated here):
    1. Decoupling Capacitors are important and they act as a power well or reserve when the MCU needs a boots in power so placement is crucial (i.e. its performing some tasks and the needed current rises above what it typically needs so the decoupling caps provide it with a small boost until the power supply catches up), also it acts as a filter for noise and damper (think of the power you getting from the power supply in this case USB, its not a perfectly straight line. There are ripples within the voltage levels and the caps damp these ripples to create a smoother voltage level per say.) You need a decoupling capacitor per power input into the MCU so in your case I think 5 from what I can see in your MCU symbol assuming its correct.
    2. Use thicker traces for power, provided multiple benefits.
    3. You dont need to use a via the way you did when routing the differential pair from the USB C end. You can move the VBUS trace further back and then route one of the pairs behind it creating a better continuous trace without the need for a via.
    4. Return paths for your traces. It seems like you are using a 2 layer board which could cause issues in regards to return paths if its not done properly and introduce a lot of noise into your system. One example i can see is your Data line from USB C it has a voltage trace running above/underneath it and the data line has no unbroken return path under it introducing a possibility of noise into that trace

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

      Thank you for the feedback, I actually ended up releasing a V2 that overwrites what I show in the video. The main fixes were for the ESD/Fuse routing and decoupling caps. I also swapped to a 4 layer PCB for better ground/EMI isolation. It still uses the same concept as shown here with just 4 traces between modules but overall should be much more robust. It's on the repo now :)

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

      @@joe_scotto Pretty awesome V2, just had a look at it. I am curious as to why you don't have a ground pour over top and bottom layer? Normally you would keep those in order to reduce manufacturing cost and have balanced copper across the board. Also helps with EMI issues, stitch the ground together for it. Curious hence I ask
      Just another note, not sure if you implemented it but did you do differential pair routing at 90 Ohms? if the traces are not too long it should not effect it too much but your one is a distance away and its good habit to implement it regardless. I know JLCPCB have a calculator that helps with the calculation, in your case its co-planner differential pair

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

    I needed this when i actually prefered pcbs but it could be useful later 😅😅😅

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

    A note about the usb c port shield conn, only master devices should have it connected to gnd. Slave devices should leave it floating/NC

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

    fantastic stuff super super helpful. mant thanks for sharing this.
    looking forward to rp2040 and atmega 32u4 chip based design as well.

  • @HungNgo-we9np
    @HungNgo-we9np 3 місяці тому +2

    Can you upload a video about how flash qmk with this stm 32 ❤

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

    Yesssss! Finally!!!

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

    I'm curious about how you chose the fuse. I cannot find the power draw of the STM32, so did you just go "Meh, 500mA is good enough ?" or did you have some other information like measured power draw of other similar keyboards ?

    • @joe_scotto
      @joe_scotto  24 дні тому +1

      Typical USB spec is 500ma and 5v.

  • @יוסףישראלגורן
    @יוסףישראלגורן 3 місяці тому

    This was very informative as always, Thanks :)
    Any chance you can make another video about how to program a board like this?
    By 'program' I mean how do you load the compiled firmware from a PC to the newly assembled PCB? (PCB with an STM32 MCU)
    More specifically: Do you connect a USB cable to program it? With what programming software? Does it depend on the bootloader? What bootloader does the MCU come with?
    I was able to find many tutorials on how to do it with an arduino but I'm having a hard time answering these questions when I'm comes to designing a PCB with a standalone MCU.

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

      The STM32 I use here just works basically. When you get the board, you hold the boot button when plugging it in and you’ll be able to flash with QMK toolbox.

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

    Nice.. can you make a detailed tutorial about making a case and plate?

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

    Very informative, unfortunately this MCU is not easily available in my country, if looking for an alternative what parameters should I be checking for it to work as a kb usb controller.

    • @a.villegas3414
      @a.villegas3414 3 місяці тому

      Enough pin ports, frequency, USB communication, programming tools.
      Any STM32 or PIC24 can handle this task.
      The stm32f411re could be a good option.

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

    For not being an electrical engineer, you sound a lot like an electrical engineer. :)

    • @a.villegas3414
      @a.villegas3414 3 місяці тому +2

      No. He has misinformation about some things

  • @a.villegas3414
    @a.villegas3414 3 місяці тому +1

    Decoupling capacitors placement IS IMPORTANT, a bad placement or just ignore them and don't set them nearby your MCU can cause lots of noise. Your keyboard is just gonna be an easy target for EMI and the voltage supply to the MCU is gonna fluctuate.

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

      Yes, fixing this in V2. Video coming out in a few days.

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

    Hey uh using KICAD (8.0) when i tried using scottokeeb footprints it didn't show anything could you uh explain to me how to fix it?

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

      Don’t search for them, manually scroll in the selection window to find the library. It’s another bug in Kicad 8+ where search doesn’t show everything.

  • @crossscar-dev
    @crossscar-dev 3 місяці тому

    can you show how to make gasket mounted pcb keyboard

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

    i see you have fallen down the 3d printer rabbit hole as well

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

    i'm fink people need mirror keyboard to working like bodybuilder asymmetry of brain. i fink about two keyboard in one

  • @crossscar-dev
    @crossscar-dev 3 місяці тому +4

    You should probably stop using global nets as there well... global.