Networking and Communications

I do it with the help of Saverio'page and his guide

I use my finialboard and hello board to run it with I2C.

I2C

Inter-integrated Circuit (I²C or I2C or IIC) is a protocol which is used to communicate between in several board. So that several boards can control hardware together. Normally ,there are two kinds of board: master and slave.This bus is intended for short distance communications, and it only requires two wires to exchange information.

The two wires, or lines are called Serial Clock (or SCL) and Serial Data (or SDA). The SCL line is the clock signal which synchronize the data transfer between the devices on the I2C bus and it’s generated by the master device. The other line is the SDA line which carries the data. The two lines are “open-drain” which means that pull up resistors needs to be attached to them so that the lines are high because the devices on the I2C bus are active low. Commonly used values for the resistors are from 2K for higher speeds at about 400 kbps, to 10K for lower speed at about 100 kbps.

More detail in the following link and this link

In addition, The protocol (I2C)was invented in 1982 by Philips, but since October 10, 2006, no licensing fees are required to implement the I²C protocol.

Hardware connection

My aim is to communicate between my two boards(hello board and finial board). If I click button in hello board, they will send data from 0. If not click the button, the board will send data one by one again. I connect them as following

Code

Then I update the code as the following for master and salve

Test

Attachment

code

results matching ""

    No results matching ""