I assume that you are already familiar with the SPI interface. If not then first took some tutorials on SPI (Serial Peripheral Interface) interface before going through this project.
LM74 Temperature Sensor Pin Out
SI/O is Slave input/output. All the commands, control signals and data, travels in and out of the sensor from this pin.Data is clocked out from the sensor on the falling edge of the serial clock (SC), while data is clocked in on the rising edge of SC. A complete transmit/receive communication will consist of 32 serial clocks. The first 16 clocks comprise the transmit phase of communication, while the second 16 clocks are the receive phase. SC is Slave clock. In SPI mode clock is essential to carry out the task.
LM74 Temperature Sensor Registers
LM74 Temperature Sensor Configuration Register
LM74 Temperature Register
Note: On first power up LM74 will output arbitrary data don’t worry its for the first time power up. Then its start working perfectly.
LM74 Manufacturer’s Device ID Register
SPI communication with Pic8f452 Microcontroller
- Serial Data Out (SDO) – RC5/SDO
- Serial Data In (SDI) – RC4/SDI
- Serial Clock (SCK) – RC3/SCK
- Slave Select (SS) – RA5/SS
Three registers are associated with SPI communication. To carry out successful SPI communication we have to configure them correctly.