I2C Hardware & PCB Design - Phil's Lab

Поділитися
Вставка
  • Опубліковано 16 тра 2024
  • I2C implementation tips (pull-up resistor sizing, bus capacitance, schematic gotchas, and PCB design). PCBs by PCBWay www.pcbway.com
    [SUPPORT]
    Hardware design courses: phils-lab-shop.fedevel.education
    Course content: www.phils-lab.net/courses
    Patreon: / phils94
    Free trial of Altium Designer: www.altium.com/yt/philslab
    [GIT]
    www.github.com/pms67
    [SOCIAL]
    / philslabyt
    [LINKS]
    How To Write A Driver (STM32, I2C): • How To Write A Driver ...
    I2C Bus Specification and User Manual: www.nxp.com/docs/en/user-guid...
    Designing with I2C Bus Devices: www.nxp.com/docs/en/training-...
    I2C Bus Pull-Up Resistor Calculation: www.ti.com/lit/an/slva689/slv...
    Why, When, and How To Use I2C Buffers: www.ti.com/lit/an/scpa054/scp...
    [TIMESTAMPS]
    00:00 Introduction
    01:50 PCBWay
    02:33 I2C Basics
    07:19 Bus Capacitance
    11:15 Pull-Up Resistors
    18:29 Repeaters, Level Shifters, and Multiplexers
    21:06 Schematic Tips
    25:16 PCB Design Tips
    34:20 Outro
  • Наука та технологія

