*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: ?C_START MODULE: .\STARTUP.obj (?C_STARTUP) *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: ?C_START MODULE: .\STARTUP.obj (?C_STARTUP) ADDRESS: 005FH Program Size: data=9.0 xdata=0 code=104 creating hex file from "1820"... "1820" - 0 Error(s), 3 Warning(s).
#include<reg51.h> #include<stdio.h> #include<math.h>
#define uchar unsigned char #define uint unsigned int
extern WDS1820(uchar x); extern RDS1820(uchar *pt); extern bit RTDS1820(void); extern DELAY15(uchar n);
sbit P0_2=P0^2;
void main(void) { uint i;
float data tempF;
uchar data temp[10],disbuf[10];
if(RTDS1820()!=1);
DELAY15(0xff);
WDS1820(0xcc);
WDS1820(0x44);
P0_2=1;
do{DELAY15(0xff);i++;}while(i<=400);
if(RTDS1820()!=1);
DELAY15(0xff);
WDS1820(0xcc); WDS1820(0xbe);
RDS1820(&temp);
tempF=((temp[1]<<8)+temp[0]>>1)-0.25+((temp[7]-temp[6])/temp[7]);
sprintf(&disbuf,"T=%+4,1f%c",tempF,'c');
//display(&temp);
}
NAME RW1820
?PR?RDS1820?RW1820 SEGMENT CODE ?PR?WDS1820?RW1820 SEGMENT CODE ?PR?RTDS1820?RW1820 SEGMENT CODE ?PR?DELAY15?RW1820 SEGMENT CODE
PUBLIC RTDS1820,WDS1820,RDS1820,DELAY15
RSEG ?PR?RDS1820?RW1820
RDS1820:
MOV R1,#9
MOV A,R7
MOV R0,A
RD18201:MOV R2,#8
RD18202:SETB P0.2;
NOP
NOP
CLR P0.2
NOP
NOP
SETB P0.2
MOV R7,#1
LCALL DELAY15
MOV C,P0.2
RRC A;
DJNZ R2,RD18202
MOV @R0,A
INC R0
DJNZ R1,RD18201
RET
RSEG ?PR?WDS1820?RW1820
WDS1820:
MOV R1,#8
CLR C
MOV A,R7
WR18201:CLR P0.2
MOV R7,#1
LCALL DELAY15
RRC A
MOV P0.2,C
MOV R7,#1
LCALL DELAY15
SETB P0.2
NOP
DJNZ R1,WR18201
SETB P0.2
RET
RSEG ?PR?RTDS1820?RW1820
RTDS1820:
CLR P0.2
MOV R7,#40
LCALL DELAY15
SETB P0.2
MOV R7,#4
LCALL DELAY15
MOV R7,#100
SETB C
RST0: JNB P0.2,RST1
DJNZ R7,RST0
CLR C
RST1:RET
RSEG ?PR?DELAY15?RW1820 DELAY15:
MOV R6,#6
DEL151: DJNZ R6,DEL151
DJNZ R7,DELAY15
RET
END
|