【正文】
跳過讀序號列號的操作 WriteOneChar(0x44)。 t=t|a。}/*液晶顯示溫度*/void dis_D18B20(void){ int temp。 write_lcd_date(0x30+ge_18b20)。 write_lcd_date(0x43)。 write_lcd_date(0x30+bai_18b20)。 TH0=(6553650000)/256。num++) { write_lcd_date(table[num])。 count++。 TH0=(6553650000)/256。 for(num=0。 } }}void main(){ lcd_init()。 write_lcd_date(0x43)。 write_lcd_date(0x30+shi_18b20)。 write_lcd_date(0x2D)。 t= tt*10+。//高位 t=b。 Init_DS18B20()。 delay(10)。 delay(8)。}/*溫度傳感器讀一個字節(jié)*/ReadOneChar(void){ uchar i=0。 DATA = 1。 lcden=1。 delay_ms(1)。x0。sbit lcden=P2^1。在完成設計的過程中,我遇到了一些問題,在用Keil uVision3調試程序時,軟件提示說“代碼”超過2k。操作協(xié)議為:初始化DS18B20(發(fā)復位脈沖)→發(fā)ROM功能命令→發(fā)存儲器操作命令→處理數(shù)據(jù)。DQ 為數(shù)據(jù)輸入/輸出引腳。 圖2 硬件原理圖 LCD顯示電路設計1602LCD液晶屏為5V電壓驅動,帶背光,可顯示兩行,每行16個字符,不能顯示漢字。因此用它來組成一個測溫系統(tǒng),具有線路簡單,在一根通信線,可以掛很多這樣的數(shù)字溫度計,十分方便。AT89C52AbstractAlong with the progress of The Times and development, microcontroller technology has spread to our life, work, scientific research, each domain, has bee a more mature technology, this paper mainly introduces a temperature measurement system based on AT89C52 single chip microputer, described in detail using digital temperature sensor DS18B20 temperature measurement and control system in the development process, focusing on sensors under the single chip microputer hardware connection, software programming, and each module system process has carried on the detailed analysis of the circuit of each part are introduced one by one, also the system can easily realize temperature acquisition and display, it is quite convenient to use and has high precision, wide range, high sensitivity, small volume, low power consump