Thursday, September 10, 2015

I2C protocol visualization with Nusbio

I wanted to show you this breadboard experiment, inspired by the Arduino on board led
and also the blogpost Arduino from scratch part 6 – pin 13 led by Rheingoldheavy.com


2 weeks ago I was trying to connect LEDs to each nusbio gpio in parallel to create an on board led feature. And it does not work well and there are side effects, like i2c stop working completely.

So I gave up. But then I heard about the blog post and I just try with an lm358 op-amp and it is working.

Now I am can create my 8 blue on board LEDs PCB. Each LED will light up when the associated gpio is on. It also work when the gpio is open as input in pull up mode.
obviously I will need 8 op-amp.

In the future I will add the 8 blue LEDs and op-amps directly on Nusbio board.
That was one of my idea since day 1.

In this video I plugged an Adafruit i2c 8x8 led matrix into my device Nusbio.
Gpio 0 for the clock and gpio 1 for the data.

I connnected the blue led to gpio 0 via one op-amp and gpio 1 to the red led via the other op-amp (an lm358 is dual op-amp).

I also reduce the speed of the clock to lowest i could which is 1200 baud.


In this video we see the blue and red led flickering. what does it mean?

Well when the blue led is on (the clock) and the red led (the data) is on we are transmetting a 1 from the master to the slave or from the salve to the master and when the red is off we are transmitting a 0.

The red led flickering is the 1 and 0 being sent across the wire. The blue led is the clock, so it just go on/off, on/off  is barely visible.

I thought it was cool way to visualized what is going on on an i2c bus, though it is not very precised.

Thanks.

No comments:

Post a Comment