Is my MAX6675 dead

Mark.R

Member
Hi all me again, still trying to get my thermocouple to talk to a picaxe. Have now got myself a 14M2 board to do experiments at the bedroom desk while corri is on ha ha.

It is all wired correctly, I've looked at it until my eyes cross over and my code is this:-

; Picaxe 14M2+ to Max6675 thermocouple

Symbol CS = C.2 ' connect to pin 6 MAX6675
Symbol SCK = C.1 ' connect to pin 5 MAX6675
Symbol MISO = C.3 ' connect to pin 7 MAX6675
Symbol Val = W1
Symbol I = B1

#picaxe 14m2
#no_data
#terminal 4800


Main:

GoSub MeasTemp
GoSub DisplayTemp
Pause 1000 ' allow Max6675 to finish
Goto Main

MeasTemp:
High CS ' deselect the 6675
Low SCK
Low CS ' start conversion
Val = 0 ' initialize temperature variable
For I = 1 to 16 ' serial clock in 16 bits
High SCK
Val = Val * 2 + MISO 'clock in the bits into a word
Low SCK
Next I
High CS ' deselect the 6675
Val = Val / 32 ' use only the 11 most sig bits (val = deg Celsius)

Return


DisplayTemp:
sertxd("Temp=",#w1," ")

Return


But all I get on the terminal is Temp=2047 which I see looking around the fourm other people have had and this has been fixed by swapping the thermocouple wires round, makes no difference to mine, it even displays Temp=2047 if the MAX6675 is unpluged all together???

Can one make the asumption that the MAX6675 is an eBay duffer as the 14M2 and its board work fine???



Any ideas?
 

AllyCat

Senior Member
Hi,

The 6675 is probably OK, I think you have a bug in your code.

MISO has a value of 11 (the "pin niumber" used to define output signals), so Val = Val * 2 + MISO will always read and generate the same value. You should use symbol MISO = pinC.3 which will then read the signal on the pin.

Cheers, Alan.
 

Mark.R

Member
Alan you are a star, changed it and now working a treat and dont know how I missed it, what a school boy error!!!

Thanks again.
 
Top