garg29
Advanced Member level 1

max6675 project
Hi friends,
As discussed and suggested by all of you in my previous question "" "temperture controller for J & K type temperature sensors" I think what "Ianp" suggested was one of the best methods. Ianp suggested to use MAX6675 ( Cold-Junction-Compensated K-Thermocoupleto-Digital Converter 0°C to +1024°C) with 89c51 for reading temperature from k-type thermocouple. I tried to build a starting code to read values from MAX6675, but the code is showing only 0 (zero) on the screen. I know the code isn't complete as the 12-bit data is comprised only of D3 bit - to - D14 bit as shown in picture below, But still some non-zero value should be read from MAX6675. I'couldn't understand the mistake. Please help me, in finding out my mistake.
Thanks
With best regards,
Garg
Hi friends,
As discussed and suggested by all of you in my previous question "" "temperture controller for J & K type temperature sensors" I think what "Ianp" suggested was one of the best methods. Ianp suggested to use MAX6675 ( Cold-Junction-Compensated K-Thermocoupleto-Digital Converter 0°C to +1024°C) with 89c51 for reading temperature from k-type thermocouple. I tried to build a starting code to read values from MAX6675, but the code is showing only 0 (zero) on the screen. I know the code isn't complete as the 12-bit data is comprised only of D3 bit - to - D14 bit as shown in picture below, But still some non-zero value should be read from MAX6675. I'couldn't understand the mistake. Please help me, in finding out my mistake.
Thanks
With best regards,
Garg
Code:
;*********************** READ MAX6675 **********************************************
READ_MAX6675:
SETB CS
NOP
CLR CS
MOV HIGH_A, #00H ; upper byte
MOV LOW_A, #00H ; lower byte
MOV A, #00H
MOV B, #08H
CLR C
MAX6675_LOOP:
SETB CLK
CLR CLK
MOV C, DO
RRC A
DJNZ B, MAX6675_LOOP
MOV HIGH_A, A
MOV A, #00H
MOV B, #08H
CLR C
MAX6675_LOOP2:
SETB CLK
CLR CLK
MOV C, DO
RRC A
DJNZ B, MAX6675_LOOP2
MOV LOW_A, A
SETB CS
RET
;***************************************************************************************