one, single Bus Protocol (1-wire)
1. Definition: The host and slave through 1 lines of communication, on a bus can be attached to the number of slave devices almost unrestricted.
2. Features: This is a communications technology introduced by Dallas Semiconductor. It uses a single signal line, both to transmit the clock, but also to transfer data, and data transmission is bidirectional.
3. Advantages: Single-bus technology has simple circuit, less hardware, low cost, easy bus expansion and maintenance.
second, single-bus communication process
1. Initialization
Initialization process = reset Pulse + slave response pulse.
The host generates a reset pulse by pulling down the single bus 480 ~ 960 us, then releasing the bus and entering the receive mode. When the host releases the bus, it produces a low-level hop to a high rising edge, and the single-bus device detects the rising edge, and the delay is up to $ US, and the single-bus device pulls down the bus for the response pulse. The host receives the slave's response pulses indicating that the single-bus device is ready and the initialization process is complete.
The initialization sequence diagram looks like this:
2. Write gap
There are two types of write clearances, including write 0 time slots and write 1 time slots.
When the data line is pulled down, the data line is sampled in the time window of ~ us. If the data line is low, write 0, or write 1 if the data line is high. The host to generate a write 1 o'clock gap, you must pull down the data line, in the write time after the gap begins to allow the data line to pull high. To generate a write-0 o'clock Gap, the host must pull down the data line and keep it up to us.
The time-of-write gap timing diagram is as follows:
3. Read-Time Clearance
When the host pulls the bus down is, and remains at least 1 us after releasing the bus, the data must be read within the US.
The read-time gap timing diagram is as follows:
three, single-bus communication equipment
For example, DS18B20, DHT11, etc. are all used for single-bus protocol communication.
Reference program for temperature sensor DS18B20 Link: http://blog.csdn.net/zhengqijun_/article/details/52515977