【技术盛宴】
#include
sbit P06=P0^6; //定义光控输入端
sbit P24=P2^4; //定义继电器输出端
void main()
{
while(1)
{
P06=1; //读端口数据之前先往端口写1;
if(!P06) //读端口数据,为0表示光线变暗
{
P24=0; //光线变暗,输出继电器闭合
}
else
P24=1; //强光时继电器断开
}
ATMEL公司的AT89S52单片机,是低功耗、高性能CMOS 8位微处理器,具有8K在系统可编程Flash存储器。使用Atmel公司高密度非易失性存储器技术制造,与工业80C51产品指令和引脚完全兼容。片上的Flash允许程序存储器在系统编程,亦适于常规编程器。在单芯片上,拥有灵活的8位CPU和在系统可编程Flash,使得AT89S52为众多嵌入式控制应用系统提供高灵活,超有效地解决方案。
AT89S52具有以下标准功能:8K字节Flash,256字节RAM,32位I/O接口,看门狗定时器,2个数据指针,三个16位定时器/计数器,一个6向量2级中断结构,全双工串行口,片内晶振及时钟电路。另外,AT89S52可降至0Hz静态逻辑操作,支持2种软件可选择节电模式。空闲模式下,CPU停止工作,允许RAM、定时器/计数器、串口、中断继续工作。掉电保护方式下,RAM数据被保存,振荡器被冻结,单片机一切工作停止,直到下一个中断或硬件复位为止。
由于单片机的种类很多,在选择单片机时要依据实际设计要求选择合适的单片机。在本课题中,选用的是ATMEL公司的AT89S52。
加热门了~!
楼主一直从事单片机数控电源方面的嘛?~
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] 陈强. 电子产品设计与制造. 电子工业出版社, (2010)
[2] 任致程.经典智能电路300例.机械工业出版社,2004:1~21
[3] 作者不详.家庭电子小制作.新时代出版社,2004:35~40
[4] 求是科技. 单片机应用系统开发实例导航. 人民邮电出版社, (2003)
[5] 何衍庆. 控制系统分析设计和应用. 化学工业出版社, (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] 黄再银. 带看门狗和电源监控功能的复位芯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总线外设操作问题的深入分析. 单片机与嵌入式系统应用, (2006)
[15] 中小企业科技信息,Science-Technical on Middle-Small Business,编辑部邮箱, 12期