Author | Eur van Andel, eur@fiwihex.nl Copyright (c) 2008 |
Adapted-by | |
Compiler | =2.4h |
this library reads the TC77 temperature sensor from Microchip. The TC77 has a 12-bit plus sign temperature resolution of 0.0625°C per Least Significant Bit (LSb). It works via the SPI protocol Specs: 1C (max.) accuracy from +25°C to +65C, 2C (max.) accuracy from -40°C to +85C 3C (max.) accuracy from -55°C to +125C 2.7V to 5.5V Operating Range, Low Power: 250uA (typ.) Continuous Conversion Mode, 0.1uA (typ.) Shutdown Mode -------- I have several years of experience with hundreds of these sensors. They work very well: fast, good accuracy, good repeatability. If they have an offset, it can easily be calibrated in software. The hard part of using this sensor is gettting it watertigtht. It is SMD, so it needs a PCB, and a cable. Dipping in resin or shrinking in glue-covered shrinktube works. The SPI protocol is bit-banged here and can be used with any pins. Clock data in on rising edge of clock, program must pull CS low. This allows for multiple TC77s on the same 2-wire databus. Put a 100nF decoupling capacitor close the the TC77. If you don't, you WILL get weird data. This library assumes two pins: global bit SCK, wired to SCK of device and global bit SIO,wired to SIO of device. SCK should be output, SIO input. Writing the status_word is not supported here.
No dependency found
tc77_read_celsius_sdword(sdword out temperature)
tc77_read_raw(word out raw)
tc77_read_celsius_sword(sword out temperature)
tc77_read_celsius_sbyte(sbyte out temperature)
tc77_read_celsius_sdword(sdword out temperature)
read celsius temperature of TC77 output in one sdword with 4 digits, so T = xxx.xxxx C last bit is 0.0001C , range is -40C ... +125C
tc77_read_raw(word out raw)
get raw temperature of TC77 output in word, right justified
tc77_read_celsius_sword(sword out temperature)
read celsius temperature of TC77 output in one sword with 2 digits, so T = xxx.xx C last bit is 0.01C , range is -40C ... +125C best procedure if you want to display C in 0.1 accurate take care of rounding during printing
tc77_read_celsius_sbyte(sbyte out temperature)
read celsius temperature of TC77 output in one sbyte with zero digits, so T = +/- xxx C last bit is 1C, range is -40C ... +125C no rounding, celsius fraction is chopped
16f876a | 16f876a_tc77.jal |