I2C Hardware & PCB Design - Phil's Lab

  Рет қаралды 34,116

Phil’s Lab

Phil’s Lab

Күн бұрын

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

Пікірлер: 102
@BHSAHFAD
@BHSAHFAD 2 ай бұрын
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 ай бұрын
Good job on the BoM consolidation - I aim to do the same with my designs. Thank you very much for watching!
@LiviuGelea
@LiviuGelea 2 ай бұрын
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 ай бұрын
Glad to hear that, good luck with your project!
@konturgestalter
@konturgestalter 2 ай бұрын
I am planning to watch all 132 episodes.... cannot wait for more to come. learnt all my practical knowledge from you so far
@JeremySeitz
@JeremySeitz 2 ай бұрын
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 ай бұрын
Very cool, thanks for the tip, Jeremy - I'll check those out!
@kiprof4350
@kiprof4350 2 ай бұрын
Great video about I2C Phil! Your explanations and examples really helped me. Thank you so much for your effort!
@ArifKhan-bp9zx
@ArifKhan-bp9zx 2 ай бұрын
Can't wait for similar video for SPI bus interface. Great Work...
@scottduckworth3299
@scottduckworth3299 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 ай бұрын
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.
@Fight2Survive559
@Fight2Survive559 2 ай бұрын
Keep it up Phil ;) Again, teaching the next generation more than any US college could hope to.
@PhilsLab
@PhilsLab 2 ай бұрын
Thank you! :)
@case_sensitive
@case_sensitive 2 ай бұрын
"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 ай бұрын
Haha yeah, thought I'd slip something like that on for once :D
@milanvdzanden
@milanvdzanden 2 ай бұрын
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!
@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.
@curtkeisler7623
@curtkeisler7623 2 ай бұрын
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 ай бұрын
Great to hear that this was helpful, Curt - thank you!
@highchiller
@highchiller Ай бұрын
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.
@AhmadAsmndr
@AhmadAsmndr 11 күн бұрын
Thank you very much, like always very informative.
@rraheem_p
@rraheem_p 2 ай бұрын
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!
@andrewlloydwebber2616
@andrewlloydwebber2616 2 ай бұрын
Absolutely first class as always, Phil 👍🏻
@PhilsLab
@PhilsLab 2 ай бұрын
Thank you very much!
@jdarnell123
@jdarnell123 2 ай бұрын
Phil, you rock the damn house and ALL of your vids are great. 🙂 Stay awesome!!
@PhilsLab
@PhilsLab 2 ай бұрын
Thank you, glad you think so! :)
@kristianvk3159
@kristianvk3159 2 ай бұрын
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!
@hippie-io7225
@hippie-io7225 2 ай бұрын
Excellent! Thank you!
@PhilsLab
@PhilsLab 2 ай бұрын
Thanks a lot!
@xxWender98xx
@xxWender98xx 2 ай бұрын
Thank you, again, for your great work
@PhilsLab
@PhilsLab 2 ай бұрын
Thanks for watching!
@andymouse
@andymouse 2 ай бұрын
Very good tutorial...cheers !
@PhilsLab
@PhilsLab 2 ай бұрын
Thank you, Andy!
@vishnu7794
@vishnu7794 2 ай бұрын
Hi, awesome tutorial. Can you please recommend layout tips for single layer (Fewer components like ina219 or similar i2c devices).
@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 ай бұрын
Thank you! I have a few step-by-step videos on my channel - check out the KiCad 7 full tutorials, if you're interested.
@ashchap
@ashchap 2 ай бұрын
Another thing to check is whether a device has internal pullup resistors. A lot of micros have configurable pullups.
@somejoe7777
@somejoe7777 2 ай бұрын
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.
@epicdaniel508
@epicdaniel508 2 ай бұрын
Fun coincidence. I used the same microcontroller, the STM32H723ZGT6 for my second ever PCB design!
@PhilsLab
@PhilsLab 2 ай бұрын
Pretty cool MCU!
@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.
@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 Ай бұрын
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
@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 ай бұрын
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.
@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 ай бұрын
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.
@dwagner6
@dwagner6 Ай бұрын
Phil - is there any way you’d share your slide theme? Is it a latex/beamer template?
@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?
@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 ай бұрын
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.
@csezoli25
@csezoli25 2 ай бұрын
I would love to see a rtk gps dev board. neo-f9p or um982.
@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.
@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?
@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 ай бұрын
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 ай бұрын
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
@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 ай бұрын
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.
@thetechegg8859
@thetechegg8859 2 ай бұрын
How do you learn the EE theory for PCB design?
@PhilsLab
@PhilsLab 2 ай бұрын
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
@ahmadamiruddin637
@ahmadamiruddin637 2 ай бұрын
is spi have the same rule such as not to route with stubs
@PhilsLab
@PhilsLab 2 ай бұрын
Yep!
@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.
@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.
@therecon448
@therecon448 2 ай бұрын
I have really simple pcb (esp32 and one sensor) design ı have a problem can ı show to you
@therecon448
@therecon448 2 ай бұрын
I can pay you.
@martincerny3294
@martincerny3294 2 ай бұрын
lol
@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 ай бұрын
I'd suggest checking out this video: kzbin.info/www/bejne/l4CnnHRooteco7M . Then, starting with my KiCad 7 full tutorial (STM32 Bluetooth).
@warengine0341
@warengine0341 2 ай бұрын
@@PhilsLab Thank you sir I'll sure follow it👍👍👍
@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 ай бұрын
I'd suggest checking out this video: kzbin.info/www/bejne/l4CnnHRooteco7M . Then, starting with my KiCad 7 full tutorial (STM32 Bluetooth).
@RustamBazarbaev
@RustamBazarbaev 2 ай бұрын
@@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
@kishor_VU2MZT
@kishor_VU2MZT 16 күн бұрын
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
@tamaseduard5145
@tamaseduard5145 2 ай бұрын
👍🙏❤️
@frankbauerful
@frankbauerful 2 ай бұрын
You should add "et cetera" to your arsenal.
@PhilsLab
@PhilsLab 2 ай бұрын
I should 😅
@sachinkumar-eb9mt
@sachinkumar-eb9mt 2 ай бұрын
Hi sir
@PhilsLab
@PhilsLab 2 ай бұрын
Hello :)
@TheVideoVolcano
@TheVideoVolcano 2 ай бұрын
My manager said I need to attend meetings so to speak
@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 KZbin :)
@sachinkumar-eb9mt
@sachinkumar-eb9mt 2 ай бұрын
@@PhilsLab will wait for the post sir🙃❤️
@dfgaJK
@dfgaJK 2 ай бұрын
🤌
@JonDeth
@JonDeth 2 ай бұрын
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.
BGA PCB Design Tips - Phil's Lab #95
28:21
Phil’s Lab
Рет қаралды 32 М.
SPI Hardware & PCB Design - Phil's Lab #134
33:22
Phil’s Lab
Рет қаралды 21 М.
Which one will take more 😉
00:27
Polar
Рет қаралды 62 МЛН
Surprise Gifts #couplegoals
00:21
Jay & Sharon
Рет қаралды 26 МЛН
ФОКУС С ЧИПСАМИ (секрет)
00:44
Masomka
Рет қаралды 4,3 МЛН
How to Select the Best STM32 Microcontroller for Your Project
21:37
Predictable Designs
Рет қаралды 2,6 М.
Aesthetic PCB Design Tips - Phil's Lab #84
17:56
Phil’s Lab
Рет қаралды 69 М.
Understanding I2C
10:58
Rohde Schwarz
Рет қаралды 51 М.
I2C introduction: The protocol
15:47
Texas Instruments
Рет қаралды 38 М.
FPGA/SoC Board Bring-Up Tutorial (Zynq Part 1) - Phil's Lab #96
30:15
PCB Design Final Touches (Tips & Checklist) - Phil's Lab #131
38:17
Распаковка айфона под водой!💦(🎥: @saken_kagarov on IG)
0:20
Взрывная История
Рет қаралды 11 МЛН
Airpods’un Gizli Özelliği mi var?
0:14
Safak Novruz
Рет қаралды 292 М.
Samsung mobile phone waterproof display. samsung mobile phone digital s23ultra  #shorts
0:15
Vortex Cannon vs Drone
20:44
Mark Rober
Рет қаралды 13 МЛН