TC72 SPI Temperature Sensor At Brief
TC72 is a temperature-to-digital converter with serial peripheral interface (SPI). It could read the temperature from -55 to +125 degree Celsius. The temperature data is 10-bit format in which the upper 8-bit is the signed decimal value. The remaining two lower bits is the fraction value. The fraction is 0.25 degree Celsius step.
A program screen shot reading the temperature of -16.25 degree Celsius. |
The device comes with 8-pin SMD package.
Pins diagram of this device lists below.
The supply voltage is between 2.65 V to 5.5 V DC. All pins description are list below.
- NC - No Connection
- CE - Chip Enable (active high)
- SCK - Serial Clock Input
- GND - Ground
- SDO - Serial Data Out
- SDI - Serial Data In
- NC - No Connection
- VDD - Positive Supply
For data communication, there are two read and write operations- SPI single byte and SPI multiple byte. But here, I implement only the SPI single byte implementation.
Ax Denotes the address of register. Dx is the data written or reading from the corresponding address. |
Control register is for initialize the operation of this device. There are three modes- one-shot, continuous conversion and shut down. At power on reset or brown out reset, it is in shut down mode. Control register setting lists below.
- One-shot = 0 and Shut-Down = 0 - Continuous temperature conversion
- One-shot = 0 and Shut-Down = 1 - Shut Down
- One-shot = 1 and Shut-Down = 0 - Continuous temperature conversion
- One-shot = 1 and Shut-Down = 1 - One Shot
LSB temperature is the two-bit fraction number. It is 0.25 degree Celsius per bit, and 0.75 degree Celsius maximum value. We can ignore this fraction LSB temperature number with 0.75 degree Celsius error.
Programming with CCS PICC
PIC16F818 comes with and SPI communication module. The program memory sizes up to 2 kB, sufficient for this programming example.
In this example, the SPI port commands to read the temperature from TC72 in continuous mode. An 16x2 character LCD display the result with full formatting.
The MCU clocks at 4 MHz, yielding a 1 micro second instruction speed. SPI clock is divided by 64 to make a steady serial data reading.
Schematic diagram |
CCS PICC program lists below.
If you want a standard PCB for ATMega32 micro-controller, you can order my AVR Microcontroller project from PCBWay with a reasonable price. Click here to get a free $5 credit for new account.
ATMega16 ATMega32 Experiment Board PCB from PCBWay |
Watch it on YouTube
No comments:
Post a Comment