51+HD7279+ADS1110+PT100的测温系统,通过与标准温度计对比拟合,精度能达到0.5度
uchar read7279(uchar command)
{
cs = 0;
send_byte(command);
return(receive_byte());
cs = 1;
}
void send_byte( uchar out_byte)
{
uchar i;
cs=0;
long_delay();
for (i=0;i<8;i++)
{
if (out_byte&0x80)
{
dat=1;
}
else
{
dat=0;
}
clk=1;
short_delay();
clk=0;
short_delay();
out_byte=out_byte*2;
}
dat=0;
}
uchar receive_byte(void)
{
uchar i, in_byte;
dat=1; // set to input mode
long_delay();
for (i=0;i<8;i++)
{
clk=1;
short_delay();
in_byte=in_byte*2;
if (dat)
{