EDA control method of single bus temperature sensor
by:JVTIA2021-01-06
1, the hardware interface circuit, digital temperature sensor DS18B20 is single bus and measuring temperature ranges from -
55 ℃ to 125 ℃, the measuring precision of + / - 5 ℃, the output can be directly measured through the single bus temperature of binary data, digital quantity can be programmed to control the output of the digits, between nine and 12 (
Including the sign bit)
Choose between.
this device has three ports, the power supply side, terminal, single bus data, when use FPGA IO mouth and DS18B20 single bus connection, by a single bus to send and receive data between FPGA and DS18B20.
2, software control program: read DS18B20 temperature measurement and control mainly includes three steps: the device initialization, send a write command and send read registers command, the function code is written in the core control module.
the initialization is send low level reset signal to the bus through the FPGA, the duration is 480 -
600 us, and then release the FPGA bus, on a single bus pass pull resistance will be the highest level, when DS18B20 detected rising, after waiting for 15
Will issue 60-60 after us
256 us the low level of impulse response, if the FPGA detected pulse response initial success.
after the success of the initialization, the FPGA by bus to send commands to control the temperature of the sensor to collect, process used in the main command is as follows: 0 XCC for skip ROM test command;
0 x44 to start temperature conversion;
0 xbe is read from the DS18B20 temperature measuring values.
in the top-level code in addition to the core control module, including the frequency division module and display module.
among them, the frequency division module converts experiment board 50 m Hz clock to 1 MHZ output to the core control module, used to control the FPGA to read, write, timing of single bus.
the temperature of the display module is used to read the data is converted to a decimal data, and through the dynamic display of digital pipe.
Due to temperature register default 12 bit binary data is used to store, highest as the sign bit, temperature resolution is 00625 ℃.
when the temperature is positive when the sign bit is 0;
When the temperature is negative in the sign bit is 1, and the data bits in the form of complement.
Accordingly, when temperature is converted to a decimal data, first determine the sign bit, when the sign bit is 1, first by the binary data to find the original code, and then converted to a decimal, multiplied by the temperature resolution 00625 finally get to the measured temperature;
When the sign bit is 0, directly converts binary to decimal, then multiplied by the temperature resolution.
The top-level file: 3, system will be compiled sof program download to experiment board, can realize the environment temperature measurement and display.
more high-quality sensors at https://www.
rtdcn。
Com /
key words: thermal resistance, thermocouple, thermal resistance, platinum resistance, PT100, PT1000, pressure sensor and digital temperature sensor