The Typical Application Circuit shows the MAX6675interfaced with a microcontroller. In this example, theMAX6675 processes the reading from the thermocoupleand transmits the data through a serial interface.Force CS low and apply a clock signal at SCK to readthe results at SO. Forcing CS low immediately stopsany conversion process. Initiate a new conversionprocess by forcing CS high.Force CS low to output the first bit on the SO pin. Acomplete serial interface read requires 16 clock cycles.Read the 16 output bits on the falling edge of the clock.The first bit, D15, is a dummy sign bit and is alwayszero. Bits D14-D3 contain the converted temperature inthe order of MSB to LSB. Bit D2 is normally low andgoes high when the thermocouple input is open. D1 islow to provide a device ID for the MAX6675 and bit D0is three-state.
// Initialize Serial-Parallel Interface: pinMode(pinSPI_SS, OUTPUT); // Set the slave/chip select pin to output. SPI.begin(); SPI.setBitOrder(MSBFIRST); // Send most significant bit first when transferring a byte. SPI.setDataMode(SPI_MODE1); // Base value of clock is 1, data is captured on clock's falling edge. SPI.setClockDivider(SPI_CLOCK_DIV4); // Set SPI data rate to 16mhz/4. IE: 4mhz.