After studying about communication with data or controlling output devices through
Why do you have to use this system? Because there will be communication between IC and Module that can order or communicate in many and a long distance that have receiver and sender, the main module or Master to control all working in the system. For another module that is Slave will be controlled. The working of couple modules in this system, will be controlled by 2 signal lines, they have data line and signal line clock in order to use in setting rhythm of working. For taking devices or modules to connect in this system, it can be done by taking module to parallel, will use pressure level of electrical resource in each module will not be equal.
However, there will be Resistor as Pull Up at electrical resource for module and I recommend that you should put resistor at data signal and signal line clock in order to protect affecting by spasms that is mixed with electricity of module Resistor. Resistor as Pull is about 1kOhms. Let’s see the picture below.

Picture 1 module connection in communication as I2C
Well, how does it know each module that connects in parallel? In each module will have Address in different position that use code in setting status of Logic at legs of address signal of each module. Also, there will be an agreement between modules on pathway of connection as I2C, maybe use Protocol. Signal of I2C system will be divided into 2 lines,
1. SDA (Serial data Line)
2. SCL (Serial Clock Line)
Next, I want to show you a table of IC that is used in I2C Bus system.
Table 1 The type of IC that is used in I2C Bus system.
|
The type of IC |
The example of number |
The example of number |
The example of number |
For circuit that is used in changing signal from

Picture 2 the form of circuit that change
Programming for connection to control signal with I2C Bus
Start to program in order to connect through I2C that. Let’s see above circuit, you will see that there is signal that is connected from
Table 2 The command of programming to control signal on I2C Bus system.
|
|
I2C Bus |
|
DTR is logic 1 |
SCL is logic 1 |
|
MS Comm.DTREnable=True |
|
|
DTR is logic 0 |
SCL is logic 0 |
|
MS Comm.DTREnable=False |
|
|
RTS is logic 1 |
SDA is logic 1 |
|
MS Comm.RTSEnable=True |
|
|
RTS is logic 0 |
SDA is logic ก 0 |
|
MS Comm.RTSEnable=False |
|
For programming to verify signal line of DCD, we will use Properties named CDHolding of controller MS Comm 6 that will give the status as False and True. We may use condition to verify that is logic “0″ or “1″, for example,
If MSComm.CDHolding = True Then
Debug.Print “logic 1″
Else
Debug.Print ” logic 0″
End If
Table 2 the protocol of controller and verify status of I2C Bus system.
|
The status of system |
signal SDA(Data) |
signal SCL(Clock) |
|
Start signal |
Logic changed from 1–>0 |
Logic changed from 1–>0 |
|
Stop signal |
Logic changed from 0–>1 |
1 |
|
Send logic information“0″ |
0 |
Logic changed from 1–>0 |
|
Send logic information “1″ |
1 |
Logic changed from 1–>0 |
|
Feedback information |
1 |
Logic changed from 1–>0 |
|
Working (Busy) |
1 |
1 |
From seeing the table, you see 3 columns, the status of system; SDA signal and SCL signal that the writer concludes the step of communication in I2C bus system. You will notice that in each line at columns named “SDA signal”, and “SCL signal” are writed that “Logic changed from 1–>
For examples,
1) Start signal = SDA signal “Logic changed from 1–>0″ and SCL signal “Logic changed from 0–>1″
Sub Start_I2C()
MS Comm.RTSEnable=True ‘ SDA signal , logic as 1
MS Comm.DTREnable=True ‘ SCL signal, logic as 1
MS Comm.RTSEnable=False ‘ SDA signal , logic as 0
MS Comm.DTREnable=False ‘ SCL signal, logic as 0
End Sub
2) Stop signal = SDA signal ” Logic changed from 0–>1″ and SCL signal ” Logic changed from 1″
Sub Finish_I2C()
MS Comm.RTSEnable=False ‘ SDA signal , logic as 0
MS Comm.DTREnable=True ‘ SCL signal, logic as 1
MS Comm.RTSEnable=True ‘ SDA signal , logic as 1
End Sub
3) Send logic information“0″= SDA signal ” Logic changed from 0″ and SCL signal ” Logic changed from 1–>0″
Sub Out0_I2C()
MS Comm.RTSEnable=False ‘ SDA signal , logic as 0
MS Comm.DTREnable=True ‘ SCL signal, logic as 1
MS Comm.DTREnable=False ‘ SDA signal , logic as 0
End Sub
4) Send logic information “1″= SDA signal ” Logic changed from 1″ and SCL signal ” Logic changed from 1–>0″
Sub Out1_I2C()
MS Comm.RTSEnable=True ‘ SDA signal , logic as 1
MS Comm.DTREnable=True ‘ SCL signal, logic as 1
MS Comm.DTREnable=False ‘ SCL signal, logic as 0
End Sub
Finally, I hope you understand about this. You must have knowledge about hardware or I2C Bus system. If you will program like this, you must know values of computer system that hardware has so that software can communicate. Importantly, you should know the fundamental of Visual Basic programming communicated with
The content I mention, I just conclude how to program to communicate on I2C Bus system. For more information, you can search from internet.