
Mobile Robots – Current Trends
208
Fig. 26. Start and stop condition of two lines
This condition is a HIGH to LOW transition on the SDA line while SCL is HIGH. And the
I2C_STOP ( ) will produce the STOP condition. This procedure is a LOW to HIGH transition
on the SDA line while SCL is HIGH. Before the START condition will begin and after STOP
condition finished, the bus is considered to be always free condition, the both lines must be
HIGH. The next main function is I2C_ACK ( ). As shown in Fig.27, after the robot (master
device) sent data to slave device finished, the slave device must send back the
acknowledgement that the slave device received data already.
Fig. 27. Acknowledge condition
As shown in Fig.28, it shows a complete transfer cycle associated with a frame of data.
Firstly, the master initiates a write by asserting logic-0 at bit-8, where a slave address is
defined by the other 7-bits.
A acknowledge signal then follows from the slave as specified in
bit-9. The second and third bytes are the data and acknowledge signal. The 7-bits addressing
allows 127 devices on the I
2
C bus, by using 2-bytes address, which can be extended further.
The last two main functions are to control and get data from slave device. It consists of
I2C_SEND ( ) and I2C_RECEIVE ( ) function. This I2C_SEND ( ) function is sent always by
robot (master device) to control and set slave devices configuration and the I2C_RECEIVE ( )
function is also sent by robot to receive data from slave devices.
Fig. 28. Data transfer on the I
2
C bus
www.intechopen.com
Comentarios a estos manuales