»ùÓÚµ¥Æ¬»úµÄµçÈÈË®Æ÷¿ØÖÆÆ÷Éè¼Æ×ÊÁÏ ÏÂÔØ±¾ÎÄ

±ÏÒµÂÛÎÄ

¿Î³ÌÉè¼ÆÌâÄ¿£º»ùÓÚµ¥Æ¬»úµÄµçÈÈË®Æ÷¿ØÖÆÆ÷Éè¼Æ

ѧ Ôº£º»úеÓëµç×Ó¹¤³ÌѧԺ ѧÉúÐÕÃû£ºÅíÏþÎä °à ¼¶£º080621 ѧ ºÅ£º08062137 Ö¸µ¼½Ìʦ£º¸¶Ö¾¼á

2011Äê11ÔÂ1ÈÕ

1

Õª Òª

±¾ÎÄÉè¼ÆµÄ¿ØÖÆÆ÷²ÉÓÃAT89S51µ¥Æ¬»ú×÷Ϊ¿ØÖƺËÐÄÀ´Éè¼ÆÖÇÄܵçÈÈË®Æ÷¡£±¾Éè¼ÆÒ²¶Ôµ¥Æ¬»ú¿ØÖƵçÈÈË®Æ÷ʵÏÖÖÇÄÜ»¯µÄ¿ÉÄÜÐÔ½øÐÐÁË·ÖÎö£¬ÀûÓÃζȴ«¸ÐÆ÷¡¢Ë®Î»¼ì²â×°Öᢼ°Ä£Êýת»»Æ÷µÈÀ´Íê³É±¾Éè¼Æ¡£ÔÚÓ²¼þÉè¼Æ·½Ã棬Ö÷Òª¶Ôµ¥Æ¬»ú×îСϵͳ¼°ÆäÀ©Õ¹¡¢µçÔ´µç·¡¢¼üÅÌÏÔʾ¼°½Ó¿Úµç·¡¢Ä£Êýת»»µç·¡¢Ë®Î»¼°Ë®Î¼ì²âµç·¡¢±¨¾¯µç·½øÐÐÁËÏêϸ½éÉÜ¡£»¹Ïêϸ½éÉÜÁËÉè¼ÆÖÐÓ¦Óõ½µÄÖ÷ҪоƬµÄÐÔÄܺÍÌØµã£¬°üÀ¨AT89S51¡¢74LS377¡¢DS18B20¡¢ADC0809µÈ¡£ÔÚÈí¼þÉè¼Æ·½Ã棬²ÉÓûã±àÓïÑÔ±à³Ì£¬ÊÇÓÉÓÚÆäÒ×ÓÚΪµ¥Æ¬»úËùʶ±ð£¬Ö´ÐÐËٶȿ졣×îºó¶ÔÈí¼þµ÷ÊÔ½øÐÐÁËÎó²î·ÖÎö¡£

¸ÃÖÇÄܵçÈÈË®Æ÷Éè¼ÆÍêÉÆ£¬ÊµÏÖ·½°¸¼òµ¥Ò×ÐС£²ÉÓÃÈí¼þÉè¼ÆÀ´¿ØÖÆ£¬¿ÉÒÔʵÏÖÖÇÄܼì²âˮλ¼°Ë®Î£¬ÖÇÄܼÓÈÈ£¬²¢ÇÒÌá¸ßÁËÕû»úµÄ¿É¿¿ÐÔ¼°×¼È·ÐÔ¡£

¹Ø¼ü´Ê£ºµ¥Æ¬»ú£¬¿ØÖÆ£¬ÖÇÄÜ

I

ABSTRACT

As technology make a good progress, the applications of single-chip microcomputer become mature all the time. The single-chip microcomputer integrates the various components in a chip, uses the internal bus structure, reduces the connection in different chips, enhanced greatly the reliability and anti-jamming capability. In the development of single-chip microcomputer, due to its excellent cost performance, high integration, small size, high reliability, it has been used as a control center all the time.

Since the birth of single-chip microcomputer, it began to walk into a human¡¯s life, such as washing machines, refrigerators, electronic toys, DMB, which equipped with the single-chip microcomputer, and improved their intelligence, ability. People, who used them, will love them better. The single-chip microcomputer makes human¡¯s life more convenient, comfortable and colorful. As a result, I use single-chip microcomputer to design intelligent electric water heaters.

This paper mainly discusses the intelligent electric water heater how to work. To achieve system goals, in deep analysis of the AT89S51, I made a set of simple and practical control system design. The system is mainly to use single-chip microcomputer to control centers, with specific hardware architecture and the corresponding software design, thus the intelligence of the water heater would become true.

Keywords: single-chip microcomputer, controller, intelligence

II

Ŀ ¼

ÒýÑÔ

¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­1

µÚ1Õ Ð÷ÂÛ ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­2

1.1 ¿ÎÌâµÄ±³¾° ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­2 1.2 ¿ÎÌâÑо¿µÄÄ¿µÄ¼°ÒâÒå ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­2 1.3 ¹úÄÚÍâµÄÑо¿×´¿öºÍ³É¹û ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­3

µÚ2Õ ×ÜÌåÉè¼Æ·½°¸ ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­4

2.1Éè¼ÆÒªÇó ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­4 2.2 ·½°¸Éè¼Æ ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­4

µÚ3Õ Ӳ¼þϵͳÉè¼Æ ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­6

3.1 ·½°¸ÑéÖ¤¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­6 3.2 Ó²¼þϵͳÉè¼Æ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­9

3.2.1 µçÔ´µç·¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­9 3.2.2 ¼üÅÌ/ÏÔʾ½Ó¿Úµç· ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­9 3.2.3 ±¨¾¯µç·¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­11 3.2.4 Ä£Êýת»»µç·¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­12 3.2.5 ζȼì²âµç·¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­13 3.2.6 ˮλ¼ì²âµç·¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­15 3.2.7 ʱÖӵ緡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­16 3.2.8 ÏÔʾģ¿é¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­17 3.2.9 AT89S51¹¦Äܼ°ÌØÐÔ½éÉÜ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­20

µÚ4Õ Èí¼þϵͳÉè¼Æ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­24

4.1 Ö÷³ÌÐòÁ÷³Ì¿òͼ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­24 4.2 ¼üɨÃè×Ó³ÌÐòÁ÷³Ì¿òͼ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­26 4.3 ÏÔʾ×Ó³ÌÐòÁ÷³Ì¿ò¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­26 4.4 ÔËÐгÌÐòÁ÷³Ì¿òͼ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­27 4.5 Èí¼þ·ÂÕæ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­27

½áÂÛÓëÌå»á¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­29 ÖÂл ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­30

III