What is I2C, Basics for Beginners

Sdílet
Vložit
  • čas přidán 22. 07. 2024
  • NEW! Buy my book, the best FPGA book for beginners: nandland.com/book-getting-sta...
    I2C is one of the most common interfaces to connect chips on a circuit card. From reading temperature sensors, to reading data from ADCs, to driving DACs, to passing information between two processors, I2C is a very common interface that has been around for decades.
    If you've never worked with I2C, it can be a bit overwhelming. But this short introduction will tell you everything you need to know to get you confident when working with your own I2C circuits. Learn about the data transmission protocol called I2C, or Inter-integrated circuit. I talk through the basics of I2C for both a microcontroller or FPGA implementation, how data is exchanged, and how the hardware is designed. If you like this video, please help me make more content by supporting me on Patreon.
    patreon.com/nandland
    And if you want to test FPGA code on your own, buy a Go Board, the best FPGA development board for beginners. It comes with lots of great tutorials.
    nandland.com/goboard/introduction.html
  • Věda a technologie

Komentáře • 119

  • @cjcjonesit
    @cjcjonesit Před 4 lety +11

    You do a great job explaining this concept on I2C. Thanks a million

  • @Blandified
    @Blandified Před 3 lety +15

    Such a great teacher that explains everything very clearly! Thanks for the vids

  • @adrianobuhov52
    @adrianobuhov52 Před 3 lety +23

    I've always thought that it is hard to understand how SPI works, after watching this video it is clear to me that things can be understood much more easier if they are explained in a fun way, just like this guy did, thank you!

    • @adrianobuhov52
      @adrianobuhov52 Před 3 lety +2

      This comment should've been posted under another video of yours, but still thank you

  • @robertlongoria765
    @robertlongoria765 Před 3 lety +10

    this is the i2c gold standard on youtube. thanks!

  • @plop55
    @plop55 Před 3 lety +18

    Nothing like a South Park reference in a video about I2C lol

  • @joecseszko7181
    @joecseszko7181 Před 3 lety +5

    Great video, and great southpark reference at 12:19

  • @dakotahrivers6640
    @dakotahrivers6640 Před 7 měsíci +3

    Final project for my final class for college before getting my degree is building a temperature sensor system with an Xmega board, a UART LCD display screen and a TWI compatible temp sensor. It is a two week project and i am starting it 2 days before last day of term. I got a job lined up pending graduation. Wish my luck, brethren. Hopefully next week i'll be an engineer.

  • @iangraham6730
    @iangraham6730 Před 2 lety +2

    Best explanation of I2C I have seen yet . . . thanks for sharing!

  • @dilectantetech8734
    @dilectantetech8734 Před 3 lety +3

    I think he need to give more detail on the protocol. This is an amazing explanation on I2c, specially on the roll of the the pullup resistors. In many tutorial I have seen nobody explain it, may be because they do not know it. Excellent tutorial!

  • @MdMaksudUlKabirRico
    @MdMaksudUlKabirRico Před 2 lety +1

    Thank you for this video. You explained it well. You are a great teacher. I am eagerly waiting for more videos regarding this topic. Wish you all the best.

  • @knguyen1801
    @knguyen1801 Před 3 lety

    Thank you. You do a great job simplifying a complicated concept.

  • @1sadcock
    @1sadcock Před rokem

    Great video on this topic! The best I have seen so far.

  • @palavos12
    @palavos12 Před 4 lety +45

    If it's possible, can you do a video about can bus ?

  • @MohanRaj-pp6zz
    @MohanRaj-pp6zz Před 2 lety

    You are very clear to the point. Thank you for the good explanation.

  • @natalieastafeva4885
    @natalieastafeva4885 Před 3 lety

    Your explanation is very clear,thank you!

  • @firstuser5448
    @firstuser5448 Před 2 lety

    incredible video - very concise and helpful. thanks!

  • @EgyGyro
    @EgyGyro Před 4 lety

    Nice introduction to the video 😊. Grabbed my attention.

  • @abutaymiyyahlectures
    @abutaymiyyahlectures Před 3 lety

    best i2c explanation on youtube, you are a beast, thank you :D

  • @billydeka0239
    @billydeka0239 Před 4 lety

    Explained in a very clear way thanks from italy

  • @selvalooks
    @selvalooks Před 2 lety

    Wonderful !!! clearly explained om understandable way.

  • @ScottCov
    @ScottCov Před měsícem

    Been trying to get a handle on this for a few days...This did it clearly. Thank you!

  • @nashs.4206
    @nashs.4206 Před 4 lety +20

    Great video! Would you also consider making a tutorial on the CAN bus? (As other commentators have pointed out!)

  • @Abh_92
    @Abh_92 Před 2 lety

    Thank you! Great explanation

  • @fernandosaenz1495
    @fernandosaenz1495 Před 4 lety

    Great explanation, thank you

  • @dinamohamed782
    @dinamohamed782 Před 4 lety

    Thank you ,very interesting explanation

  • @sleepy_izutsumi
    @sleepy_izutsumi Před 2 lety

    thank you very much! an awesome vid and awesome explanation =)

  • @maxwang2537
    @maxwang2537 Před 3 lety

    Great video, thanks!

  • @julles79
    @julles79 Před 4 lety

    Great explanation, please do one about I3C. Thanks!

  • @justinpower4475
    @justinpower4475 Před 2 lety

    Best explanation of pull up resistor I've seen...

  • @julianpitney7835
    @julianpitney7835 Před rokem

    Very clear and articulate. Thanks for the crash course. +1 for South Park reference

  • @nooterdooter6497
    @nooterdooter6497 Před rokem

    Golden! Great video!

  • @daysirc
    @daysirc Před 4 lety +1

    Great explanation :)

  • @ahmedmuhammed6905
    @ahmedmuhammed6905 Před 2 lety

    I like the way that you use to explain

  • @dans.8198
    @dans.8198 Před 3 lety +3

    Loved the South Park pun on Mr.Slave. The word “mister” was originally a different pronunciation of the word “master”. So Mr.Slave actually means “Master Slave” :-)

  • @jeff-73
    @jeff-73 Před 11 měsíci

    Good teacher.

  • @jamesmccoy8568
    @jamesmccoy8568 Před 3 lety +3

    Who else is ADDICTED to NANDLAND??

  • @Adhithya2003
    @Adhithya2003 Před 10 měsíci

    Excellent presentation ❤❤

  • @test-qm4ey
    @test-qm4ey Před 3 lety

    Great video!

  • @rambharat35
    @rambharat35 Před 3 lety

    nice explanation . helpful

  • @scalesr1
    @scalesr1 Před 5 měsíci

    Thank you for this - I'm trying to get my head around I2C for an enhancement to an existing project (sending data to a PIC) and I have no idea where to start!
    This is an excellent introduction - thank you.

  • @boo9oob
    @boo9oob Před 3 lety

    08:00 hahaah I know this feeling so well! :D wonderful video!

  • @funduk89
    @funduk89 Před rokem

    thanks, well presented

  • @vickysomkuwar6551
    @vickysomkuwar6551 Před 2 lety

    Nice information, love from India.

  • @michaeleliseev7304
    @michaeleliseev7304 Před 4 lety +1

    This helped me in my project in electronics

    • @drogenfeld
      @drogenfeld Před 4 lety

      I'm watching this literally the morning before an important exam to get some last minute details haha

  • @MuhammadShahzad-dx5je
    @MuhammadShahzad-dx5je Před 3 lety

    Thank you so much sir!

  • @AA7Productionz
    @AA7Productionz Před 3 lety

    Great videos, i have a doubt though. After pulling SDA low for ACK why does the line go through a clock pulse before sending the next data? Is it part of the I2C structure?

  • @psychomexicanscientists1076

    5:38 Good reference to Taxi Driver!

  • @tianshuma241
    @tianshuma241 Před 3 lety

    You explain this so easy and clear. Thank you ! And you are very handsome!

  • @trustmeimanengineer4081

    Your vidieo is so good for me! Thank you!
    Plz talk more about the timing.
    Star edge timing, ack timing, stop tim.... And reading frame.
    I have use i2c to make my project recently but there a problem, that 2 slave is not synchronous about timing or whatever idk how to say the detail.
    Both of them has 400kB bandwidth, but master cant talk with them on a same bus. I have to create new i2c IO in software and it seem to be waisted i2c's ability.

  • @vanik2428
    @vanik2428 Před 2 lety

    Hi I understood the way u explianed thank u. I have one question is there any chance I2C work for 5Mbps

  • @JeremyCook
    @JeremyCook Před 2 lety

    So would the 7 address bits + the R/W bit be considered the "header?" is that the correct term?
    So an 8-bit header, and 8-bit data section?

  • @futurelu623
    @futurelu623 Před 4 lety +1

    Hi, this video is very good! But maybe there is some thing missed in the data example. After the slave address is put on the bus by master, then the register address in the i2c slave device should be put on i2c bus, then the data should be put on the i2c bus by slave or master depending on read or write operation.
    What I mean is the register address in the i2c slave address is missed in your example.

  • @TheDudeeAbides
    @TheDudeeAbides Před 4 měsíci

    "Mr. Slave" 🤣🤣
    I could tell you were holding back the chuckles for that South Park reference lol

  • @zachreyhelmberger894
    @zachreyhelmberger894 Před 3 lety

    If I have a DHT22 connected to an esp8266, for example, how long of a cable can I use before the data becomes goofy? 22 gauge wires 5 mm apart from each other is about 0.1pF/cm, so 10 cm of wire would have 1pF of capacitance on the cable.

  • @hekto_pyc9998
    @hekto_pyc9998 Před 4 lety +2

    Спасибо)

  • @theoryandapplication7197

    thank you very much

  • @kirkkeinanen592
    @kirkkeinanen592 Před 2 lety

    Could a microcontroller i2c slave write to i2c eeprom? For example the attiny441 lists only an i2c slave interface.

  • @alejandrarosellperez6281
    @alejandrarosellperez6281 Před 4 lety +3

    damn you just saved me from a paaaaaainful exam tomorrowww

  • @vasista1997
    @vasista1997 Před 3 lety +7

    12:19 Mr Slave!! South Park reference

  • @kongyuebanshan6400
    @kongyuebanshan6400 Před 4 lety

    In general, I2C communication is the mutual communication between ICs and ICs on the board. If there is IC and IC communication between boards, what are the advantages and disadvantages? How stable is the communication?

    • @Nandland
      @Nandland  Před 4 lety

      Between boards have similar advantages and disadvantages. The comms should be OK unless there's a significant distance or lots of noise on the line. However it won't be as good as a differential signal interface.

  • @napsterjing5982
    @napsterjing5982 Před 2 lety

    When I'm thinking "oh man, I've definitely seen this guy somewhere." then Doug DeMuro posts new video.
    Oh

    • @Nandland
      @Nandland  Před 2 lety

      THIIIIIISSSSSS is the new XILINX ULTRASCALE FPGA.... :)

  • @peterbolke6846
    @peterbolke6846 Před 2 lety +3

    Hi Dejan, This is a great explanation of the concept of connecting I2C items on the same board. I am very new to doing anything at all with electronics but my current project uses the MPU6050 module and I want to add a distance measuring module into the project too + powering some servos with the PCA9685 that also uses the I2C protocol.
    I have the MPU6050 actuating 4 x servos at the moment on an Arduino Uno with regular breadboard and external power supply. The code seems to stop working after a few minutes and I am struggling to find a fault that would cause this.
    QUESTION:
    You show an Arduino Mega in your wiring diagram... is that because you anticipate the code will be a bit heavy for the Uno?
    I am wondering if limited Uno memory is the issue I have with the MPU6050 at the moment - and if I should consider using a Mega for this module as i want to add other I2C items..?

    • @AndrewKiethBoggs
      @AndrewKiethBoggs Před 9 měsíci

      For something like this application, uno would be fine. Mega is really used for things like IO needs. Maybe if you need a bunch of analog or digital pins, mega is good to use. Hope you got to explore electronics more!

  • @stevealemdar9052
    @stevealemdar9052 Před 4 lety

    keep it up pls

  • @raisagorbachov
    @raisagorbachov Před 2 lety

    Interesting. I'm looking to put a BMP280, GPS and accellerometer on a Pi Pico. I2C looks the most promising way of doing it. I just have to figure out how.

  • @davelopez9161
    @davelopez9161 Před 2 lety

    Distance. I did not hear you discuss how far this bus can be transmitted?

  • @benjaminwilson9007
    @benjaminwilson9007 Před rokem

    So with a Maximum of 400 Kilo-Bits per second, does that specification require a clock with a maximum frequency of 400,000 Hz or .4 MHz?

  • @shubhamnayak9369
    @shubhamnayak9369 Před 3 lety

    who sends the acknowledge bit when master reads the data?

  • @zetaconvex1987
    @zetaconvex1987 Před rokem

    How often are pull-up resistors actually used, though? And why not set your master pins to be open-drain with a pullup as an alternative?

    • @Nandland
      @Nandland  Před rokem

      The pull-up resistors are required. They're always used. You need something to pull the CLK and DATA lines up to 3.3V.

  • @rachidtahiri9514
    @rachidtahiri9514 Před 4 lety +2

    Thank you so much , please do a video about CAN bus

  • @nabilmarsel8792
    @nabilmarsel8792 Před 4 lety

    hello, in 2:20, we use ADC to digitalizing the data for the µC but the I²C use digital data, so why we need to digitalizing.

    • @futurelu623
      @futurelu623 Před 4 lety +1

      ADC is used to transfer some kind of analog signal, such as analog voltage, to digital format, then this kind of digital data can be transfered via I2C to micro comtroller. So that your code can recogonize it.

    • @nabilmarsel8792
      @nabilmarsel8792 Před 4 lety

      @@futurelu623 thank you.

  • @PaulineMiddelink
    @PaulineMiddelink Před 4 lety +6

    Hnm, i dont agree with the uncommonness of repeated start conditions, almost every register based i2c device uses it to not loose the bus between the initial write (what register do i want to address) and the next read for the data.

    • @Nandland
      @Nandland  Před 4 lety +2

      Thanks for pointing that out!

    • @kongyuebanshan6400
      @kongyuebanshan6400 Před 4 lety

      In general, I2C communication is the mutual communication between ICs and ICs on the board. If there is IC and IC communication between boards, what are the advantages and disadvantages? How stable is the communication?

  • @c_o_n_t_e_n_t3420
    @c_o_n_t_e_n_t3420 Před 3 lety +2

    how i2c handles "no true scottsman" problem with multiple masters, would probably make a good video.
    Its such a common logical problem that applies to everything from philosophy to multi-threading to hardware.
    I like that most of your videos are focus on the applied tech, in the weeds at 4am, how do i do this.
    giving an overview and getting down into the design choices and compromises that i2c makes to do multiple masters, I think would make a good vid.
    mr. slave agrees.

  • @aaronbarragan8339
    @aaronbarragan8339 Před 3 lety

    you explain very well despite my ver bad understanding on basic electric circuitrey. Do you happen to have any videos on that? c:

  • @asarangan
    @asarangan Před 3 lety

    Where is the next video on implementation?

  • @dereksavage8728
    @dereksavage8728 Před 2 lety

    i love you

  • @Roadtosucces.
    @Roadtosucces. Před 3 lety

    names of 2 pins????

  • @michaelcostello6991
    @michaelcostello6991 Před 4 lety

    I think we just addressed a slave here but not a register within a slave. I mean a slave can have multiple registers that you may want to write/read to.

  • @HL65536
    @HL65536 Před 2 lety +1

    Thanks for assuring me that my 3v3 device will not blow up if connected to 5V IO (pull up to 3v3).

  • @user-rx6jb6nj2e
    @user-rx6jb6nj2e Před 4 lety

    could you write the code step by step?

  • @curtisnewton895
    @curtisnewton895 Před 3 lety

    10:40 the data are valid when the clock is transitioning HIGH, not low

  • @mumblic
    @mumblic Před 2 lety

    Good video but it seems you forgot register address in your diagram.

  • @razahyder9796
    @razahyder9796 Před 3 lety

    when both lines are low then it is a read/write condition!

  • @seshagiritn7881
    @seshagiritn7881 Před 2 lety

    is it possible that two slaves can pull the bus low . i understand the Device address will target a particular device but inadvertently is it possible more than one slave can pull the bus low

  • @ZizoAhmed
    @ZizoAhmed Před 4 lety

    exit full screen ... hit like and subscribe and then return back to the explanation ♥

  • @ogito999
    @ogito999 Před 3 lety

    I remember making this in Minecraft once

  • @pcbworks
    @pcbworks Před 2 lety

    Mr.Slave :)

  • @bagussusilo2678
    @bagussusilo2678 Před 3 lety

    Mr slave and sir Master

  • @jeff-73
    @jeff-73 Před 11 měsíci

    The only thing that would make this video better is to speak in Mr Garrison's voice for the second half. lol

  • @dice4866
    @dice4866 Před 2 lety

    *cough, my drunk ass though he was Toby Maguire for a split second. Just share it.

  • @rvndom5744
    @rvndom5744 Před rokem

    you are a fucking god

  • @kumarm1780
    @kumarm1780 Před 2 lety

    Nice one also check the playlists: czcams.com/play/PLyp1I7W35-q1su6Nvbvd09mEgT-CWz0MD.html

  • @yadavsomnath6188
    @yadavsomnath6188 Před 3 lety +2

    Sir,
    I need CAN from you..
    I have subscribed your channel with notification...
    Please..please Do a video on CAN..with same manner as you used in this video...
    #ApriciateYourWork..
    #GreatVideo..

    • @yadavsomnath6188
      @yadavsomnath6188 Před 3 lety

      At one point I have stuck at your video that "where is register address?"...
      Please clear my doubt..

  • @sapientum8
    @sapientum8 Před 4 lety +1

    No, you are not mirrored.
    You are welcome.

  • @Oscar-jg9gg
    @Oscar-jg9gg Před 2 lety

    you defined half duplex wrong. half duplex is the fact that data transmission happens in one directed at a time per carrier

  • @karthikbiju3367
    @karthikbiju3367 Před 4 lety

    Ist comment

  • @johnrogers235
    @johnrogers235 Před 2 lety

    hahaha Mr Slave "jesus christ"

  • @RohitYadav-kv8vc
    @RohitYadav-kv8vc Před 2 lety

    Mr. slave🤭😅😅😅😅😅

  • @isabelserrato2248
    @isabelserrato2248 Před rokem

    great video, but would love it if you shifted away from master/slave terminology, main/secondary has the same initials and understanding without using insensitive language

  • @manjunathparemajilu9739

    Bro please dont give example as slave

  • @youssefosama1623
    @youssefosama1623 Před 2 lety

    terrible explanation