Page 1 of 1

MAX6675

Posted: Sun Feb 10, 2013 10:00 pm
by YahooArchive
>from help line
>I\'m trying to use SPI to interface a MAX6675 TC chip to an ARMmite with BASIC.
Could you provide a bare bones code example that would give me a start on this?
I\'ve been unable to make any headway after considerable effort.

SPI is not really a standard, it basically means you have a couple wires that
are a serial interface to the peripheral.

This device falls into a class that might better be done with SHIFTIN

While I can't test it this should be pretty close (I assume that CSpin, CLKpin
and INpin have been #define 'd)


#define SHIFTpreSample ' because data is ready when CS goes low
#include

shiftCounts(0) = 32

IO(CSpin) = 0
shiftin (INpin,CLKpin,0,1) 'read the value
IO(CSpin) = 1

max6675_reading = shiftValues(0)