DatasheetQ Logo
Electronic component search and free download site.
Transistors,MosFET ,Diode,Integrated circuits

TMP05AKSZ-REEL7 View Datasheet(PDF) - Analog Devices

Part Name
Description
Manufacturer
TMP05AKSZ-REEL7 Datasheet PDF : 28 Pages
First Prev 21 22 23 24 25 26 27 28
TMP05/TMP06
#include <stdio.h>
#include <ADuC812.h>
//ADuC812 SFR definitions
void delay(int);
sbit Daisy_Start_Pulse = 0xB7;
//Daisy_Start_Pulse = P3.7
sbit P3_4 = 0xB4;
long temp_high0,temp_low0,temp_high1,temp_low1,temp_high2,th,tl; //Global variables to allow
//access during ISR.
//See Figure 32.
int timer0_count=0,timer1_count=0,tempsegment=0;
void int0 () interrupt 0
{
if (TR1 == 1)
{
th = TH1;
tl = TL1;
th = TH1;
TL1 = 0;
TH1 = 0;
}
TR1=1;
Already
//INT0 Interrupt Service Routine
//To avoid misreading timer
//Start timer1 running, if not running
if (tempsegment == 1)
{
temp_high0 = (TH0*0x100+TL0)+(timer0_count*65536); //Convert to integer
TH0=0x00;
//Reset count
TL0=0x00;
timer0_count=0;
}
if (tempsegment == 2)
{
temp_low0 = (th*0x100+tl)+(timer1_count*65536);
//Convert to integer
temp_high1 = (TH0*0x100+TL0)+(timer0_count*65536); //Convert to integer
TH0=0x00;
//Reset count
TL0=0x00;
timer0_count=0;
timer1_count=0;
}
if (tempsegment == 3)
{
temp_low1 = (th*0x100+tl)+(timer1_count*65536);
//Convert to integer
temp_high2 = (TH0*0x100+TL0)+(timer0_count*65536);
TH0=0x00;
//Reset count
TL0=0x00;
timer0_count=0;
timer1_count=0;
}
tempsegment++;
}
void timer0 () interrupt 1
{
timer0_count++;
}
void timer1 () interrupt 3
{
timer1_count++;
//Keep a record of timer0 overflows
//Keep a record of timer1 overflows
Rev. 0 | Page 21 of 28
 

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]