»ùÓÚ51µ¥Æ¬»úµç×ÓÃÜÂëËøÉè¼Æ
»ùÓÚ51µ¥Æ¬»úÃÜÂëËø¿Î³ÌÉè¼Æ
Õª Òª
Ëæ×ÅÈËÃÇÉú»îˮƽµÄÌá¸ß£¬ÈçºÎʵÏÖ¼ÒÍ¥·ÀµÁÕâÒ»ÎÊÌâÒ²±äµÃÓÈΪͻ³ö¡£ÔÚ¿Æѧ¼¼Êõ²»¶Ï·¢Õ¹µÄ½ñÌ죬µç×ÓÃÜÂë·ÀµÁËø×÷Ϊ·ÀµÁÎÀÊ¿µÄ×÷ÓÃÏÔµÃÈÕÇ÷ÖØÒª¡£
±¾Éè¼ÆÒÔµ¥Æ¬»úAT89C51×÷ΪÃÜÂëËø¼à¿Ø×°Öõļì²âºÍ¿ØÖƺËÐÄ£¬·ÖΪÖ÷»ú¿ØÖƺʹӻúÖ´Ðлú¹¹£¨±¾ÉèÖصã½éÉÜÖ÷»úÉè¼Æ£©£¬ÊµÏÖÔ¿³×ÐÅÏ¢ÔÚÖ÷»úÉϵijõ²½ÈÏ֤ע²á¡¢ÃÜÂëÐÅÏ¢µÄ¼ÓÃÜ¡¢Ô¿³×¶ªÊ§±¨·ÏµÈ¹¦ÄÜ¡£¸ù¾Ý51µ¥Æ¬»úÖ®¼äµÄ´®ÐÐͨÐÅÔÀí£¬Õâ±ãÓÚ¶ÔÃÜÂëÐÅÏ¢µÄËæ»ú¼ÓÃܺͱ£»¤¡£¶øÇÒ²ÉÓüüÅÌÊäÈëµÄµç×ÓÃÜÂëËø¾ßÓнϸߵÄÓÅÊÆ¡£²ÉÓÃÊý×ÖÐźűàÂëºÍ¶þ´Îµ÷ÖÆ·½Ê½£¬²»½ö¿ÉÒÔʵÏÖ¶à·ÐÅÏ¢µÄ¿ØÖÆ£¬Ìá¸ßÐźŴ«ÊäµÄ¿¹¸ÉÈÅÐÔ£¬¼õÉÙ´íÎó¶¯×÷£¬¶øÇÒ¹¦ÂÊÏûºÄµÍ£»·´Ó¦Ëٶȿ졢´«ÊäЧÂʸߡ¢¹¤×÷Îȶ¨¿É¿¿µÈ¡£Èí¼þÉè¼Æ²ÉÓÃ×ÔÉ϶øϵÄÄ£¿é»¯Éè¼Æ˼Ï룬ÒÔʹϵͳ³¯×Å·Ö²¼Ê½¡¢Ð¡ÐÍ»¯·½Ïò·¢Õ¹£¬ÔöǿϵͳµÄ¿ÉÀ©Õ¹ÐÔºÍÔËÐеÄÎȶ¨ÐÔ¡£²âÊÔ½á¹û±íÃ÷£¬±¾ÏµÍ³¸÷ÏÄÜÒÑ´ïµ½±¾Éè¼ÆµÄËùÓÐÒªÇó¡£
¹Ø¼ü´Ê:µ¥Æ¬»ú£»ÃÜÂëËø£»µ¥Æ¬»úÉè¼Æ£¬µç×ÓËø¡£
»ùÓÚ51µ¥Æ¬»úµç×ÓÃÜÂëËøÉè¼Æ
Ŀ ¼
Ò»£®Ð÷ÂÛ ................................................................................................................................................... 1 1.1 ÒýÑÔ ................................................................................................................................................ 1 1.2 µç×ÓÃÜÂëËøµÄ±³¾° ........................................................................................................................ 1 1.3 µç×ÓÃÜÂëËøÉè¼ÆµÄÒâÒåºÍ±¾Éè¼ÆÌصã ........................................................................................ 2 ¶þ.ϵͳÉè¼Æ .............................................................................................................................................. 3 2.1ϵͳ×ÜÉè¼Æ½á¹¹Í¼ ......................................................................................................................... 3 2.2£®¿ªËø»ú¹¹Éè¼Æ .............................................................................................................................. 3 2.2.1Ö÷¿ØоƬAT89C51µ¥Æ¬»úµÄ¼ò½é ............................................................................................. 4 Èý£®ÏµÍ³Ó²¼þÉè¼Æ ................................................................................................................................... 7 3.1¼üÅÌÉè¼Æ ......................................................................................................................................... 7 3.2ϵͳµç·Éè¼Æ£º ............................................................................................................................. 8 3.2.1 ¾§ÕñʱÖÓµç· ............................................................................................................................. 9 3.2.2¸´Î»µç·Éè¼Æ .............................................................................................................................. 9 3.2.3´®¿ÚÒý½Å¹¦ÄܽéÉÜ ...................................................................................................................... 9 3.2.4 ÆäËüÒý½Å ..................................................................................................................................... 9 3.3µç·ͼµÄ»æÖÆ ................................................................................................................................. 9 3.3ÔªÆ÷¼þ²É¹º ................................................................................................................................... 11 ËÄ£®Èí¼þÉè¼Æ ......................................................................................................................................... 12 4.1 ϵͳÈí¼þÉè¼ÆÕûÌå˼· .............................................................................................................. 12 4.2ϵͳÈí¼þÉè¼ÆÁ÷³Ìͼ ................................................................................................................... 13 Î壮³ÌÐòµ÷ÊÔ ......................................................................................................................................... 14 5.1 ³ÌÐòµ÷ÊÔÓõ½µÄÈí¼þ¼°¹¤¾ß .................................................................................................... 14 5.2 KEIL C51¼ò½é .......................................................................................................................... 14 5.3 µ÷ÊÔ¹ý³Ì ...................................................................................................................................... 15 Áù£®×ܽáÓëÕ¹Íû ..................................................................................................................................... 18 Ö л ....................................................................................................................................................... 19 ²Î¿¼ÎÄÏ× ................................................................................................................................................. 20
¸½ ¼ ...................................................................................................................................................................21
»ùÓÚ51µ¥Æ¬»úµç×ÓÃÜÂëËøÉè¼Æ
Ò»£®Ð÷ÂÛ 1.1 ÒýÑÔ
Ëæ×ÅÈËÃÇÉú»îˮƽµÄÌá¸ß£¬ÈçºÎʵÏÖ¼ÒÍ¥·ÀµÁÕâÒ»ÎÊÌâÒ²±äµÄÓÈÆäµÄÍ»³ö£¬´«Í³µÄ»úеËøÓÉÓÚÆä¹¹ÔìµÄ¼òµ¥£¬±»Ç˵ÄʼþÂżû²»ÏÊ£¬µç×ÓËøÓÉÓÚÆä±£ÃÜÐԸߣ¬Ê¹ÓÃÁé»îÐԺ㬰²È«ÏµÊý¸ß£¬Êܵ½Á˹ã´óÓû§µÄϲ°®¡£ËøÊÇÖÃÓÚ¿ÉÆô±ÕµÄÆ÷ÎïÉÏ,ÓÃÒÔ¹Øסij¸öÈ·¶¨µÄ¿Õ¼ä·¶Î§»òijÖÖÆ÷¾ßµÄ,±ØÐëÒÔÔ¿³×»ò°µÂë´ò¿ªµÄ¿Û¼þ¡£Ëø¾ß·¢Õ¹µ½ÏÖÔÚÒÑÓÐÈô¸ÉÄêµÄÀúÊ·ÁË£¬ÈËÃǶÔËüµÄ½á¹¹¡¢»úÀíÒ²Ñо¿µÃºÜ͸³¹£¬Òò´Ë£¬²»ÓÃÔ¿³×¾ÍÄÜ´ò¿ªµÄ·½·¨ºÍ¹¤¾ßÒ²²ã³ö²»Çî¡£ÏÖ´úÈËÀàÎÄÃ÷Éç»áÀÓÉÓÚÉç»áÖи÷ÖÖì¶Ü³åͻʮ·Ö¾çÁÒ£¬ÈËÃǵÄ˼ÏëµÀµÂ¹ÛÄ¼ÛÖµ¹ÛÄÎÄ»¯ÐÞÑøˮƽµÈ²îÒ죬ȺÖÚÖÐÁ¼Ý¬²»Æ룬ÉÆÁ¼µÄÈËÃÇÄܹ»×Ô¾õ¹æ·¶×ÔÒѵÄÐÐΪ£¬¡°·ÇÀñ²»Îª¡±£¬ËäÎÞÔ¿³×Ò಻»áÂÒ´³¡£È»¶ø£¬ÄÇЩºÁÎÞµÀµÂ¹ÛÄîµÄµÁÔôÈ´Ïë·½Éè·¨ÀûÓø߿Ƽ¼ÊÖ¶ÎÇËÃÅ¿ªËø£¬Ê¹¹ã´ó¾ÓÃñ·À²»Ê¤·À¡£
Ϊʲô»á³öÏÖÕâÖÖÇé¿öÄØ£¿ÒòΪ´«Í³Ëø¾ß¶¼´æÔÚÖÂÃüµÄÈõµã£º µÚÒ»¡¢ Ëøо²ÉÓó£¼ûµÄÍ¡¢ÂÁ¡¢Ð¿µÈ²ÄÁÏ£¬µÖ¿¹²»ÁËÇ¿Á¦ÆÆ»µ£» µÚ¶þ¡¢ Ëø¾ßÖÆ×÷¹¤ÒÕ£¬¼¼ÊõÂäºó£¬ÎÞ·¨×èÖ¹¼¼ÊõÊֶεĿªÆô¡£
Ä¿Ç°£¬Êг¡ÉϺܶà¹úÄÚÍâµÄËø¾ß£¬Êµ¼ÊÉ϶¼²»¾ß±¸ÕæÕýµÄ·ÀµÁ¹¦ÄÜ¡£ÔÚ¹ß͵ÃæÇ°£¬Á½¸ù¸ÖË¿»ò¼¸¼þ¼òµ¥µÄ¹¤¾ß¾Í¿ÉÒÔ°ÑÕâЩËø´ò¿ª£¬ÓеĹß͵ÉõÖÁ¹«¿ªÑïÑÔ£º¡°Ã»ÓÐÎÒ´ò²»¿ªµÄËø¡£¡±Æäʵ£¬²»ÊÇËûÃǶà¸ßÃ÷£¬¶øÊÇÒ»°ãËø¾ß¼¼ÊõÔÀíÌ«¹ý¼òµ¥¡£Ãæ¶ÔÕâÒ»²Ð¿áµÄÏÖ×´£¬ÐÂʱ´úÌá³öÁËËø¾ß±ØÐë¸ïÃüµÄÆÈÇеÄÒªÇó¡£
1.2 µç×ÓÃÜÂëËøµÄ±³¾°
Ëæ×ÅÉç»á¿Æ¼¼µÄ½ø²½£¬ËøÒÑ·¢Õ¹µ½ÁËÃÜÂëËø¡¢´ÅÐÔËø¡¢µç×ÓËø¡¢¼¤¹âËø¡¢Éù¿ØËøµÈµÈ¡£ÔÚ´«Í³Ô¿³×µÄ»ù´¡ÉÏ£¬¼ÓÁËÒ»×é»ò¶à×éÃÜÂ룬²»Í¬ÉùÒô£¬²»Í¬´Å³¡£¬²»Í¬Éù²¨£¬²»Í¬¹âÊø¹â²¨£¬²»Í¬Í¼Ïñ¡££¨ÈçÖ¸ÎÆ¡¢ÑÛµ×ÊÓÍøĤµÈ£©À´¿ØÖÆËøµÄ¿ªÆô¡£´Ó¶ø´ó´óÌá¸ßÁËËøµÄ°²È«ÐÔ£¬Ê¹²»·¨Ö®Í½ÎÞ´ÓÏÂÊÖ£¬ÈËÃÇÒ²¾ÍÄܶÔ×ÔÉí²Æ²ú°²È«ÓÐÁ˸ü¶àµÄ±£ÕÏ¡£µ±½ñ°²È«ÐÅϢϵͳӦÓÃÔ½À´Ô½¹ã·º£¬ÌرðÔÚ±£»¤»úÃÜ¡¢Î¬