Interfacing with the Pmod
The Pmod TC1 communicates with the host board via the SPI protocol. The module sends a variety of information to the host board in 32 clock cycles including the temperature measured by the thermocouple, the temperature of the "cold junction", as well as signals indicating if there is a fault with the thermocouple. The Pmod TC1 uses a 6-pin port to connect to the host board.
To read data, the system board drives the slave select (SS) pin low and drives a clock to the slave device, the PmodTC1. The first bit (and the sign bit) of the 14-bits of temperature data is loaded onto the Master-In-Slave-Out (MISO) line on the falling edge of the Chip Select (CS) and can be read by the host board on the rising edge of the Serial Clock (SCLK) line. Similarly, each consecutive bit of data, starting with the most significant bit (MSB), are placed onto the data line on each falling edge of SCLK and is read on the subsequent rising edge of SCLK. Users can choose to stop reading information from the Pmod TC1 by driving the CS line high.
Temperature data is updated only when the chip select (CS) pin is held high, therefore it is recommended to drive CS high after reading. A complete temperature reading of just the thermocouple requires 14 clock cycles. 32 clock cycles are required to read both the thermocouple and reference junction temperatures.
The remaining bits of data not associated with the temperatures consist of a reserved bit that always reads low (bit 17) and a fault bit that reads high when one of the fault indicators (bits 2, 1, or 0) are reporting a fault. The faults refer to an issue detected with the thermocouple, such as a short.