| Datenblatt-Suchmaschine für elektronische Bauteile |
|
TMP05 Datenblatt(PDF) 22 Page - Analog Devices |
|
|
|||||||||||||||||||||||||||||
TMP05 Datenblatt(HTML) 22 Page - Analog Devices |
|
22 / 28 page ![]() TMP05/TMP06 Rev. 0 | Page 22 of 28 } 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; //Toggle P3.7 to give start pulse // Set T0 to count the high period TR0 = 1; // Start timer0 running IT0 = 1; // Interrupt0 edge triggered EX0 = 1; // Enable interrupt EA = 1; // Enable global interrupts for(;;) { if (tempsegment == 4) break; } //CONFIGURE UART SCON = 0x52 ; // 8-bit, no parity, 1 stop bit TMOD = 0x20 ; // Configure timer1.. TH1 = 0xFD ; // ..for 9600baud.. TR1 = 1; // ..(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--; } |
|
Link URL |
| War ALLDATASHEET hilfreich? [ DONATE ] |
Über Alldatasheet | Werbung | Kontakt | Privatsphäre und Datenschutz | Link zum Datenblatt | Linktausch | Hersteller All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |