设计测试
µC's 8-bit File Register #1 (high byte) |
µC's 8-bit File Register #2 (low byte) | ||||||||||||||
Step 1: The Kcode value is serially read out of U3. For example, Kcode = 2,384 decimal below. | |||||||||||||||
X |
X |
MSB D12 |
D11 |
D10 |
D9 |
D8 |
D7 |
D6 |
D5 |
D4 |
D3 |
D2 |
LSB D1 |
0 |
0 |
X |
X |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
Step 2: The Kcode is byte aligned. Kcode is still equal to 2,384 decimal below. | |||||||||||||||
0 |
0 |
0 |
0 |
MSB D12 |
D11 |
D10 |
D9 |
D8 |
D7 |
D6 |
D5 |
D4 |
D3 |
D2 |
LSB D1 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
0 |
0 |
0 |
0 |
Step 3: Shifting the data right three places is equivalent to multiplying by 0.125 to obtain the Kelvin temperature. For example, K = 298 below. | |||||||||||||||
0 |
0 |
0 |
0 |
MSB D12 |
D11 |
D10 |
D9 |
D8 |
D7 |
D6 |
D5 |
D4 |
D3 |
D2 |
LSB D1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
0 |
Step 4: A 16-bit subtraction code routine must be used to subtract 273 from K, because 273 exceeds 8 bits. For example, °C = 25 below. | |||||||||||||||
See code listing for the 16-bit subtraction code routine. |
D8 |
D7 |
D6 |
D5 |
D4 |
D3 |
D2 |
LSB D1 | |||||||
0 |
0 |
0 |
1 |
1 |
0 |
0 |
1 | ||||||||
Step 5: A 16-bit binary-to-BCD conversion routine must be used because that is the format used by the LED display driver. For example, 25C below. See code listing for the 16-bit binary to BCD conversion code routine. | |||||||||||||||
LED 0 |
LED 1 |
LED 2 |
LED 3 | ||||||||||||
CURRENTLY BLANK |
D8 |
D4 |
D2 |
D1 |
D8 |
D4 |
D2 |
D1 |
Permanent "C" is displayed to represent " °C " | ||||||
CAN BE NEGATIVE SIGN |
0 |
0 |
1 |
0 |
0 |
1 |
全部0条评论
快来发表一下你的评论吧 !