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 #345 background imageLoading...
Page #345 background image
345
#define convert_T 0x44
#define read_scratchpad 0xBE
#define write_scratchpad 0x4E
#define copy_scratchpad 0x48
#define recall_E2 0xB8
#define read_power_supply 0xB4
#define skip_ROM 0xCC
#define resolution 12
void DS18B20_init(void);
float DS18B20_get_temperature(void);
DS18B20.c
#include "DS18B20.h"
void DS18B20_init(void)
{
onewire_reset();
delay_ms(100);
}
float DS18B20_get_temperature(void)
{
unsigned char msb = 0x00;
unsigned char lsb = 0x00;
register float temp = 0.0;
onewire_reset();
onewire_write(skip_ROM);
onewire_write(convert_T);
switch(resolution)
{
case 12:
{
delay_ms(750);
break;
}
case 11:
{
delay_ms(375);
break;
}
case 10:
{
delay_ms(188);
break;
}
case 9:
{
delay_ms(94);
break;

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