( two wire
Humidity sensor of Sensirion ) on a 1-wire ( © Dallas semiconductor ) network.

Figure 1 Block schematic
** When a
SHT11 sensor is used, 11 I/O pins are free
See for the
schematic: schematic.gif.
Information in PDF format: 1-WireIOPort.pdf
HEX-file for a PIC16F628: HexFile (
after download rename the file to .hex )

Figure 2 Prototype of the 1-Wire SHT11 humidity sensor / IO port
The unit is controlled by the
1-Wire protocol of Dallas semiconductor.
Some basic commands are build in the PIC16F628.
ROM-functions:
|
Read ROM |
0x33 |
|
Match ROM |
0x55 |
|
Skip ROM |
0xCC |
|
Search ROM |
0x0F |
Memory / Control commands
|
Command |
Value |
Description |
|
Write Scratchpad |
0x4E |
Till 32 bytes can be written to the internal scratch
memory |
|
Read Scratchpad |
0xBE |
Till 32 bytes can be read from the internal
scratchpad ( no CRC ) |
| Copy Scratchpad |
0x48 |
32 bytes are written to the Eeprom ( takes till 50mS
) |
|
Recall EEprom |
0xB8 |
32 bytes from Eeprom are copied into the scratchpad |
|
Convert Sensor |
0x44 |
Starts a conversion of the SHT11 sensor ( Takes apr.
300mS ) |
|
Read Sensor |
0x45 |
Reads the SHT11 conversion results ( 10 bytes ) |
|
Reset Counter |
0x01 |
Resets the 32 bits counter to zero |
|
Read Counter |
0x02 |
Reads the 32 bits counter ( message of 6 bytes ). Counter-input is PortA_4 |
|
Read IO-identification |
0x03 |
Read the IO-module identification |
|
Setup PortA |
0xF3 |
Sets the Port A pins to be Input or Output |
|
Setup PortB |
0xF4 |
Sets the Port B pins to be Input or Output |
|
Read PortA |
0xF5 |
Reads the contents of PortA ( inputs PortA_0..PortA_4),
6 bits |
|
Read PortB |
0xF6 |
Reads the contents of PortB ( inputs PortB_1..PortB_7),
7 bits |
|
Write PortA |
0xF7 |
Writes the value to PortA, 6 bits |
|
Write PortB |
0xF8 |
Writes the value to PortB, 7 bits |
On request a complete description of the commands can be send.