КОМЕНТАРІ • 103

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

    I just checked the latest schematic of a working PCB I made about a few weeks ago, I am using a BME280 with a ESP8266EX and I use a 12K pull up resistor on SCK and SDI. I did it to save on a BOM line because I was using 12K for the ESP8266EX's RES12K pin. Phil, I need to tell you this, I appreciate your videos, when you make videos you talk about things that actually matter. I thoroughly enjoy the videos you make, keep them coming.

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

      Good job on the BoM consolidation - I aim to do the same with my designs. Thank you very much for watching!

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

    This is perfect timing. I actuqally need to read about I2C for my current project. This gives me a great starting point.

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

      Glad to hear that, good luck with your project!

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

    I am planning to watch all 132 episodes.... cannot wait for more to come. learnt all my practical knowledge from you so far

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

    Great video about I2C Phil! Your explanations and examples really helped me. Thank you so much for your effort!

  • @ArifKhan-bp9zx
    @ArifKhan-bp9zx 2 місяці тому +2

    Can't wait for similar video for SPI bus interface. Great Work...

  • @TheOleHermit
    @TheOleHermit День тому

    Thanks, Pkil. I'm adding I2C to my Teensy Laser Synth to control lumia projector gizmos, but don't really know what I'm doing. Your videos are spot on 🎯 and have been valuable guidance throughout my entire dev process.

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

    Working with I2C on my current project, excited to get some quality information from you on it 😊

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

      Thanks, Milan - hope all goes well with your project!

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

    Keep it up Phil ;) Again, teaching the next generation more than any US college could hope to.

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

    Thank you Phil for doing this video I've had all of these questions and you answered every single one of them. I've been intimidated by doing a lot of i2c across multiple components and now I feel like I can experiment more without having to worry about a lot of things. Thank you for the wonderful references to authorities if I want to dive in. This was the perfect video. Can't thank you enough!

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

      Great to hear that this was helpful, Curt - thank you!

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

    Funny how I was reading about I2C just last night and the 3 videos you showed were the ones I watched. Good stuff, keep it up 👍

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

      Glad the timing was right, thank you!

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

    I have been using the TCA9517 I2C level-shifting bus repeater with success on my I2C projects. I'm doing some challenging things, connecting 16 LED drivers at a time on the same bus, sometimes over wires 50-100cm and with this chip, it works. With the level shifting I can power boards individually and not worry about mismatch, thanks to level shifting. They are only about $0.30 each, so I add them to all my boards. It also removes the problem of worrying about pull-up resistor values, as the segments in the I2C bus are isolated.

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

      Very cool, thanks for the tip, Jeremy - I'll check those out!

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

    Awesome video 📹 ❤ important advice is explained in an easy to understand manner while moving along at the perfect speed 🎉 that's hard to find honestly.

  • @AhmadAsmndr
    @AhmadAsmndr 21 день тому

    Thank you very much, like always very informative.

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

    "preferably read before bedtime", haha 😂. I think that's the first time I've heard a joke on one of your videos

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

      Haha yeah, thought I'd slip something like that on for once :D

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

    I am still waiting for a new USB 3.0-Hub with USB-C video from you that I would love to see. Not only for impedance matching questions but also if it includes power delivery, it gives me some headaches when it goes up to 20V. But for now, I enjoy this side deep dive into I2C. Always a joy listening to your guides.

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

    Phil, you rock the damn house and ALL of your vids are great. 🙂 Stay awesome!!

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

      Thank you, glad you think so! :)

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

    A BOM consolidation trick that I recently discovered: use 5.1k resistors as your i2c pull-ups. 5.1k is also common with USB-C CC lines to get a 5V supply, so you may already have them on your board.
    This is working for me on a 5V i2c bus with one device and relatively short traces, operating at 400kHz. I haven't actually measured the rise time, but I have looked at the signal on a scope and it seems to have a decent Vhi setup time... and since it's working I didn't dig into it too much. If it hadn't worked then I'd just fall back to 100kHz (faster is nice to have, but not critical in my application).

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

      That's exactly why I actually have the 5k1 pullups in these examples - I commonly have USB-C and I2C in the same design. For most cases 5k1 works quite well as a generic value anyway for I2C.

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

    Absolutely first class as always, Phil 👍🏻

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

      Thank you very much!

  • @hippie-io7225
    @hippie-io7225 2 місяці тому +1

    Excellent! Thank you!

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

      Thanks a lot!

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

    Great videos once again!!! :D
    Im work parttime in a startup doing the electronics and your videos help out so much to get good habits and know-how.
    Can you by any chance do a video how you structure electronics projects for large-scale operations like block diagrams, organization libraries, technical drawings, block diagrams, etc.
    Basically how to keep the electronics neat when working across professions?

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

      Thank you, Kristian! Very glad to hear that the videos have been helpful. Sounds like a great video idea as well, I'll add that to the list of topics - thanks!

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

    Thank you, again, for your great work

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

      Thanks for watching!

  • @user-lk5jq2qb6j
    @user-lk5jq2qb6j 2 місяці тому

    thank you phil!
    but I wish you to make an entire video for pcb project step by step
    I learned from you a lot

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

      Thank you! I have a few step-by-step videos on my channel - check out the KiCad 7 full tutorials, if you're interested.

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

    Hi, awesome tutorial. Can you please recommend layout tips for single layer (Fewer components like ina219 or similar i2c devices).

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

    Very good tutorial...cheers !

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

      Thank you, Andy!

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

    Fun coincidence. I used the same microcontroller, the STM32H723ZGT6 for my second ever PCB design!

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

      Pretty cool MCU!

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

    Great video... I have a question? Is it a bad idea to pour ground plan on the signal layer, witch will generate a ground line between SCL&SDA does it increase crosstalk or affect the C-bus in a negative way ?

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

      Thanks! As usual, it depends on the design. Pouring ground arbitrarily on signal layers can have a negative effect and actually increase crosstalk, as you mentioned. For these types of rise times and short traces, you should be okay. I'd advise to put in reasonable effort to clean-up the ground pours and use stitching as appropriate.

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

    great video Phil! thank you very much , one question , so the eeproms are used in that case to give the components with the same address a different address so to speak? right?

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

      No, he uses eeproms to store data and as an example.
      If you want to use components with the same address, you should use a multiplexer. He uses a 8-way one.
      A multiplexer is like a electronic 8-way rotary switch.
      The MCU/host only sees one component with that address, but gets 8 values after each other, from the (max 8) components.
      Phil stated that a multiplexer could also have a buffer, which is handy because you could miss important data when just receiving data from one of the other 7 components

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

    If your rise times are getting a bit marginal, possibly look at using a constant current source instead of a passive resistor. My feeling though, is that in general terrms, if you are getting towards the outside of the performance envelope, you should probably be looking at a different protocol. It can tend to be "when all you have is a hammer, everything looks like a nail" and all the workarounds (repeaters etc) can start getting expensive if you are designing a commercial product.

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

    Hi Phil, thank about this video, as always a lot to learn. I have a question, not about I2C (sorry if this is not the best place). Why to use STM as a uC? I know there are a lot of manufacturers with uC and SDK to programming, but I always don’t know witch to use for my hobby projects. In Work always Microchip, but is not my decision. So, my question is, witch one is the best? or why to use STM?

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

    Another thing to check is whether a device has internal pullup resistors. A lot of micros have configurable pullups.

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

      Many do, but they may not fall within the minimum and maximum pullup values that you calculate. Frequently they will be too large (resistance too high), so you may have to use an external pullup.

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

    Great video!! Does anyone know what is the setting for grouping nets with different colors while routing as shown for example in 31:55? It looks pretty cool and convenient

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

      Thanks! I assign net colours in the schematic, clicking on wires, and then in the properties panel choose the colour.
      To highlight constraints while routing you can hit Shift + R until you're in 'walkaround' mode.

  • @87Spectr
    @87Spectr 2 місяці тому

    thanks for video! can I use series resistors 22 Ohm in I2C? to improve emc a little? 5ns fall time for me looks very fast...

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

      I typically would do that if I'm going off-board, at the connector. Otherwise, you can also add low-value series resistors - start with 0 Ohm and populate with higher values if running into issues. You'll have to take a bit of care at which end(s) to place them.

    • @87Spectr
      @87Spectr 2 місяці тому

      @@PhilsLab thank you so much for answer! i hope you will make same video about spi, can... as for me - i can't understand why people use common mode choke in canh&canl - it's differential signal and i think modern can-transceiver enough good

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

    this is very helpul. i have a suggestion on a video u can do if u like it. rooting ethernet or a ddr memory buses, it would be very interesting

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

      That's actually part of the advanced digital hardware design course, but I may make a video on that here.

  • @user-vd7fh7uk1g
    @user-vd7fh7uk1g 2 місяці тому

    Great video! I am currently a sophomore and have watched many of your videos, including those on creating STM32 from scratch. They are really enlightening and helpful. I would like to know if your paid courses are still worth watching, or if these paid course videos have become free on your channel, because I currently want to systematically get started with PCB design.thank you!

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

      Thank you! The courses allow me to go far more in-depth into specific bits of subject matter and designs - I try to keep the content in the courses and YT vids separate.

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

    Phil - is there any way you’d share your slide theme? Is it a latex/beamer template?

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

    My current project used one master atmega2560 to communicate to 32 other atmega2560 mcus. The sda and scl line are reaching their limits. Approx 10m.
    Any recommendations? Go with CAN Bus?
    I want to be able to flash the slave mcu‘s from the master mcu. Can i achieve this through uart over can or similar?

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

      Not sure if the ATmega2560 supports CAN, as I'm not familiar with that part. If it does, then that definitely would be an option. Otherwise, you could look at RS485 (via UART + transceivers) if that supports your needs.

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

    Great explanation as always!
    I have a question: does anything change design-wise in multi-master configurations? I mean, with respect to pull-up resistor and capacity calculations. It's not a very common topology and I'm not sure about its usefulness, but AFAIK it is supported and well defined by the standard.
    Also, I just realized you avoided the "traditional" master-slave terminology, nice work, it did sound quite natural to me 😊. My two unsolicited cents on this: I'm not that happy that the consensus was that the word "master" carried a pernicious meaning (unlike "slave", of course).

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

      Thank you! To be honest, I've never needed/used a multi-master configuration before. With regards to pull-up resistors and capacitance calculations nothing much should change however.

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

    I would love to see a rtk gps dev board. neo-f9p or um982.

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

    I have really simple pcb (esp32 and one sensor) design ı have a problem can ı show to you

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

    Are there Standardized PCB buildups for cost effective production or are all PCB buildups custom made?

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

      There are

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

      Unless you have specific requirements, going with whatever build-up the board house you usually go with usually produces will be the most cost-effective. E.g. for PCBWay they have standard 'stack-ups' (www.pcbway.com/multi-layer-laminated-structure.html) - similarly, other fab houses will have their own.

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

    level shifter is not needed for i2c and 3.3V and 5V logic. Just connect pull-ups to the 3.3V. For 5V logic its ok. Its open drain, so HI level is defined by pullup.

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

      Depends. Some 5V devices have a logic high of 0.7*VCC=3.5V - always check the datasheet.

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

      @@PhilsLab yes, allways you should check a datasheet. But in most cases is HI 2V or 2.5V

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

    is spi have the same rule such as not to route with stubs

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

    How do you learn the EE theory for PCB design?

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

      The Art of Electronics is a great place to start.

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

      Altium Academy channel is also very good! www.youtube.com/@AltiumAcademy/playlists

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

    Why is it that when routing inc and pull-ups sda and scl always seem to be reversed from the much to the controllers

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

      Good question, sometimes happens with USB diff pairs as well.

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

    How to get in contact with you? I'd like guidance in a high amplification (around 6k) signal - low freq (Khz) - What is the best way for us to talk?

  • @kishor_VU2MZT
    @kishor_VU2MZT 26 днів тому

    hello dear nice video ,,, i m not from engg background but made one project with Arduino Uno qmc588l and 16x2 LCD for azimuth sensing , its all work perfect with short length jumpper wire ,, once i connected qmc588l with 15 meter long 1 sq mm thick wire lcd display not showing qmc599l readings , how to fix it ? ,, my project requirement is to sens azimuth from antenna position from long distance ,, thank you

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

    Respected Sir I so anxious to learn about PCB design and I have bit knowledge on it also built some basic stuff board for arduino nano to control leds. I like to be a professional in PCB designing but I'm confused how to start and work over with many components, pcb layers, various IC's and microcontrollers. So can you please suggest me how get into it and where to start sir ?

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

      I'd suggest checking out this video: ua-cam.com/video/aODkA2mrimQ/v-deo.html . Then, starting with my KiCad 7 full tutorial (STM32 Bluetooth).

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

      @@PhilsLab Thank you sir I'll sure follow it👍👍👍

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

    Regarding the 3H/3W rule, I see plenty of designs, including your designs with DDR memories, where only 1W spacing is used due to space contraints, how do you know how much of 1W spacing will be too much? Without simulating it seems impossible to know...

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

      Regarding crosstalk, if you have a specific noise margin, you can use a simple calculator (e.g. www.eeweb.com/tools/microstrip-2/ or Saturn PCB Toolkit) to see what the maximum parallel run length at (for example) 1W spacing would be to start giving you problems. You'll need to know the rise/fall times of aggressors, however.

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

    I am willing to learn pcb design but I don't know where can I start. Can you help me?

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

      I'd suggest checking out this video: ua-cam.com/video/aODkA2mrimQ/v-deo.html . Then, starting with my KiCad 7 full tutorial (STM32 Bluetooth).

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

      @@PhilsLab thanks a lot. Recently, I have started a project using stm32wb55xx mcu. But I don't know how to setup wifi to this mcu. Can you give me some advice?

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

      I imagine PhilsLab is always busy but the you tubes are full of ESP tutorials as it's a very popular platform. Thats my advice and I understand that you came here for Phil, but you will have to do with the bottom shelf cheap house branded Vodka tonight !@@RustamBazarbaev

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

    👍🙏❤️

  • @sachinkumar-eb9mt
    @sachinkumar-eb9mt 2 місяці тому

    I am also working on a project sir...will share and please please review it...its my dream come true to have my first board in hands.❤️

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

      I'm afraid I'm currently very busy with work, so cannot accept design reviews. If that changes, I'll make a post here on UA-cam :)

    • @sachinkumar-eb9mt
      @sachinkumar-eb9mt 2 місяці тому

      @@PhilsLab will wait for the post sir🙃❤️

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

    You should add "et cetera" to your arsenal.

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

    My manager said I need to attend meetings so to speak

  • @sachinkumar-eb9mt
    @sachinkumar-eb9mt 2 місяці тому

    Hi sir

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

    🤌

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

    It's so frustrating for me with the most popular PCB apps having changed so many times over the last 20 years. I'm definitely not current granted I've installed the most widely used and can design PCB's, I still need to learn those apps and there are some older ones that simply had much better GUI's.