【技術盛宴】
#include
sbit P06=P0^6; //定義光控輸入端
sbit P24=P2^4; //定義繼電器輸出端
void main()
{
while(1)
{
P06=1; //讀端口數(shù)據(jù)之前先往端口寫1;
if(!P06) //讀端口數(shù)據(jù),為0表示光線變暗
{
P24=0; //光線變暗,輸出繼電器閉合
}
else
P24=1; //強光時繼電器斷開
}
ATMEL公司的AT89S52單片機,是低功耗、高性能CMOS 8位微處理器,具有8K在系統(tǒng)可編程Flash存儲器。使用Atmel公司高密度非易失性存儲器技術制造,與工業(yè)80C51產(chǎn)品指令和引腳完全兼容。片上的Flash允許程序存儲器在系統(tǒng)編程,亦適于常規(guī)編程器。在單芯片上,擁有靈活的8位CPU和在系統(tǒng)可編程Flash,使得AT89S52為眾多嵌入式控制應用系統(tǒng)提供高靈活,超有效地解決方案。
AT89S52具有以下標準功能:8K字節(jié)Flash,256字節(jié)RAM,32位I/O接口,看門狗定時器,2個數(shù)據(jù)指針,三個16位定時器/計數(shù)器,一個6向量2級中斷結構,全雙工串行口,片內(nèi)晶振及時鐘電路。另外,AT89S52可降至0Hz靜態(tài)邏輯操作,支持2種軟件可選擇節(jié)電模式??臻e模式下,CPU停止工作,允許RAM、定時器/計數(shù)器、串口、中斷繼續(xù)工作。掉電保護方式下,RAM數(shù)據(jù)被保存,振蕩器被凍結,單片機一切工作停止,直到下一個中斷或硬件復位為止。
由于單片機的種類很多,在選擇單片機時要依據(jù)實際設計要求選擇合適的單片機。在本課題中,選用的是ATMEL公司的AT89S52。
加熱門了~!
樓主一直從事單片機數(shù)控電源方面的嘛?~
With the rapid development of science and technology, "Information Age" to come, as a means of access to information - sensor technology has been significant progress, more and more extensive areas of its application, its becoming more demanding, more urgent needs . Sensor technology has become the measure of a country's level of development of science and technology an important landmark. Therefore, to understand and master the basic structure of various types of sensors, the working principle and characteristics are very important. In order to improve awareness and understanding of the sensor, especially for the light sensors in-depth research and its use and purpose, based on practical, extensive, and the principle of the typical design of the system. In this thesis, combining light sensors microchip technology development and design of this light control system, curtains or other equipment if the installation of the sensor, the sensor automation control. The AT89S52 microcontroller and photoresistor light control as the core design of the motor drive circuit can realize automation of light control is a simple structure, stable performance, easy to use, inexpensive, intelligent light-sensitive circuit, has some practical value.
參考文獻
[1] 陳強. 電子產(chǎn)品設計與制造. 電子工業(yè)出版社, (2010)
[2] 任致程.經(jīng)典智能電路300例.機械工業(yè)出版社,2004:1~21
[3] 作者不詳.家庭電子小制作.新時代出版社,2004:35~40
[4] 求是科技. 單片機應用系統(tǒng)開發(fā)實例導航. 人民郵電出版社, (2003)
[5] 何衍慶. 控制系統(tǒng)分析設計和應用. 化學工業(yè)出版社, (2003)
[6] 宏晶科技(深圳). AT89C51系列單片機器件手冊
[7] 成偉, 郝躍, 馬曉華, 劉紅俠. EEPROM單元的電荷保持特性. 電子學報, 2006, 27(7): 1290~1293
[8] N kansah F D. Technology and reliability of submicron 1 T2 flash EEPROM. UMI Number :9995534. Bell &Howell Information and Learning Company, 2001: 2
[9] De Salvo B, Ghibaudo G. Pananakak is Getal. Experimental and theoretical investigation of nonvolatile memory data-retention. IEEE Trans Electron Devices, 1999, 46 (7): 15~18
[10] 黃再銀. 帶看門狗和電源監(jiān)控功能的復位芯MAX813L. 電子世界, 2003(3): 39~40
[11] 陳曉莉, 張俊濤. KEIL C51單片機仿真器的設計.微計算機信息(嵌入式與SOC), 2006,2(2): 19~20
[12] Keil Software. Cx51 Complier User‘s Guide. Keil Software,(2001)
[13] Keil Software. Macro Assembler and Utilities User‘s Guide. Keil Software, (2001)
[14] 魏東. Keil C51總線外設操作問題的深入分析. 單片機與嵌入式系統(tǒng)應用, (2006)
[15] 中小企業(yè)科技信息,Science-Technical on Middle-Small Business,編輯部郵箱, 12期