MSP430 DS18B20 program
2016-08-23
0 0 0
no vote
Other
Earn points
#include
Uint temp_value;
Uint temp, A1, A2, A3; / / define variables, display data processing
//*************************************************************************
/ / DS18B20 initialization
//*************************************************************************
Unsigned char DS18B20_Reset (void) / / initialization and reset
{
Unsigned char i;
DQ_OUT;
DQ_CLR;
Delay_us (500); / / delay 500uS (480-960)
DQ_SET;
DQ_IN;
Delay_us (80); / / 80uS delay
I = DQ_R;
Delay_us (500); / / delay 500uS (>480uS)
If (I)
{
Return 0x00;
}
Else
{
Return 0x01;
}
}
//*************************************************************************
Read a byte / / DS18B20 function
//*************************************************************************
Unsigned char ds1820_read_byte (void)
{
Unsigned char i;
Unsign
Uint temp_value;
Uint temp, A1, A2, A3; / / define variables, display data processing
//*************************************************************************
/ / DS18B20 initialization
//*************************************************************************
Unsigned char DS18B20_Reset (void) / / initialization and reset
{
Unsigned char i;
DQ_OUT;
DQ_CLR;
Delay_us (500); / / delay 500uS (480-960)
DQ_SET;
DQ_IN;
Delay_us (80); / / 80uS delay
I = DQ_R;
Delay_us (500); / / delay 500uS (>480uS)
If (I)
{
Return 0x00;
}
Else
{
Return 0x01;
}
}
//*************************************************************************
Read a byte / / DS18B20 function
//*************************************************************************
Unsigned char ds1820_read_byte (void)
{
Unsigned char i;
Unsign
c
程序
Related Source Codes
PClite
0
0
no vote
generic embeded FTP Client
0
0
no vote
UDP Test Demo
0
0
no vote
TMS320F28335 DSP transmits data to EEPROM through
0
0
no vote
TMS320F28335 CAN communication source code
0
0
no vote
No comment