18X to Max6675 Project

ptribbey

New Member
This is an easy project to probe your wood stove for instance. Bells and whistles could easily be added. Alarms for time to add wood or whatever.
It works well and I'm just putting it out there for anyone interested.
Paul



Code:
' Picaxe 18X to Max6675 thermocouple amp with C to F conversion.
' Good for a range of temperatures fron zero to about 1300 degrees f. Use type K or N thermocouple.
' Paul Tribbey Superior, WI 3-1-2009. Free to use for everyone.
' Some code inspired by PH Anderson.
' Connect thermocouple to pins 2 and 3 of Max6675.
' Using PH Anderson 118 serial LCD display on output 0. Easily modified for other display.

Symbol CS = Output4	' connect to pin 6 MAX6675
Symbol SCK = OutPut5	' connect to pin 5 MAX6675
Symbol MISO = Input1	' connect to pin 7 MAX6675
Symbol Val = W1
Symbol Dig = B4
Symbol I = B5
Symbol J = B6


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 = Val * 9	' quick and dirty celcius
     Val = Val / 5	' to farenheight 
     Val = Val + 32	' conversion
     Return

DisplayTemp:
       Serout 0,t2400, ("?f")	' PH Anderson LCD #118 on output 0
       
       Dig = Val / 1000	' thousands
       Serout 0,t2400, (#Dig)
       Val = Val % 1000
       
       Dig = Val / 100	' hundreds
       Serout 0,t2400, (#Dig)
       Val = Val % 100

       Dig = Val / 10	' tens
       Serout 0,t2400, (#Dig)
       Val = Val % 10

       Dig = Val 		' units
       Serout 0,t2400, (#Dig)
       Return
 
Last edited:

westaust55

Moderator
Paul,

Great to see a well laid out program listing and well documented program.

Maybe you can upload a schematic diagram as well and place it all in the
Finished User PICAXE Projects area where it (hopefully) does not get lost as easily as this active area which has many posts per day.
 

markruby

New Member
This is a nice little project, I have it running with the 18X but with the 18M2 i'm having problems, DIG seems to be a reserved word for staters. Has anyone idea's as to why it may not work?



Thanks Mark
 
Top