EasyManuals Logo

Texas Instruments MSP430 User Manual

Texas Instruments MSP430
413 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #343 background imageLoading...
Page #343 background image
343
unsigned char onewire_reset(void);
void onewire_write_bit(unsigned char bit_value);
unsigned char onewire_read_bit(void);
void onewire_write(unsigned char value);
unsigned char onewire_read(void);
one_wire.c
#include "one_wire.h"
unsigned char onewire_reset(void)
{
unsigned char res = FALSE;
DS18B20_OUTPUT();
DS18B20_OUT_LOW();
delay_us(480);
DS18B20_OUT_HIGH();
delay_us(60);
DS18B20_INPUT();
res = DS18B20_IN();
delay_us(480);
return res;
}
void onewire_write_bit(unsigned char bit_value)
{
DS18B20_OUTPUT();
DS18B20_OUT_LOW();
if(bit_value)
{
delay_us(104);
DS18B20_OUT_HIGH();
}
}
unsigned char onewire_read_bit(void)
{
DS18B20_OUTPUT();
DS18B20_OUT_LOW();
DS18B20_OUT_HIGH();
delay_us(15);
DS18B20_INPUT();
return(DS18B20_IN());
}
void onewire_write(unsigned char value)
{
unsigned char s = 0;

Table of Contents

Other manuals for Texas Instruments MSP430

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments MSP430 and is the answer not in the manual?

Texas Instruments MSP430 Specifications

General IconGeneral
BrandTexas Instruments
ModelMSP430
CategoryMicrocontrollers
LanguageEnglish

Related product manuals