All my teachers in 5 years technical school of electronics was incapable of even acknowledge the fact that I get nothing out of it. My diploma was positive and now after 1010 years I finally understand anything what so ever. Thanks dude!
I was able to replicate this, and I sort of combined this with a shift register so that I get the whole 8 bit representation of what I'm sending to (and receiving from) the eeprom. I simply got the clock and data lines of the shift register and eeprom tied in parallel. I also used a soft-type button (like those on TV remotes) since it was a bit less noisy than the tactile buttons, those were giving me problems with de-bouncing. Again, thanks for making this tutorial! Keep those vids coming man
It is really awesome to watch your tutorials. I started off over 20 years ago, dreaming of building thing on my own, but never really got around to tinker as much. All those analogue components made my head spin, but now being 37 and have followed you for a long time and get the motivation I just recently passed my digital electronics classes and my life is so much more fun! Thanks for everything... Now back to my Arduino and future world-dominion ;)
Awesome video, I had a rough idea of how I2C worked, but this illustrated it perfectly! I didn't know there wasn't any real lower bound on speed. I might try to replicate your experiment for fun with other sensors (RTC, etc).
This video is very well done and very instructional, and even useful for those of us who are already familiar with I2C. Great tutorial, keep up the good work!
Friend, you are a genius! I had been looking for someone who was capable of doing this kind of experiment with EEPROM for three days. It turns out that this type of analysis helps to understand the bottom of everything. I was also designing this experiment but with a 555, but now that you made that clear, I thank God for your wisdom! This will be useful for future experiments, thank you friend!
Thanks man! No I can't bit bang a UART, like the TX/RX pins, because they have an agreed clock rate, so unless we can make that clock 1 bit per second, we won't be able to bang it
Really useful demonstration of how bus based communication works and of the protocol is used - very helpful! Thanks for sharing such interesting, low level stuff - not enough focus on this level of systems these days!
haha! man! bit banging the TLC5940? you're killing me! That is a lot of bit banging, especially since you need to clock that counter pin like 4096 times. But no I'm not a salaried educator, just a plain ole engineer... would be cool to make these tutorials full time!
Fantastically clear video, I'm using I2C on the Raspberry Pi so it does lots of it for you, but understanding how the bus works is really helpful. Also amazing to see you manually communicating with the chip like that! 👍👍
Great video, loved the demo. I really feel like I should try this out. The transistors for the leds I see why they were needed, but why did the buttons need to be on transistors? Why not just connect them to ground directly? And Hfe for the 2n3904 is 100~150 and the base current would be from 5 volts going through 110k ohms. (5/11000)*100 = 0.0045454. I sincerely doubt those leds needed current limiting resistors when the transistor was no where near saturated, You would have been lucky to get 5ma the according to your schematic. Unless I'm missing something.
amazing video. very informative. It would probably be pointless, but could be a fun challenge to have the bytes represented by an 8 switch dip package.
Thanks Kevin for another excellent video! I need to learn I2C for a future project. Just learning the Arduino / ATtiny now, so this will be after a few other projects. But what I have been looking for is a I2C in to parallel out chip, to use the out bits individually to control DIP relays. Found chips that will do that, except they want to initially see a MPU on those parallel lines to setup the address, where I want a hardwired address (maybe a DIP piano switch). Your videos are a lot of help!
ha, no! There's no sarcasm; it's a good question, and might be needed, especially if your inputs are toggled quickly. I answered your question while I was flying through my youtube inbox...
Great tutorial, breaks it down to the core and even explains the LED's in this setup, although I'd love to know how to be sure that those buttons don't bounce. Even for a newbie like me this was easy to follow, keep up the great work!
well i think in i2c data is actually transmitted when the clock drops low so isnt a problem for data line as it will be already stable in it's position for the transition of the clock line, my guess is that any voltages during brief contact of the switch does not register, not really sure.
You don't have to worry about the SDA (data) line, but the SCL (clock) line is a different story. If your clock is bouncing all over the place, you may run into trouble. It looks like he has a capacitor on the clock line.
yes you are EXACTLY right, i sense seeing this have constructed the very same type of circuit but for a lis3 nano accelerometer from stm. after building and actually communicating with the ic through i2c i see that it would be a very real problem with the clock line though i2c protocol limits to 400mhz so i wonder what would happen if it was faster than that the intermitent signal from the clock? i could post a video of my accelerometer circuit but it is very messy, my bread board is tiny and wiring is not neat but it works, i have read the "who am i" register and confirmed the replied byte with the data sheet, also i have read the lower portion of the 2 byte output register for all three axis to see if the accelerometer was working cause i had to reflow it to a break out board and it is an lga-16 so very small 3 x 3 mm and has 16 surface mount pads. if you would be interested in a video i could make one.
This is simply amazing. Thank you so much for the effort put into making this video. I mostly talk emotionally. I can see you struggled a little bit in heart for some reason. But it came out great, man. Good job! This will definitely help me in not using the nasty Arduino IDE for rendering on a display through the ATtiny13A (which I love)
Still with you till the bitter end. I love your whole manual control demonstration. It really visualizes the internal workings, as you did with the shiftreg vid too. How's the reflow oven progressing?
Kevin the video is so interesting especially (for me) about sniffing LED can you do tutorial about basic stuff with transistors resistors and capacitors? ie. why here is 10k resistor and what if we change to bigger or smaller, how to combine with transistor etc for me this tutorial was way to short :) love the way you explain everything and thank you so much for your videos
Great Video! You have done a great video in the past on the tlc5940 led driver. I was wondering if you could follow up on the tlc5940 video with a similiar bit-bang process much like you have done with this I2C video. If you are not currently a salaried educator....You Should be.
Wow, this might be the most practical and to the point explanation of the I²C communication that I've seen on TH-cam, and I've seen a lot! (most of them made by Hindus) BTW the clock line actually _can_ be controlled by the slave device, in a so-called "clock stretching" mechanism. When the receiver is busy and cannot accept our data at the current rate, it may pull the clock line low until it's ready to receive the data, and the master will notice that, because it's constantly reading the SCL line as well and checking if it follows the changes it applies to that line. If it sees that the line is already pulled down by someone else (the slave, in this case), it waits until it gets released and goes high again.
Really great Video. Thank you very much. Just one little Mistake seems to have it made into this Version. At 16:15 you key in the address for reading back the data and also say it the right way. But on the screen the notes show "111" instead of "000" for the second part of the address.
I just wanted to say thank you very much for this tutorial. And I was wondering if it would be possible to bitbang with serial? And if possible could you do a tutorial on that?
Nice tour, very good. I'll post a link on the Arduino forum and tell them to give you tumbs ups. You should at least get a few interested chip-heads and then when newbies ask about I2C maybe some references here.
Awesome tutorial! Thank you so much for taking the time to make that :) Just wanted to ask though, why are the transistors there in your circuit? Why couldn't you just have the push button to directly ground the SLL and SDA lines in the place of the transistor?
He needed to use the transistors in order to keep the signal 'normally high'. When he presses the switch it biases the transistor and allows the 5V signal to be pulled low. This makes it easier than keeping his finger pressed on the button to keep the light on, which would be the case if he connected the switch directly to the SDA and SCL lines. In the I2C standard, the signals should be left high when the bus is idle and waiting for a start condition from the SCL line. He shows the circuit at 23:11 (LINK: th-cam.com/video/8ZYMrcHm91s/w-d-xo.htmlm11s) in the video and explains their purpose.
Nicholas Stahl I have the same question. Initially I thought the transistors were to help with de-bouncing, but he says the caps help with that. I guess one way to find out is try and build it without the transistors.
One cap cannot do switch debouncing, you'll need a resistor and a cap to do that (an RC-network). That's why he needed the transistors on the input. Pulling low through a resistor could work, but it wouldn't be really low. It would be close to +0.5V if he used 1k pull-down (10k in series with a 1k).
You would not believe how confusing ack is to someone with a datasheet having never seen i2c before. Its simple. Bits go in, master check low from slave, if low, clock out the ack and continue. Thats the whole point, to ensure the slave is seeing proper data sequence.
All my teachers in 5 years technical school of electronics was incapable of even acknowledge the fact that I get nothing out of it. My diploma was positive and now after 1010 years I finally understand anything what so ever. Thanks dude!
Piotr Misiuna 10 years? did i solve your binary?
I was able to replicate this, and I sort of combined this with a shift register so that I get the whole 8 bit representation of what I'm sending to (and receiving from) the eeprom. I simply got the clock and data lines of the shift register and eeprom tied in parallel. I also used a soft-type button (like those on TV remotes) since it was a bit less noisy than the tactile buttons, those were giving me problems with de-bouncing.
Again, thanks for making this tutorial! Keep those vids coming man
It is really awesome to watch your tutorials. I started off over 20 years ago, dreaming of building thing on my own, but never really got around to tinker as much. All those analogue components made my head spin, but now being 37 and have followed you for a long time and get the motivation I just recently passed my digital electronics classes and my life is so much more fun! Thanks for everything... Now back to my Arduino and future world-dominion ;)
Awesome video, I had a rough idea of how I2C worked, but this illustrated it perfectly! I didn't know there wasn't any real lower bound on speed. I might try to replicate your experiment for fun with other sensors (RTC, etc).
With this very basic hardware setup you manage the best to explain the function of this bus. You are a very good instructor.
now that I think about it, you should be able to use the switches on their own. good point!
This video is very well done and very instructional, and even useful for those of us who are already familiar with I2C. Great tutorial, keep up the good work!
Excellent, now everything, what i was mechanically doing without knowing whats happening in background, now makes sense.
Friend, you are a genius! I had been looking for someone who was capable of doing this kind of experiment with EEPROM for three days. It turns out that this type of analysis helps to understand the bottom of everything. I was also designing this experiment but with a 555, but now that you made that clear, I thank God for your wisdom! This will be useful for future experiments, thank you friend!
i2c is amazingly simple, it's such a convenience in most cases. Thanks for this awesome video!
Fantastic information and example. This should be the first video for anyone learning I2C/TWI.
yep, that can be done... trying to see if I have any SPI devices though? Shift registers are SPI, I have a video doing this on those
yea, for sure, glad you still liked it!
Thanks man! No I can't bit bang a UART, like the TX/RX pins, because they have an agreed clock rate, so unless we can make that clock 1 bit per second, we won't be able to bang it
Really useful demonstration of how bus based communication works and of the protocol is used - very helpful! Thanks for sharing such interesting, low level stuff - not enough focus on this level of systems these days!
I'm currently working on a mpu-6050, your video is very helpful in understanding i2c.
haha! man! bit banging the TLC5940? you're killing me! That is a lot of bit banging, especially since you need to clock that counter pin like 4096 times. But no I'm not a salaried educator, just a plain ole engineer... would be cool to make these tutorials full time!
Never seen a video with this level of detail
Fantastically clear video, I'm using I2C on the Raspberry Pi so it does lots of it for you, but understanding how the bus works is really helpful. Also amazing to see you manually communicating with the chip like that! 👍👍
Great video, loved the demo. I really feel like I should try this out.
The transistors for the leds I see why they were needed, but why did the buttons need to be on transistors? Why not just connect them to ground directly? And Hfe for the 2n3904 is 100~150 and the base current would be from 5 volts going through 110k ohms. (5/11000)*100 = 0.0045454. I sincerely doubt those leds needed current limiting resistors when the transistor was no where near saturated, You would have been lucky to get 5ma the according to your schematic. Unless I'm missing something.
I hope you keep giving us these tutorials as well explained, thank you very much for each video, greetings from chile
Kevin ,Although I2C user for sensors & EEPROMS This is excellent basics demo...Keep it diong
Hats Off to you Kevin :)
Wow it was fascinating and very helpful. Im currently bit banging i2c for AVR and this video was blessing for me. Thanks!
amazing video. very informative. It would probably be pointless, but could be a fun challenge to have the bytes represented by an 8 switch dip package.
Thanks Kevin for another excellent video! I need to learn I2C for a future project. Just learning the Arduino / ATtiny now, so this will be after a few other projects. But what I have been looking for is a I2C in to parallel out chip, to use the out bits individually to control DIP relays. Found chips that will do that, except they want to initially see a MPU on those parallel lines to setup the address, where I want a hardwired address (maybe a DIP piano switch). Your videos are a lot of help!
This was really well done. Good Job
Thank you. Good explainations on I²C and whole pull-up stuff
For us coders who love mcu's and internals, this video has to be one of the best :)
cool, glad my videos helped... kind makes it all worth it for me!
Another great video. Thank you for tackling one of the concepts I shuddered to try and understand. Keep up the great work!
You have done an excellent job with this video!
yea, man glad you liked!
ha, no! There's no sarcasm; it's a good question, and might be needed, especially if your inputs are toggled quickly. I answered your question while I was flying through my youtube inbox...
very cool video. Used EEPROMs before, but never understood the protocol.
Great tutorial, breaks it down to the core and even explains the LED's in this setup, although I'd love to know how to be sure that those buttons don't bounce. Even for a newbie like me this was easy to follow, keep up the great work!
well i think in i2c data is actually transmitted when the clock drops low so isnt a problem for data line as it will be already stable in it's position for the transition of the clock line, my guess is that any voltages during brief contact of the switch does not register, not really sure.
You don't have to worry about the SDA (data) line, but the SCL (clock) line is a different story. If your clock is bouncing all over the place, you may run into trouble. It looks like he has a capacitor on the clock line.
yes you are EXACTLY right, i sense seeing this have constructed the very same type of circuit but for a lis3 nano accelerometer from stm. after building and actually communicating with the ic through i2c i see that it would be a very real problem with the clock line though i2c protocol limits to 400mhz so i wonder what would happen if it was faster than that the intermitent signal from the clock? i could post a video of my accelerometer circuit but it is very messy, my bread board is tiny and wiring is not neat but it works, i have read the "who am i" register and confirmed the replied byte with the data sheet, also i have read the lower portion of the 2 byte output register for all three axis to see if the accelerometer was working cause i had to reflow it to a break out board and it is an lga-16 so very small 3 x 3 mm and has 16 surface mount pads. if you would be interested in a video i could make one.
yea, I was scared as well! My DS1307 RTC sat in my bin for a long time before I attempted I2C
This is simply amazing. Thank you so much for the effort put into making this video. I mostly talk emotionally. I can see you struggled a little bit in heart for some reason. But it came out great, man. Good job!
This will definitely help me in not using the nasty Arduino IDE for rendering on a display through the ATtiny13A (which I love)
A very good insight in to IIC working
amazingly helpful video, thank you so much! I look forward to trying it.
I keep running into your videos and just had to subscribe. You do such an amazing job of making things clear. Thanks so much!
Still with you till the bitter end. I love your whole manual control demonstration. It really visualizes the internal workings, as you did with the shiftreg vid too.
How's the reflow oven progressing?
Kevin the video is so interesting
especially (for me) about sniffing LED
can you do tutorial about basic stuff with transistors resistors and capacitors? ie. why here is 10k resistor and what if we change to bigger or smaller, how to combine with transistor etc
for me this tutorial was way to short :) love the way you explain everything
and thank you so much for your videos
Great video. I watched it when I was first learning to code I2C routines in software.
Excellent work! Thanks! It was not boring at all.
good stuff brother, not as boring/painful as you might think. thank you
Excellent video! It was very clear explained and demonstrated. I've really enjoyed watching it.
Great Video!
You have done a great video in the past on the tlc5940 led driver.
I was wondering if you could follow up on the tlc5940 video with a similiar bit-bang
process much like you have done with this I2C video.
If you are not currently a salaried educator....You Should be.
That was really great, thanks! Not bored.
cool, glad you got something out of this
they say what goes around comes around i hope you get repaid for all the good stuff you are doing best wishes
I just wanted to say thank you very much for this tutorial.
very clear, informative and educational~
will try to replicate this myself.
Thank you.
Excellent video and GREAT idea!
Wow, this might be the most practical and to the point explanation of the I²C communication that I've seen on TH-cam, and I've seen a lot! (most of them made by Hindus)
BTW the clock line actually _can_ be controlled by the slave device, in a so-called "clock stretching" mechanism. When the receiver is busy and cannot accept our data at the current rate, it may pull the clock line low until it's ready to receive the data, and the master will notice that, because it's constantly reading the SCL line as well and checking if it follows the changes it applies to that line. If it sees that the line is already pulled down by someone else (the slave, in this case), it waits until it gets released and goes high again.
How did this work out without debouncing the clock button?
Really great Video. Thank you very much.
Just one little Mistake seems to have it made into this Version. At 16:15 you key in the address for reading back the data and also say it the right way. But on the screen the notes show "111" instead of "000" for the second part of the address.
Beautifully explained. Thankyou so much.
awesome vid mate. i m not new to i2c yet i found this quite educating. Keep Up.
I just wanted to say thank you very much for this tutorial. And I was wondering if it would be possible to bitbang with serial? And if possible could you do a tutorial on that?
cool! let me know how it works!
Awesome!
What about a button controlled serial communication?
Kevin, great video. could you please do one going over the hardware in SPI, and USART??
???? PLEASE!
Thanks!
Excellent!! - just confused why Bounce isn't an issue?
yea cool, hopefully this video helps you with your project
hey kevin nice work nailed the i2c explanation i have only 1 doubt what is delay for start and stop...? and what is speed...?
cool! I am always happy to hear that my videos are reproducible.
Cool! You just answered a previously unanswered questions of mine :)
ha, yea, I probably could have shortened up some of the rambling
Ouah! Lots of info for a Sunday morning! Gratz My friend it all made sense very well explain! Cheers!
nice!! yep, you're right, fixed with an annotation Thanks!
yea, that would be cool
thanks!
Awesome video - I think it would have been a bit easier to understand with a logic analyzer type graphic to explain it - but still - very interesting!
I once had to bitbang Z80 buses/clock by hand the same way, trying to check some peripherals are working =)
Another great explanation, just like the shift registers! Thank you heaps man!
oh boy! Having to do this in real life sounds very scary!
can we get a parts list in the description?
That is so awesome! DE-MYSTIFY! Thanks for these videos!
Nice tour, very good. I'll post a link on the Arduino forum and tell them to give you tumbs ups. You should at least get a few interested chip-heads and then when newbies ask about I2C maybe some references here.
Cool, why is it necessary to use transistors on The buttons?
Amazing explanation! Subbed
Excellent work man..!!
really explained well the I2C protocol..Kudos.. ^^,
Awesome tutorial! Thank you so much for taking the time to make that :) Just wanted to ask though, why are the transistors there in your circuit? Why couldn't you just have the push button to directly ground the SLL and SDA lines in the place of the transistor?
He needed to use the transistors in order to keep the signal 'normally high'. When he presses the switch it biases the transistor and allows the 5V signal to be pulled low. This makes it easier than keeping his finger pressed on the button to keep the light on, which would be the case if he connected the switch directly to the SDA and SCL lines.
In the I2C standard, the signals should be left high when the bus is idle and waiting for a start condition from the SCL line. He shows the circuit at 23:11 (LINK: th-cam.com/video/8ZYMrcHm91s/w-d-xo.htmlm11s) in the video and explains their purpose.
Pete D'Amico But if the switch was connect to ground, it would have the same function, wouldn't it?
Nicholas Stahl I have the same question. Initially I thought the transistors were to help with de-bouncing, but he says the caps help with that. I guess one way to find out is try and build it without the transistors.
One cap cannot do switch debouncing, you'll need a resistor and a cap to do that (an RC-network). That's why he needed the transistors on the input. Pulling low through a resistor could work, but it wouldn't be really low. It would be close to +0.5V if he used 1k pull-down (10k in series with a 1k).
13:15 nuh-uh! What about the random read? Takes a write signal and a read signal but im sure ur eeprom does that?
Great job..im a newbie and i understand it... its not magic, its speed how everything works
@BvPhusa That's also my question, else you would get uncontrolled highs right?
thank you!
Can you do this with SPI? It would be really great... :)
cool, glad the vid helped
cool! appreciate that
Excellent Project for those who saw serial memory as mystical chips. (Sorry it took me 10 years to see this video)
Oh ok. Thanks for the response man.
I tried but i failed can you give me some instructions
I was about to perform such experiment ages ago when I didnt have a compter :D
finally, after dozen of years somebody made it :D
Can You do that for a UNI/O EEPROM with Manchester Encoding?
You would not believe how confusing ack is to someone with a datasheet having never seen i2c before. Its simple. Bits go in, master check low from slave, if low, clock out the ack and continue. Thats the whole point, to ensure the slave is seeing proper data sequence.
Hey Kevin! Thanks for making this one :D
Could you do SPI?