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

TMP05ART-REEL Ver la hoja de datos (PDF) - Analog Devices

Número de pieza
componentes Descripción
Fabricante
TMP05ART-REEL Datasheet PDF : 28 Pages
First Prev 21 22 23 24 25 26 27 28
TMP05/TMP06
}
void main(void)
{
double temp1=0,temp2=0;
double T1,T2,T3,T4,T5;
// Initialization
TMOD = 0x19;
// Timer1 in 16-bit counter mode
// Timer0 in 16-bit counter mode
// with gate on INT0. Timer0 only counts when INTO pin // is high.
ET0 = 1;
// Enable timer0 interrupts
ET1 = 1;
// Enable timer1 interrupts
tempsegment = 1;
// Initialize segment
Daisy_Start_Pulse = 0;
// Pull P3.7 low
// Start Pulse
Daisy_Start_Pulse = 1;
Daisy_Start_Pulse = 0;
// Set T0 to count the high period
TR0 = 1;
IT0 = 1;
//Toggle P3.7 to give start pulse
// Start timer0 running
// Interrupt0 edge triggered
EX0 = 1;
EA = 1;
for(;;)
{
if (tempsegment == 4)
break;
}
// Enable interrupt
// Enable global interrupts
//CONFIGURE UART
SCON = 0x52 ;
TMOD = 0x20 ;
TH1 = 0xFD ;
TR1 = 1;
// 8-bit, no parity, 1 stop bit
// Configure timer1..
// ..for 9600baud..
// ..(assuming 11.0592MHz crystal)
//Convert variables to floats for calculation
T1= temp_high0;
T2= temp_low0;
T3= temp_high1;
T4= temp_low1;
T5= temp_high2;
temp1=421-(751*(T1/(T2-T3)));
temp2=421-(751*(T3/(T4-T5)));
printf("Temp1 = %f\nTemp2 = %f\n",temp1,temp2);
//Sends temperature result out UART
while (1);
// END of program
}
// Delay routine
void delay(int length)
{
while (length >=0)
length--;
}
Rev. 0 | Page 22 of 28

Share Link: 

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