Have a set of MAX6675's connected to a MEGA32, successfully reading temperatures. I'm using C with AVR Studio/WinAVR toolchain.
I'm now at the point where I want to make an "elegant" solution to the conversion of the 12-bit data value that the MAX produces into ASCII for output on both an LCD and UART. Simplistically, the MAX produces a value that is .25 degree C per increment, meaning a value from 0 to 4095 equates to temperatures from 0.0 to 1023.75.
At the moment I do my conversion in two parts. First I take the 12-bit number shifted right twice, and use ITOA - this gives me the whole number component (since right shift by 2 is divide by 4), and then I have a set if IF... ELSE IF statements for the two LSBs that maps 0 = ".00", 1=".25" etc to get the fractional part. In this case I actually do two outputs, which in itself isn't a big deal but I am likely to want to do the conversion and the output as two separate functions in my final code.
At this stage I am not speed constrained, I don't think, so I would probably get by fine with the approach I've taken if I clean up my code and use a single string buffer to maintain the text, but thought if anyone had a neat way to deal with this they were happy to share, I'd appreciate it!