数据搜索系统,热门电子元器件搜索 |
|
ADT7301 数据表(PDF) 11 Page - Analog Devices |
|
ADT7301 数据表(HTML) 11 Page - Analog Devices |
11 / 14 page Preliminary Technical Data ADT7301 Rev. PrJ | Page 11 of 14 #include <16F873.h> #device adc=8 #use delay(clock=4000000) #fuses NOWDT,XT, PUT, NOPROTECT, BROWNOUT, LVP #BIT CKP = 0x14.4 #define CS PIN_A1 void main(){ int MSByte,LSByte; long int ADC_Temp_Code; float TempVal,ADC_Temp_Code_dec; setup_spi(spi_master); //Pic is set up as Master device. CKP = 1; //Idle state of clock is high. do{ delay_ms(10); //Allow time for conversions. Output_low(CS); //Pull CS low. delay_us(10); //CS to SCLK setup time. MSByte = SPI_Read(0); //The first byte is clocked in. LSByte = SPI_Read(0); //The second byte is clocked in. delay_us(10); //SCLK to CS setup time. Output_High(CS); //Bring CS high. MSByte = 0x03; LSByte = 0x20; ADC_Temp_Code = make16(MSByte,LSByte); //16bit ADC code is stored ADC_Temp_Code. ADC_Temp_Code_dec = (float)ADC_Temp_Code; //Covert to float for division. if ((0x2000 & ADC_Temp_Code) == 0x2000) //Check sign bit for negative value. { TempVal = (ADC_Temp_Code_dec - 16384)/32; //Conversion formula if negative temperature. } else { TempVal = (ADC_Temp_Code_dec/32); //Conversion formula if positive temperature. } }while(True); //Temperature value stored in TempVal. } |
类似零件编号 - ADT7301 |
|
类似说明 - ADT7301 |
|
|
链接网址 |
隐私政策 |
ALLDATASHEETCN.COM |
ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 链接交换 | 制造商名单 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 |