Hardware Reference
In-Depth Information
Step 2
Divide the upper 12 bits by 16.
For example, the conversion result 0x7000 corresponds to 0x700/16 5 112°C. The conversion
result 0x6040 corresponds to 0x604/16 5 96.25°C.
N EGATIVE C ONVERSION R ESULT
Step 1
Compute the two's complement of the conversion result.
Step 2
Truncate the lowest 4 bits.
Step 3
Divide the upper 12 bits of the two's complement of the conversion result by 16.
For example, the conversion result 0xE280 corresponds to 20x1D8/16 5 229.5°C.
11.7.5 DS1631A Command Set
The DS1631A supports the following commands:
Start Convert T [0x51]. This command initiates temperature conversions. If
the part is in one-shot mode, only one conversion is performed. In continuous
mode, continuous temperature conversions are performed until a Stop Convert T
command is issued.
Stop Convert T [0x22]. This command stops temperature conversions when the
device is in continuous conversion mode.
Read Temperature [0xAA] . This command reads the last converted temperature
value from the 2-byte Temperature register.
Access TH [0xA1] . This command reads or writes the 2-byte T H register.
Access TL [0xA2] . This command reads or writes the 2-byte T L register.
Access Config [0xAC]. This command reads or writes the 1-byte Configuration
register.
Software POR [0x54] . This command initiates a software power-on-reset
operation, which stops temperature conversions and resets all registers and logic
to their power-up states. The software POR allows the designer to simulate cycling
the power without actually powering down the device.
11.7.6 I 2 C Communication with DS1631A
A typical circuit connection between the HCS12 microcontroller and a DS1631A is shown
in Figure 11.34. The address input of the DS1631A is arbitrarily set to %001 in Figure 11.34. To
initiate I 2 C communication, the HCS12 MCU asserts a start condition followed by a control byte
containing the DS1631A device ID. The R/W bit of the control byte must be a 0 since the HCS12
MCU next will write a command byte to the DS1631A. The format for the control byte is shown
in Figure 11.35. The DS1631A responds with an ACK after receiving the control byte. This must
be followed by a command byte from the master, which indicates what type of operation is to be
performed. The DS1631A again responds with an ACK after receiving the command byte. If the
command byte is the Start Convert T or Stop Convert T command, the transaction is finished,
and the master must issue a stop condition to signal the end of the communication sequence. If
the command byte indicates a write or read operation, additional actions must occur.
 
Search WWH ::




Custom Search