Ò»¡¢Ìî¿ÕÌâ 1¡¢Èô²ÉÓÃ6MHzµÄ¾§ÌåÕñµ´Æ÷£¬ÔòMCS-51µ¥Æ¬»úµÄÕñµ´ÖÜÆÚΪ____2/12us_____£¬»úÆ÷ÖÜÆÚΪ_______2us________¡£
2¡¢MCS-51µ¥Æ¬»ú¹²ÓÐ 5 ¸öÖжÏÔ´£¬ÓÉ IE ¼Ä´æÆ÷É趨ÖжϵĿª·ÅºÍ½ûÖ¹£»
ÿ¸öÖжÏÔ´ÓÐ Á½ ¸öÓÅÏȼ¶£¬ÓÉ IP ¼Ä´æÆ÷É趨¡£ 3¡¢µ¥Æ¬»úµÄÄÚ²¿RAMÇøÖУ¬¿ÉÒÔλѰַµÄµØÖ··¶Î§ÊÇ
_________20H~2FH_________£¬ÌØÊ⹦ÄܼĴæÆ÷ÖУ¬¿ÉλѰַµÄµØÖ·ÊÇ_______80H~FFH__________¡£
4¡¢MSC-51µ¥Æ¬»úÒý½ÅÐźÅÖУ¬ÐźÅÃû³Æ´øÉÏ»®Ïߵıíʾ ¿ÉÍâ½Óµç· »ò µÍµçƽ ʱ¸ÃÐźÅÓÐЧ£»
5¡¢ º¯Êý ÊÇCÓïÑԵĻù±¾µ¥Î»¡£ 6¡¢ÈôÓɳÌÐòÉ趨RS1¡¢RS0=0¡¢1£¬Ôò¹¤×÷¼Ä´æÆ÷R0¡«R7µÄÖ±½ÓµØַΪ____08H~0FH_____¡£ 7¡¢´®ÐпÚͨÐÅ·½Ê½2½ÓÊÕµ½µÄµÚ9λÊý¾ÝËÍ SCON ¼Ä´æÆ÷µÄ RB8 λÖб£´æ¡£
8¡¢MCS-51ÄÚ²¿Ìṩ 2 ¸ö¿É±à³ÌµÄ 16 λ¶¨Ê±/¼ÆÊýÆ÷£¬¶¨Ê±Æ÷ÓÐ 4 ÖÖ¹¤×÷·½Ê½¡£
9¡¢ÔÚC51ÖУ¬±äÁ¿µÄÊý¾ÝÀàÐÍ˵Ã÷Ϊbit£¬ÔòÆäÈ¡Öµ·¶Î§ÊÇ 0»ò1 ¡£ 10¡¢´®Ðпڷ½Ê½3·¢Ë͵ĵÚ9λÊý¾ÝÒªÊÂÏÈдÈë SCON ¼Ä´æÆ÷µÄ RB8 λ¡£
11¡¢MCS¡ª51µ¥Æ¬»úÍⲿÖжÏÇëÇóÐźÅÓеçƽ·½Ê½ºÍÂö³å·½Ê½£¬ÔÚµçƽ·½Ê½Ï£¬µ±²É¼¯µ½
P3.2»òP3.3Òý½Å µÄÓÐЧÐźÅΪµÍµçƽʱ£¬¼¤»îÍⲿÖжϡ£
12¡¢ CPUÓÖ³Æ MPU £¬Ò»°ãÓÉ ÔËËãÆ÷ ºÍ ¿ØÖÆÆ÷ Á½²¿·Ö×é³É¡£
13¡¢Ê¹ÓÃDPTR×÷¼äÖ·Ö¸Õë½øÐмĴæÆ÷¼ä½ÓѰַʱ£¬ÆäÑ°Ö·ÄÜÁ¦Îª ËùÓд洢Æ÷ ¡£ 14¡¢ÕûÐͱäÁ¿µÄÕ¼ÓõĴ洢¿Õ¼äÊÇ Á½¸ö×Ö½Ú £»×Ö·ûÐͱäÁ¿Õ¼ÓõĴ洢¿Õ¼äÊÇ Ò»¸ö×Ö½Ú
15¡¢ALUÖ¸µÄÊÇ ËãÊõ/Âß¼µ¥Ôª ¡£
16¡¢MCS-51µ¥Æ¬»úµÄÖжÏÔ´·Ö±ðÊÇ ÍⲿÖжÏ0 ¡¢ ¶¨Ê±/¼ÆÊýÆ÷0 ¡¢ ÍⲿÖжÏ1 ¡¢ ¶¨Ê±/¼ÆÊýÆ÷1 ¡¢ ´®ÐпڽÓÊÕ/·¢ËÍÖÐ¶Ï ¡£
17¡¢KeiL C51Èí¼þÖУ¬¹¤³ÌÎļþµÄÀ©Õ¹ÃûÊÇ____ .Uv2 ______£¬±àÒëÁ¬½ÓºóÉú³É¿ÉÉÕдµÄÎļþÀ©Õ¹ÃûÊÇ____ _.hex______
¶þ¡¢Ñ¡ÔñÌâ
1¡¢CÓïÑÔÖÐ×î¼òµ¥µÄÊý¾ÝÀàÐÍ°üÀ¨£¨ B/D £©¡£
A¡¢ÕûÐÍ¡¢ÊµÐÍ¡¢Âß¼ÐÍ B¡¢ÕûÐÍ¡¢ÊµÐÍ¡¢×Ö·ûÐÍ C¡¢ÕûÐÍ¡¢×Ö·ûÐÍ¡¢Âß¼ÐÍ D¡¢ÕûÐÍ¡¢ÊµÐÍ¡¢Âß¼ÐÍ¡¢×Ö·ûÐÍ
2¡¢ÏÂÁÐÃèÊöÖÐÕýÈ·µÄÊÇ£¨ D £©¡£
A¡¢³ÌÐò¾ÍÊÇÈí¼þ B¡¢Èí¼þ¿ª·¢²»ÊܼÆËã»úϵͳµÄÏÞÖÆ
C¡¢Èí¼þ¼ÈÊÇÂ߼ʵÌ壬ÓÖÊÇÎïÀíʵÌå D¡¢Èí¼þÊdzÌÐò¡¢Êý¾ÝÓëÏà¹ØÎĵµµÄ¼¯ºÏ 3¡¢ÏÂÁмÆËã»úÓïÑÔÖУ¬CPUÄÜÖ±½Óʶ±ðµÄÊÇ£¨ D £©¡£
A¡¢ ×ÔÈ»ÓïÑÔ B¡¢ ¸ß¼¶ÓïÑÔ C¡¢ »ã±àÓïÑÔ D¡¢»úÆ÷ÓïÑÔ
4¡¢MCS-5lµ¥Æ¬»úµÄ¶ÑÕ»ÇøÊÇÉèÖÃÔÚ( C )ÖС£
A¡¢Æ¬ÄÚROMÇø B¡¢Æ¬ÍâROMÇø C¡¢Æ¬ÄÚRAMÇø D¡¢Æ¬ÍâRAMÇø 5¡¢ÒÔÏÂÐðÊöÖÐÕýÈ·µÄÊÇ£¨ C £©¡£
A¡¢ÓÃCÓïÑÔʵÏÖµÄËã·¨±ØÐëÒªÓÐÊäÈëºÍÊä³ö²Ù×÷ B¡¢ÓÃCÓïÑÔʵÏÖµÄËã·¨¿ÉÒÔûÓÐÊä³öµ«±ØÐëÒªÓÐÊäÈë C¡¢ÓÃC³ÌÐòʵÏÖµÄËã·¨¿ÉÒÔûÓÐÊäÈ뵫±ØÐëÒªÓÐÊä³ö D¡¢ÓÃC³ÌÐòʵÏÖµÄËã·¨¿ÉÒÔ¼ÈûÓÐÊäÈëҲûÓÐÊä³ö 6¡¢¶¨Ê±Æ÷/¼ÆÊýÆ÷¹¤×÷·½Ê½1ÊÇ( D )¡£ A¡¢8λ¼ÆÊýÆ÷½á¹¹ B¡¢2¸ö8λ¼ÆÊýÆ÷½á¹¹ C¡¢13λ¼ÆÊý½á¹¹ D¡¢16λ¼ÆÊý½á¹¹ 8¡¢CÓïÑÔÌṩµÄºÏ·¨µÄÊý¾ÝÀàÐ͹ؼü×ÖÊÇ£¨ D £©¡£ A¡¢Double B¡¢short C¡¢integer D¡¢Char
9¡¢Æ¬ÄÚRAMµÄ20H¡«2FHΪλѰַÇø£¬Ëù°üº¬µÄλµØÖ·ÊÇ( B )¡£
A¡¢00H¡«20H B¡¢00H¡«7FH C¡¢20H¡«2FH D¡¢00H¡«FFH 10¡¢ÒÔÏÂÄÜÕýÈ·¶¨ÒåһάÊý×éµÄÑ¡ÏîÊÇ£¨ B £©¡£
A¡¢int a[2,5]={0,1,2,3,4,5}; B¡¢char a[ ]={0,1,2,3,4,5}; C¡¢char a={'A','B','C'}; D¡¢int a[5]=\11¡¢MCS-51µ¥Æ¬»úµÄ¸´Î»ÐźÅÊÇ( A )ÓÐЧ¡£ A¡¢¸ßµçƽ B¡¢µÍµçƽ C¡¢Âö³å D¡¢Ï½µÑØ 12¡¢8051µÄµ¥Æ¬»úµÄ¶ÑÕ»Ö¸Õ루 D £© A¡¢ Ö»ÄÜλÓÚÄÚ²¿RAMµÍ128×Ö½Ú·¶Î§ÄÚ B¡¢ ¿ÉλÓÚ ÄÚ²¿RAMµÍ256×Ö½Ú·¶Î§ÄÚ
C¡¢ ¿ÉλÓÚ ÄÚ²¿ERRAMÄÚ¡£ D¡¢¿ÉλÓÚÄÚ²¿RAM»òÍⲿRAMÄÚ
13¡¢ÔÚ´®Ðпڹ¤×÷ÓÚÒ첽ͨÐÅ·½Ê½Ê±£¬Æä½ÓÊÕÓÉ£¨ C £©À´Æô¶¯¡£ A¡¢REN B¡¢RI C¡¢RENºÍRI D¡¢TR 14¡¢´æ´¢16¡Á16µãÕóµÄÒ»¸öºº×ÖÐÅÏ¢£¬ÐèÒªµÄ×Ö½ÚÊýΪ£¨ A £© A¡¢ 32 B¡¢ 64 C¡¢ 128 D¡¢ 256
15¡¢ÉèMCS-51µ¥Æ¬»ú¾§ÕñƵÂÊΪ12MHz£¬¶¨Ê±Æ÷×÷¼ÆÊýÆ÷ʹÓÃʱ£¬Æä×î¸ßµÄÊäÈë¼ÆÊýƵÂÊӦΪ( B )
A¡¢2MHz B¡¢1MHz C¡¢500kHz D¡¢250kHz
16¡¢ÀûÓÃÏÂÁУ¨ D £©¹Ø¼ü×Ö¿ÉÒԸı乤×÷¼Ä´æÆ÷×é
A¡¢interrupt B¡¢sfr
C¡¢while D¡¢using
17¡¢C51ÖÐÒ»°ãÖ¸Õë±äÁ¿Õ¼ÓÃ( c )×Ö½Ú´æ´¢¡£
A¡¢Ò»¸ö B¡¢Á½¸ö C¡¢Èý¸ö D¡¢Ëĸö 18¡¢Ê¹ÓúêÀ´·ÃÎʾø¶ÔµØַʱ£¬Ò»°ãÐè°üº¬µÄ¿âÎļþÊÇ£¨ b £©
A¡¢reg51.h B¡¢absacc.h C¡¢intrins.h D¡¢startup.h 19¡¢µ¥Æ¬»úµÄ¶¨Ê±Æ÷/¼ÆÊýÆ÷¹¤×÷·½Ê½1ÊÇ( D )¡£
A¡¢8λ¼ÆÊýÆ÷½á¹¹ B¡¢2¸ö8λ¼ÆÊýÆ÷½á¹¹
C¡¢13λ¼ÆÊý½á¹¹ D¡¢16λ¼ÆÊý½á¹¹ 20¡¢´®ÐпÚÿһ´Î´«ËÍ( C )×Ö·û¡£
A¡¢1¸ö B¡¢1´® C¡¢1Ö¡ D¡¢1²¨ÌØ 21¡¢Êý¾ÝµÄ´æ´¢½á¹¹ÊÇÖ¸£¨ D £©¡£
A¡¢´æ´¢ÔÚÍâ´æÖеÄÊý¾Ý B¡¢Êý¾ÝËùÕ¼µÄ´æ´¢¿Õ¼äÁ¿ C¡¢Êý¾ÝÔÚ¼ÆËã»úÖеÄ˳Ðò´æ´¢·½Ê½ D¡¢Êý¾ÝµÄÂß¼½á¹¹ÔÚ¼ÆËã»úÖеıíʾ 22¡¢ÏÂÁйØÓÚÕ»µÄÃèÊöÖдíÎóµÄÊÇ£¨ C £©¡£ A¡¢Õ»ÊÇÏȽøºó³öµÄÏßÐÔ±í B¡¢Õ»Ö»ÄÜ˳Ðò´æ´¢
C¡¢Õ»¾ßÓмÇÒä×÷Óà D¡¢¶ÔÕ»µÄ²åÈëºÍɾ³ý²Ù×÷ÖУ¬²»ÐèÒª¸Ä±äÕ»µ×Ö¸Õë
23¡¢ÔڼĴæÆ÷¼ä½ÓÑ°Ö··½Ê½ÖУ¬¼äÖ·¼Ä´æÆ÷Öдæ·ÅµÄÊý¾ÝÊÇ( B )¡£ A¡¢²ÎÓë²Ù×÷µÄÊý¾Ý B¡¢²Ù×÷ÊýµÄµØÖ·Öµ C¡¢³ÌÐòµÄת»»µØÖ· D¡¢Ö¸ÁîµÄ²Ù×÷Âë 24¡¢MCS-51µ¥Æ¬»úµÄ¸´Î»ÐźÅÊÇ( A )ÓÐЧ¡£
A¡¢¸ßµçƽ B¡¢µÍµçƽ C¡¢Âö³å D¡¢Ï½µÑØ
25¡¢ÎªÁËʹģ¿é¾¡¿ÉÄܶÀÁ¢£¬ÒªÇó£¨ A £©¡£
A¡¢Ä£¿éµÄÄھ۳̶ÈÒª¾¡Á¿¸ß£¬ÇÒ¸÷Ä£¿é¼äµÄñîºÏ³Ì¶ÈÒª¾¡Á¿Ç¿ B¡¢Ä£¿éµÄÄھ۳̶ÈÒª¾¡Á¿¸ß£¬ÇÒ¸÷Ä£¿é¼äµÄñîºÏ³Ì¶ÈÒª¾¡Á¿Èõ C¡¢Ä£¿éµÄÄھ۳̶ÈÒª¾¡Á¿µÍ£¬ÇÒ¸÷Ä£¿é¼äµÄñîºÏ³Ì¶ÈÒª¾¡Á¿Èõ D¡¢Ä£¿éµÄÄھ۳̶ÈÒª¾¡Á¿µÍ£¬ÇÒ¸÷Ä£¿é¼äµÄñîºÏ³Ì¶ÈÒª¾¡Á¿Ç¿
26¡¢ÈôMCS-51µ¥Æ¬»úʹÓþ§ÕñƵÂÊΪ6MHzʱ£¬Æ临λ³ÖÐøʱ¼äÓ¦¸Ã³¬¹ý( 4 )¡£
A¡¢2¦Ìs B¡¢4¦Ìs C¡¢8¦Ìs D¡¢1ms
27¡¢ÒÔÏÂÑ¡ÏîÖпÉ×÷ΪCÓïÑԺϷ¨³£Á¿µÄÊÇ£¨ A £©
A¡¢£80 B¡¢£080 C¡¢£8e1.0 D¡¢£80.0e
28¡¢Äܹ»ÓÃ×ÏÍâ¹â²Á³ýROMÖгÌÐòµÄÖ»¶Á´æ´¢Æ÷³ÆΪ( C )¡£
A¡¢ÑÚĤROM B¡¢PROM C¡¢EPROM D¡¢EEPROM 29¡¢ÒÔϲ»Äܶ¨ÒåΪÓû§±êʶ·ûÊÇ£¨ D £©¡£
A¡¢Main B¡¢_0 C¡¢_int D¡¢sizeof
30¡¢ÏÂÑ¡ÏîÖУ¬²»ÄÜ×÷ΪºÏ·¨³£Á¿µÄÊÇ£¨ B £©¡£
A¡¢1.234e04 B¡¢1.234e0.4 C¡¢1.234e+4 D¡¢1.234e0
31¡¢´æ´¢16¡Á16µãÕóµÄÒ»¸öºº×ÖÐÅÏ¢£¬ÐèÒªµÄ×Ö½ÚÊýΪ£¨ D £© A¡¢ 32 B¡¢ 64 C¡¢ 128 D¡¢ 256
32¡¢ÒÔÏÂÑ¡ÏîÖкϷ¨µÄ×Ö·û³£Á¿ÊÇ£¨ D £©
A¡¢ \ B¡¢ ¡¯\\010¡¯ C¡¢ 68 D¡¢ D
33¡¢ÉèMCS-51µ¥Æ¬»ú¾§ÕñƵÂÊΪ12MHz£¬¶¨Ê±Æ÷×÷¼ÆÊýÆ÷ʹÓÃʱ£¬Æä×î¸ßµÄÊäÈë¼ÆÊýƵÂÊӦΪ( B )
A¡¢2MHz B¡¢1MHz C¡¢500kHz D¡¢250kHz
34¡¢ÏÂÁÐÊý¾Ý×Ö¶¨ÒåµÄÊý±íÖУ¬( D )ÊÇ´íÎóµÄ¡£ A¡¢DW ¡°AA¡± B¡¢DW ¡°A¡± C¡¢DW ¡°OABC¡± D¡¢DW OABCH Èý¡¢ÅжÏÌâ
£¨ ¡Ì¨w £©£±¡¢ÔÚ¶Ôijһº¯Êý½øÐжà´Îµ÷ÓÃʱ£¬ÏµÍ³»á¶ÔÏàÓ¦µÄ×Ô¶¯±äÁ¿ÖØзÖÅä´æ´¢µ¥Ôª¡£
£¨ ¡Ì £©2¡¢×Ô¶¯±äÁ¿ÊôÓÚ¾Ö²¿±äÁ¿¡£
£¨ ¡Ì £©3¡¢Continue ºÍbreak¶¼¿ÉÓÃÀ´ÊµÏÖÑ»·ÌåµÄÖÐÖ¹¡£ £¨ ¨w £©4¡¢ÔÚMCS-51ϵͳÖУ¬Ò»¸ö»úÆ÷ÖÜÆÚµÈÓÚ1.5¦Ìs¡£
£¨ ¡Ì £©5¡¢ÈôÒ»¸öº¯ÊýµÄ·µ»ØÀàÐÍΪvoid£¬Ôò±íʾÆäûÓзµ»ØÖµ¡£ £¨ ¡Ì £©6¡¢ËùÓж¨ÒåÔÚÖ÷º¯Êý֮ǰµÄº¯ÊýÎÞÐè½øÐÐÉùÃ÷¡£
£¨ ¡Ì £©7¡¢¶¨Ê±Æ÷Óë¼ÆÊýÆ÷µÄ¹¤×÷ÔÀí¾ùÊǶÔÊäÈëÂö³å½øÐмÆÊý¡£ £¨ ¡Ì £©8¡¢END±íʾָÁîÖ´Ðе½´Ë½áÊø¡£
£¨ ¨w £©9¡¢MCS-51µÄÏà¶ÔתÒÆÖ¸Áî×î´ó¸ºÌø¾àÊÇ127B¡£ £¨ ¨w £©10¡¢MCS-51µÄ³ÌÐò´æ´¢Æ÷Ö»ÊÇÓÃÀ´´æ·Å³ÌÐòµÄ¡£
£¨ ¡Ì £©11¡¢TMODÖеÄGATE=1ʱ£¬±íʾÓÉÁ½¸öÐźſØÖƶ¨Ê±Æ÷µÄµÄÆôÍ£¡£ £¨ ¨w £©12¡¢MCS-51µÄÌØÊ⹦ÄܼĴæÆ÷·Ö²¼ÔÚ60H¡«80HµØÖ··¶Î§ÄÚ¡£
£¨ ¡Ì £©13¡¢Æ¬ÄÚRAMÓëÍⲿÉ豸ͳһ±àַʱ£¬ÐèҪרÃŵÄÊäÈë/Êä³öÖ¸Áî¡£ £¨ ¡Ì £©14£®¼Ä´æÆ÷¼ä½ÓÑ°Ö·¿ÉÒÔ·ÃÎÊÊý¾Ý´æ´¢Æ÷£¬Ò²¿ÉÒÔ·ÃÎʳÌÐò´æ´¢Æ÷¡£ £¨ ¡Ì £©15£®ÔÚC51ÖУ¬½«Êý¾ÝµÄ´æ´¢ÀàÐÍ˵Ã÷Ϊdata£¬Ôò¸ÃÊý¾ÝÓ³ÉäµÄ´æ´¢
¿Õ¼äΪƬÄÚλѰַ¿Õ¼ä¡£ £¨ ¨w £©16£®MCS¡ª51ÊôÓÚ£±£¶Î»µÄµ¥Æ¬»ú¡£ £¨ ¨w £©17£®»ùÖ·¼Ó±äÖ·Ñ°Ö·Ö»ÄÜ·ÃÎʳÌÐò´æ´¢Æ÷¡£ £¨ ¡Ì £©18£®Î»µØÖ·ºÍ×Ö½ÚµØÖ·ÔÚÐÎʽÉÏûÓÐÇø±ð¡£ £¨ ¡Ì £©19£®Èç¹ûx=0xEA£¬ÔòÖ´ÐÐx<<2ºó£¬xµÄֵΪ0xA8¡£
£¨ ¡Ì £©20£®ÔÚMCS¡ª51µÄÖ¸ÁîϵͳÖУ¬µØÖ··ÖΪ×Ö½ÚµØÖ·ºÍλµØÖ·¡£ £¨ ¨w £©21£®»ã±àÓïÑÔÖ¸Áî¾ÍÊÇÖ¸Äܱ»CPUÖ±½ÓÖ´ÐеÄÖ¸Áî¡£ £¨ ¡Ì £©22£®ÔÚMCS¡ª51µÄÖ¸ÁîϵͳÖУ¬Î±Ö¸Áî¡¢Ö¸ÁÊÇÔÚ³ÌÐòÖ´ÐеÄʱºòÆð×÷Óá£
£¨ ¨w £©23¡¢(R7)±íʾ¹¤×÷¼Ä´æÆ÷R7ÖеÄÄÚÈÝ¡£ £¨ ¡Ì £©24¡¢ÈôÒ»¸öº¯ÊýµÄ·µ»ØÀàÐÍΪvoid£¬Ôò±íʾÆäûÓзµ»ØÖµ¡£ £¨ ¡Ì £©25¡¢¶¨Ê±Æ÷Óë¼ÆÊýÆ÷µÄ¹¤×÷ÔÀí¾ùÊǶÔÊäÈëÂö³å½øÐмÆÊý¡£
£¨ ¡Ì £©26¡¢SFRÖз²ÊÇÄܱ»8Õû³ýµÄµØÖ·£¬¶¼¾ßÓÐλѰַÄÜÁ¦¡£ £¨ ¡Ì £©27¡¢²»ÄÜÓá°sfr16¡± Ö±½Ó·ÃÎʶ¨Ê±Æ÷£¯¼ÆÊýÆ÷0ºÍ1¡£ £¨ ¨w £©28¡¢MCS-51µ¥Æ¬»úµÄ³ÌÐò´æ´¢Æ÷Ö»ÄÜÓÃÀ´´æ·Å³ÌÐòµÄ¡£ £¨ ¨w £©29¡¢´®¿ÚÖжϱêÖ¾ÓÉÓ²¼þÇå0¡£
£¨ ¡Ì £©30¡¢ÌØÊ⹦ÄܼĴæÆ÷µÄÃû×Ö£¬ÔÚC51³ÌÐòÖУ¬È«²¿´óд¡£ £¨ ¡Ì £©31¡¢¡°sfr¡±ºóÃæµÄµØÖ·¿ÉÒÔÓôøÓÐÔËËãµÄ±í´ïʽÀ´±íʾ¡£
£¨ ¡Ì £©32¡¢#include
ËÄ¡¢¼ò´ðÌâ
1¡¢ÔÚʹÓÃ8051µÄ¶¨Ê±Æ÷/¼ÆÊýÆ÷Ç°£¬Ó¦¶ÔËü½øÐгõʼ»¯£¬Æä²½ÖèÊÇʲô£¿ ½â£º1¡¢ÅäÖö¨Ê±Æ÷/¼ÆÊýÆ÷µÄ¹¤×÷·½Ê½¡£ 2¡¢¸øTHiºÍTLi¸³³õÖµ¡£ 3¡¢Æô¶¯¶¨Ê±/¼ÆÊýÆ÷¡£
4¡¢´ò¿ª¶¨Ê±/¼ÆÊýÆ÷ÖжϱêÖ¾¡£ 5¡¢´ò¿ª×ÜÖжϡ£ 2¡¢ÔÚÓд®ÐÐͨÐÅʱ£¬¶¨Ê±Æ÷/¼ÆÊýÆ÷1µÄ×÷ÓÃÊÇʲô£¬ÔõÑùÈ·¶¨´®ÐпڵIJ¨ÌØÂÊ£¿ ½â£ºÈç¹ûÓд®ÐÐͨÐÅʱ£¬¶¨Ê±Æ÷/¼ÆÊýÆ÷1µÄ×÷ÓÃÊÇ¿ØÖƲ¨ÌØÂÊ¡£ ´®ÐпڵIJ¨ÌØÂÊÊÇÓж¨Ê±Æ÷1µÄÒç³öÂʾö¶¨µÄ¡£
3£®51ϵÁе¥Æ¬»ú¾ßÓм¸¸öÖжÏÔ´£¬·Ö±ðÊÇÈçºÎ¶¨ÒåµÄ?ÆäÖÐÄÄЩÖжÏÔ´¿ÉÒÔ±»¶¨ÒåΪ¸ßÓÅÏȼ¶Öжϣ¬ÈçºÎ¶¨Òå? ½â£º51ϵÁе¥Æ¬»ú¾ßÓÐ5¸öÖжÏÔ´¡£
ÍⲿÖжÏ0¡¢1ÊÇÓÉEXiÍⲿÖжϱê־룬ITiÖжϴ¥·¢·½Ê½ºÍEA×ÜÖжϾö¶¨¡£
¶¨Ê±Æ÷/¼ÆÊýÆ÷0¡¢1ÊÇÓÉTMOD¹¤×÷·½Ê½¿ØÖÆÆ÷£¬THiºÍTLi³õʼֵ¿ØÖÆÆ÷£¬TRi¶¨Ê±/¼ÆÊýÆ÷¿ª¹Ø£¬ETi¶¨Ê±/¼ÆÊýÆ÷Öжϱê־λºÍEA×ÜÖжϾö¶¨¡£
´®ÐпڽÓÊÕ/·¢ËÍÖжÏÊÇÓÉSCON´®ÐпڿØÖƼĴæÆ÷£¬¶¨Ê±/¼ÆÊýÆ÷µÄ²¨ÌØÂÊÉèÖþö¶¨¡£
51ϵÁе¥Æ¬»úµÄ5¸öÖжÏÔ´¶¼¿ÉÒÔ±»¶¨ÒåΪ¸ßÓÅÏȼ¶¡£Ö»ÒªÔÚIPÖжÏÓÅÏȼ¶¿ØÖƼĴæÆ÷µÄÏàӦλ¿ØÖƾͿÉÒÔ£¡È磺´®ÐпÚÓÅÏȼ¶£ºPSÖÃ1£¬´®¿ÚͨОÍÊǸßÓÅÏȼ¶£¬·´Ö®ÎªµÍÓÅÏȼ¶¡£
4£®ÔÚC51ÓïÑÔÖУ¬¶¨ÒåMSC-51µ¥Æ¬»úµÄÖжϷþÎñº¯ÊýʱÐèҪʹÓùؼü×Öinterrupt m ½øÐж¨Òå¡£²ÎÊým¿ÉÒÔÈ¡ÄÇЩֵ£¿·Ö±ð±íʾºÎÖÖÒâÒ壿 ½â£ºm¿ÉÒÔÈ¥0~4£¬ÏàÓ¦¶ÔÓ¦¸÷¸öÖжϣ¬0ΪÍⲿÖжÏ0,1Ϊ¶¨Ê±Æ÷/¼ÆÊýÆ÷0,2ÍⲿÖжÏ1,3Ϊ¶¨Ê±Æ÷/¼ÆÊýÆ÷1,4Ϊ´®ÐпڽÓÊÕ/·¢ËÍÖжϡ£
5£® ʲôÊÇÖ¸ÁîÖÜÆÚ¡¢»úÆ÷ÖÜÆÚºÍÕðµ´ÖÜÆÚ£¿ ½â£ºÖ¸ÁîÖÜÆÚΪµ¥Æ¬»úÖ´ÐÐÒ»ÌõÖ¸ÁîµÄʱ¼ä£¬»úÆ÷ÖÜÆÚΪµ¥Æ¬»úÖ´ÐÐÒ»Ìõ×î¼òµ¥µÄÖ¸ÁîÐèÒªµÄʱ¼ä£¬Õðµ´ÖÜÆÚΪʯӢÕðµ´Æ÷Õðµ´Ò»´ÎµÄʱ¼ä¡£
6£®ÔÚC51ÖУ¬´æ´¢Æ÷ÀàÐÍÓм¸ÖÖ£¬ËüÃÇ·Ö±ð±íʾµÄ´æ´¢Æ÷ÇøÓòÊÇʲô£¿ ½â£ºÆ¬ÄÚÊý¾Ý´æ´¢Æ÷£¬Æ¬Íâ³ÌÐò´æ´¢Æ÷£¬Æ¬ÍâÊý¾Ý´æ´¢Æ÷¡£ ƬÄÚÊý¾Ý´æ´¢Æ÷ÓÉ00H~FFH£» ƬÍâ³ÌÐò´æ´¢Æ÷ÓÉ0000H~FFFFH£»
ƬÍâÊý¾Ý´æ´¢Æ÷ÓÉ0000H~FFFFH£»
7£®¼òÊö¶¯Ì¬¾Ö²¿±äÁ¿ºÍ¾²Ì¬¾Ö²¿±äÁ¿µÄÇø±ð¡£
½â£º¾²Ì¬¾Ö²¿±äÁ¿¾ßÓоֲ¿×÷ÓÃÓò£¬ËüÖ»±»³õʼ»¯Ò»´Î£¬×Ô´ÓµÚÒ»´Î±»³õʼ»¯Ö±µ½³ÌÐòÔËÐнáÊø¶¼Ò»Ö±´æÔÚ£¬ÇÒ¾²Ì¬¾Ö²¿±äÁ¿Ö»¶Ô¶¨Òå×Ô¼ºµÄº¯ÊýÌåʼÖտɼû¡£ ¶¯Ì¬¾Ö²¿±äÁ¿Ò²Ö»Óоֲ¿×÷ÓÃÓò£¬ËüÊÇ×Ô¶¯¶ÔÏó£¨auto£©£¬ËüÔÚ³ÌÐòÔËÐÐÆڼ䲻ÊÇÒ»Ö±´æÔÚ£¬¶øÊÇÖ»ÔÚº¯ÊýÖ´ÐÐÆÚ¼ä´æÔÚ£¬º¯ÊýµÄÒ»´Îµ÷ÓÃÖ´ÐнáÊøºó£¬±äÁ¿±»³·Ïú£¬ÆäËùÕ¼ÓõÄÄÚ´æÒ²±»Êջء£
8. MSC¡ª51µ¥Æ¬»úÖ¸ÁîϵͳÖÐÓÐÄļ¸ÖÖÑ°Ö··½Ê½£¿
½â£º1¡¢Á¢¼´Ñ°Ö·£¬2¡¢Ö±½ÓÑ°Ö·£¬3¡¢¼Ä´æÆ÷Ñ°Ö·£¬4¡¢¼Ä´æÆ÷¼ä½ÓÑ°Ö·£¬5¡¢±äÖ·Ñ°Ö·£¬6¡¢Ïà¶ÔÑ°Ö·£¬7¡¢Î»Ñ°Ö·¡£
Îå¡¢¼ÆËãÌâ
1ÒÑÖªÒ»µ¥Æ¬»úϵͳµÄÍâ½Ó¾§ÌåÕñµ´Æ÷µÄÕñµ´ÆµÂÊΪ12MHz£¬Çë¼ÆËã¸Ãµ¥Æ¬»úϵͳµÄÅĽÚP¡¢×´Ì¬S¡¢»úÆ÷ÖÜÆÚËù¶ÔÓ¦µÄʱ¼äÊǶàÉÙ?Ö¸ÁîÖÜÆÚÖеĵ¥×Ö½ÚË«ÖÜÆÚÖ¸ÁîµÄÖ´ÐÐʱ¼äÊǶàÉÙ?
½â£ºÊ±ÖÓÖÜÆÚ=1/12MHZ=0.0833us£»
ÒòΪһ¸ö»úÆ÷ÖÜÆÚ¿É·ÖΪ12¸öʱÖÓÖÜÆÚ£¬Ò»¸ö״̬ÖÜÆÚ¿É·ÖΪ2¸öʱÖÓÖÜÆÚ£¬Á½¸öʱÖÓÖÜÆÚ¿É·ÖΪ2¸ö½ÚÅÄ¡£
ËùÒÔ1¸ö½ÚÅÄPµÄʱ¼ä=ʱÖÓÖÜÆÚ=0.0833us,1¸ö״̬SµÄʱ¼ä=2*ʱÖÓÖÜÆÚ=0.167us£»
1¸ö»úÆ÷ÖÜÆÚ=12*ʱÖÓÖÜÆÚ=1us£»
Ö¸ÁîÖÜÆÚÖеõ¥×Ö½ÚÖ¸ÁîµÄÖ´ÐÐʱ¼äÊÇÒ»¸ö»úÆ÷ÖÜÆÚ=1us£»1¸öË«×Ö½ÚÖ¸ÁîµÄÖ´ÐÐʱ¼äÊÇÁ½¸öʱÖÓÖÜÆÚ=2us£»
2¡¢51µ¥Æ¬»ú£¬µ±fosc£½6MHzºÍfosc£½12MHzʱ£¬×î´ó¶¨Ê±¸÷Ϊ¶àÉÙ£¿
½â£ºµ±fosc£½6MHzʱ£»Ò»¸ö»úÆ÷ÖÜÆÚΪ2us£»¶¨Ê±Æ÷µÄ×î´ó¶¨Ê±ÊýΪ65536£» ʱ¼äT=65536*2us=131072us=0.131072s£»
µ±fosc£½12MHzʱ£»Ò»¸ö»úÆ÷ÖÜÆÚΪ1us£»¶¨Ê±Æ÷µÄ×î´ó¶¨Ê±ÊýΪ65536£» ʱ¼äT=65536*1us=65536us=0.065536s£»
3¡¢ÈôfOSC=6MHZ£¬ÒªÇóT1¶¨Ê±10ms£¬Ñ¡Ôñ·½Ê½0£¬×°Èëʱ¼ä³õÖµºóT1¼ÆÊýÆ÷×ÔÆô¶¯¡£¼ÆËãʱ¼ä³õÖµX=£¿²¢ÌîÈëTMOD¡¢TCONºÍTH1¡¢TL1µÄÖµ£¿
½â£ºfOSC=6MHZ£¬Ò»¸ö»úÆ÷ÖÜÆÚΪ2us£»·½Ê½0µÄ×î´ó¶¨Ê±ÊÇ8192*2=16384us£» 10ms=(8192-X)*12/fosc£»X=3192£» TMOD=0x00£»TCON=0x40£»IE=0x88£» TH1=0x0c£»TL1=0x78£»
Ò»¡¢Ìî¿ÕÌâ
1£®Ïà¶ÔÑ°Ö·ÊÇÒÔ PC µÄµ±Ç°ÖµÎª»ù×¼£¬¼ÓÉÏÖ¸ÁîÖиø³öµÄÏà¶Ô Æ«ÒÆÁ¿ ÐγÉÄ¿±êµØÖ·µÄ·½Ê½¡£
2£®AT89S51µ¥Æ¬»úµÄ1¸ö»úÆ÷ÖÜÆÚº¬ÓÐ 12 ¸ö¾§ÕñÖÜÆÚ»ò 6 ״̬ÖÜÆÚ¡£
3£®AT89S51µ¥Æ¬»ú½øÐÐÀ©Õ¹Ê±£¬Óà P0 ¿Ú×÷ΪµØÖ·/Êý¾Ý×ÜÏߣ¬Óà P2 ¿Ú×÷ΪµØÖ·×ÜÏ߸ß8λ¡£
4£®¼Ù¶¨ÀÛ¼ÓÆ÷AµÄÄÚÈÝ30H£¬Ö´ÐÐÖ¸Á1000H£ºMOVC A£¬@A+PCºó£¬°Ñ ³ÌÐò´æ´¢Æ÷1031Hµ¥ÔªµÄÄÚÈÝËÍÀÛ¼ÓÆ÷AÖÐ 5. Ö¸Áî¸ñʽÊÇÓÉ ²Ù×÷Âë ºÍ ²Ù×÷Êý ²¿·Ö×é³É¡£
6. AT89S51µ¥Æ¬»úµÄ´®ÐпڿØÖƼĴæÆ÷ÖÐÓÐ2¸öÖжϱê־룬ËüÃÇÊÇ TI ºÍ RI 7. JNC relÖ¸ÁîÖ´ÐÐʱ£¬µ±CYλΪ 0 ʱ³ÌÐò·¢ÉúÌøת¡£
8. µ¥Æ¬»úλѰַÇøµÄµ¥ÔªµØÖ·ÊÇ´Ó20Hµ¥Ôªµ½2FHµ¥Ôª£¬ÈôijλµØÖ·ÊÇ10H£¬ËüËùÔÚµ¥Ôª
µÄµØÖ·Ó¦¸ÃÊÇ 22H ¡£
9£®ÍⲿÖжÏ0µÄÖжÏÈë¿ÚµØַΪ 0003H £¬¶¨Ê±/¼ÇÊýÆ÷T1µÄÖжÏÈë¿ÚµØַΪ
001BH ¡£
10£®´®Ðпڹ¤×÷·½Ê½2Ϊ 9λÒ첽ͨÐÅ£¬ÈôSMOD=0£¬f OSC = 6 MHZ £¬ÔòÆäÏàÓ¦²¨ÌØÂÊΪ
6¡Á106/64 b/s
11£®¶ÑÕ»Ó¦×ñÑ ÏȽøºó³ö ¹æÂÉ£¬¶ÑÕ»Ö¸ÕëµÄ·ûºÅΪ SP 12¡¢³ÌÐò¼ÆÊýÆ÷PC´æ·ÅµÄÊÇ ÏÂÒ»ÌõÒªÖ´ÐÐÖ¸ÁîµÄµØÖ· £» 13¡¢Ö¸ÁîMOVX A, @DPTRµÄÑ°Ö··½Ê½ÊÇ ¼Ä´æÆ÷¼ä½ÓÑ°Ö· £º
14¡¢MCS-51·ÃÎÊROM¡¢Æ¬ÄÚRAM¡¢Æ¬ÍâRAMµÄÖ¸ÁîÖú¼Ç·û·Ö±ðΪ MOVC ¡¢
MOVºÍ MOVX ¡£
15¡¢»úÆ÷×Ö³¤Îª8룬Ôò[¡ª10]Ô = 8AH £¬[£10]·´ = F5H £¬[£
10]²¹ = F6H ¡£
16¡¢ÒѾÀÛ¼ÓÆ÷A = 97H£¬ÔòÖ´ÐÐÖ¸ÁîADD A, #7DHºó£¬A = 14H £¬C =
1 £¬OV = 0 £¬AC = 1 ¡£
¶þ¡¢µ¥ÏîÑ¡ÔñÌâ
1£®AT89S51µ¥Æ¬»úµÄ( d )¿ÚµÄÒý½Å£¬»¹¾ßÓÐÍâÖжϡ¢´®ÐÐͨÐŵȵڶþ¹¦ÄÜ¡£
a£©P0 b£©P1 c£©P2 d£©P3 2£®µ¥Æ¬»úÓ¦ÓóÌÐòÒ»°ã´æ·ÅÔÚ£¨ b £©
a)RAM b£©ROM c£©¼Ä´æÆ÷ d£©CPU
3£®ÒÑ֪ijÊýµÄBCDÂëΪ0111010101000010 ÔòÆä±íʾµÄÊ®½øÖÆÊýֵΪ£¨ b £©
a£© 7542H b£© 7542 c£© 75.42H d£© 75.42 4£®ÏÂÁÐÖ¸ÁîÖв»Ó°Ïì±ê־λCYµÄÖ¸ÁîÓУ¨ d £©¡£
a£©ADD A£¬20H b£©CLR c£©RRC A d£©INC A 5£®CPUÖ÷ÒªµÄ×é³É²¿²¿·ÖΪ£¨ a £© a£©ÔËËãÆ÷¡¢¿ØÖÆÆ÷ b£©¼Ó·¨Æ÷¡¢¼Ä´æÆ÷
c£©ÔËËãÆ÷¡¢¼Ä´æÆ÷ d£©ÔËËãÆ÷¡¢Ö¸ÁîÒëÂëÆ÷ 6£®AT89S51 µÄCPUÊÇ£¨ c £©Î»µÄµ¥Æ¬»ú
a£© 16 b£©4 c£©8 d£©×¼16
7£®µ±ÐèÒª´ÓAT89S51µ¥Æ¬»ú³ÌÐò´æ´¢Æ÷È¡Êý¾Ýʱ£¬²ÉÓõÄÖ¸ÁîΪ£¨ b £©¡£
a£©MOV A, @R1 b£©MOVC A, @A + DPTR c£©MOVX A, @ R0 d£©MOVX A, @ DPTR 8£®AT89S51µ¥Æ¬»úÖмȿÉλѰַÓÖ¿É×Ö½ÚÑ°Ö·µÄµ¥ÔªÊÇ£¨ a £©
a£©20H b£©30H c£©00H d£©70H 9£®ÏÂÁÐÄÄÌõÖ¸ÁîÊÇÕýÈ·µÄ£¨ d £©
a£© PUSH R2 b£© ADD R0, A c£© MOVX A @DPTR d£© MOV @R0, A
11.ҪʹÀÛ¼ÓÆ÷AµÄ¸ß4λÖÃΪ0000£¬µÍ4λ²»±ä£¬ÒÔÏÂÖ¸ÁîÕýÈ·µÄÊÇ B ¡£ £¨A£©ANL A, #0F0H £¨B£©ANL A, #0FH
£¨C£©ORL A, #0F0H £¨D£©ORL A, #0FH
12. ÀûÓô®Ðпڹ¤×÷·½Ê½1½øÐÐÒì²½´®ÐÐͨÐÅ£¬µ±Æ䲨ÌØÂÊΪ4800bps£¬Ã¿Ãë×î¶àÄÜ´«ËÍ A ¸ö×Ö·û¡£ £¨A£©480
£¨B£©960
£¨C£©4800
£¨D£©9600
13. C51ÖУ¬Òª±àдһ¸öÖжϺ¯Êý£¬Ôò±ØÐëÔÚº¯ÊýÃûºó¼Ó B ÐÞÊηû¡£ £¨A£©void
£¨B£©interrupt
£¨C£©using
£¨D£©unsigned
14. 51ϵÁе¥Æ¬»úϵͳÖÐÐèÀ©Õ¹32KByteµÄƬÍâRAM£¬ÔòÐèÒª C Ƭ6264£¨8K¡Á8bit£©¡£ £¨A£©1
£¨B£©2
£¨C£©4
£¨D£©8
15. Èôµ¥Æ¬»úµ±Ç°ÕýÔÚÖ´ÐиßÓÅÏȼ¶µÄÖжϷþÎñ£¬ÔòÒÔÏÂÄÜÏìÓ¦µÄÖжÏÊÇ D ¡£ £¨A£©¸ßÓÅÏȼ¶ÖÐ¶Ï £¨B£©Í¬ÓÅÏȼ¶ÖÐ¶Ï £¨C£©µÍÓÅÏȼ¶ÖÐ¶Ï £¨D£©ÒÔÉ϶¼²»ÄÜÏìÓ¦ 16. ¼üÅ̵ÄÈí¼þÏû³ý¼ü¶¶¶¯ÊÇͨ¹ý C À´ÊµÏֵġ£ £¨A£©¼ÓÂ˲¨Æ÷
£¨B£©ÖжÏ
£¨C£©ÑÓʱ
£¨D£©¼ÓRS´¥·¢Æ÷
Èý¡¢Ð´³öʵÏÖÏÂÁи÷ÒªÇóµÄÖ¸Áî»ò³ÌÐò¶Î
1¡¢½«80Hµ¥ÔªÖеÄÄÚÈÝÓëÊý¾Ý4FHÏà±È½Ï£¬ÏàµÈ·µ»Ø£¬²»ÏàµÈ½«80Hµ¥ÔªÖÃFFH·µ»Ø¡£ MOV A£¬80H
CJNE A£¬# 4FH£¬BD SJMP L1
BD£ºMOV 80H£¬#0FFH L1£º RET
2¡¢ÍⲿRAMµ¥Ôª2000HµÄÄÚÈÝ´«Ë͵½ÄÚ²¿RAMµ¥Ôª70H£»
MOV DPTR£¬#2000H MOVX A£¬@DPTR MOV 70H£¬ A
3¡¢½«32Hµ¥ÔªÖÐÄÚÈݵĵÚ7λȡ·´ºóË͸ø50H¡£ MOV A£¬32H CPL ACC.7 MOV C£¬ACC.7 MOV 50H£¬C
4¡¢Èô£¨50H£©=40H£¬ÊÔд³öÖ´ÐÐÒÔϳÌÐò¶ÎºóÀÛ¼ÓÆ÷A¡¢¼Ä´æÆ÷R0¼°ÄÚ²¿RAMµÄ40H¡¢41H¡¢42Hµ¥ÔªÖеÄÄÚÈݸ÷Ϊ¶àÉÙ£¿£¨5·Ö£© MOV A£¬50H £»(A)=40H MOV R0£¬A £»(R0)=40H MOV A£¬#00H £»(A)=0 MOV @R0£¬A £»(40H)=0 MOV A£¬ #3BH £»(A)=3BH MOV 41H£¬A £»(41H)=3BH MOV 42H£¬41H £»(42H)=3BH
(A)= 3BH £» (R0)= 40H£»
(40H)= 0£» (41H)= 3BH£»(42H)= 3BH
5¡¢½«ÍⲿÊý¾Ý´æ´¢Æ÷3000H¿ªÊ¼100¸ö´æ´¢µ¥ÔªµÄÄÚÈÝ´æÈë3070¿ªÊ¼µÄ´æ´¢µ¥
Ôª£¨9·Ö£©
MOV DPTR #3000H
MOV P2,#30H MOV R1,#70H
MOV R5,#100
L1£º MOVX A, @DPTR MOVX@R1,A
INC R1 INC DPTR DJNZ R5, L1 RET
ËÄ¡¢¶Á³ÌÐòÌî¿Õ
1£® CLR C
MOV A£¬ 4DH SUBB A,£¬ 4EH MOV 30H£¬ A MOV A£¬ 7FH SUBB A£¬ 2BH MOV 31H£¬ A SJMP $
£¨1£©¸Ã³ÌÐòµÄ¹¦ÄÜÊÇ£º Á½¸ö16λÊýµÄ¼õ·¨£º(7F4DH)£(2B4EH)£¬½á¹û´æÈëÄÚ²¿RAMµÄ30HºÍ31Hµ¥Ôª£¬31Hµ¥Ôª´æ²îµÄ¸ß8룬30Hµ¥Ôª´æ²îµÄµÍ8λ
£¨2£©Èô£¨4DH£©=06H£¬(4EH)=05H£¬£¨7FH£©=0AH£¬(2BH)=01H ÔòÖ´ÐÐÉÏÊö³ÌÐòºó£¨30H£©= 01 H¡££¨31H£©= 09 H¡£
2£® START£º MOV R0 , #40H MOV R7, #04H MOV A, @R0 LOOP£º INC R0
MOV 50H , @R0
CJNE A, 50H , NEXT NEXT£º JNC BIE1 MOV A, 50H BIE1£º DJNZ R7, LOOP MOV 30H, A RET
(1) ¸Ã³ÌÐòµÄ¹¦ÄÜÊÇ£º Çó³ö40H¡ª44HÖÐ×î´óµÄÎÞ·ûºÅÊý£¬²¢½«×î´óÊý´æÈë30HÖÐ
(2) Éè(40H)=12H, (41H)=22H , (42H)= 6EH, (43H)=5AH , (44H)= 8AH,
Ìîд³ÌÐòÖ´ÐкóµÄ½á¹û£¬(30H)= 8A H¡£
3.ÒÑÖª£¨30H£©=49H£¬£¨31H£©=2BH£¬£¨32H£©=0A3H£¬Ö´ÐÐÒÔϳÌÐò£º MOV R7£¬# 4 RR0£º MOV R6£¬# 3 CLR C
MOV R0£¬# 30H
RR1£º MOV A£¬@R0 RRC A MOV @R0£¬A INC R0
DJNZ R6£¬RR1 DJNZ R7£¬RR0 RET
´Ó¸Ã³ÌÐò¿É¿´³öÕâ¶Î³ÌÐòµÄ¹¦ÄÜÊÇ£º ½«ÄÚRAMÖÐ30H~32HµÄÄÚÈÝ ÓÒÒÆ4λ Ö´Ðкó½á¹û£º£¨30H£©= 04H £¬£¨31H£©= 92H £¬£¨32H£©= 0BAH ¡£
£¨3·Ö£©
4¡¢ ÒÑÖª£¨£Á£©£½58H£¬£¨30H£©=7FH£¬£¨P1£©=EAH£¬Ö´ÐÐÏÂÁгÌÐò£º MOV SP£¬#40H PUSH A PUSH 30H MOV A£¬P1 MOV 30H£¬A POP 30H POP A Ö´Ðкó½á¹û£º£¨SP£©= 40H £¬£¨A£©= 58H £¬£¨30H£©= 7FH £¬£¨41H£©= 58H ¡£
Îå¡¢¸ù¾ÝÌâÒ⣬°´ÒªÇó´ðÌâ¡£
1. AT98S51µ¥Æ¬»úP1¿ÚÉϽÓ8Ö»·¢¹â¶þ¼«¹Ü£¨¸ßµçƽÁÁ£¬µÍµçƽÃ𣩣¬Èô¾§ÕñƵÂÊÊÇ12MHz£¬Óö¨Ê±/¼ÆÊýÆ÷T0ÒÔ¹¤×÷·½Ê½1¹¤×÷£¬Ê¹8Ö»·¢¹â¶þ¼«¹Üÿ1Sµ¥Ñ»·µãÁÁ¡£
£¨1£© ¼ÆË㶨ʱ³õÖµ£¬Ð´³ö¹ý³Ì £¨2£© ¸ù¾ÝÏà¹Ø×¢ÊÍ£¬Ìîд³ÌÐò £¨3£©
´ð£º£¨1£©¶¨Ê±³õÖµ£º
£¨216£X£©¡Á1¦ÌS = 50mS
X=216£50000 =15536
£¨2£© MOV TMOD£¬#01H £»ÉèT0¹¤×÷·½Ê½
MOV DPTR£¬#15536 £»Öö¨Ê±³õÖµ50mS MOV TH0£¬DPH MOV TL0£¬DPL
MOV A£¬#01H £»ÖÃA³õÖµ SETB TR0 £»ÔÊÐí¶¨Ê±
LOOP£ºMOV R7£¬#20 £»É趨ʱ´ÎÊý MOV P1£¬A £»´ÓP1¿ÚÊä³ö
LOOP1£º JNB TF0£¬$ £»Åж϶¨Ê±50mSµ½Ã» CLR TF0 £»¶¨Ê±Ê±¼äµ½£¬TF0Çå0 MOV TH0£¬DPH £»ÖØÐÂÖö¨Ê±³õÖµ50mS MOV TL0£¬DPL
DJNZ R7£¬LOOP1 £»Åж϶¨Ê±´ÎÊýµ½Ã» RL A £»Êä³ö×óÒÆ
SJMP LOOP £»¼ÌÐøÑ»·Êä³ö END
2¡¢¸ù¾Ý¸ø¶¨´æ´¢ÀàÐͺÍÊý¾ÝÀàÐÍ£¬ÉùÃ÷ÏÂÁбäÁ¿£º
£¨1£©ÔÚƬÄÚRAMµÍ128×Ö½Ú¶¨ÒåÒ»¸öÓзûºÅÕûÐͱäÁ¿val£¬³õֵΪ100£»
(signed) int data val = 100;
£¨2£©ÔÚROM¶¨ÒåÒ»¸ö3ÔªËصÄÎÞ·ûºÅ×Ö½ÚÊý×énum£¬Êý×éÄÚÈÝ·Ö±ðΪ£º12H£¬34H£¬56£» unsigned char code num[3] = {0x12, 0x34, 56};
£¨3£©ÔÚƬÍâRAM¶¨ÒåÒ»¸öÖ¸ÏòÎÞ·ûºÅ×Ö½ÚÀàÐ͵ÄÖ¸Õë±äÁ¿p£» unsigned char xdata *p;
6¡¢¼òÊö¾ØÕóʽ8ÐÐ2ÁмüÅ̵Ť×÷¹ý³Ì£¬ÆäÖÐP1¿ÚÁ¬½Ó8¸ùÐÐÏߣ¬P3.0ºÍP3.1Á¬½Ó2¸ùÁÐÏß¡£
ÅжÏÊÇ·ñÓмü°´Ï£ºÏȸøÁÐÏßP3.0ºÍP3.1Ë͵͵çƽ£¬È»ºó¶ÁÐÐÏßP1µÄÖµ£¬ÅжÏP1ÊÇ·ñΪ0xff£»ÈôP1Ϊ0xffÔò±íʾûÓмü°´Ï£¬Ôò·µ»ØÖØÐÂÅжÏÊÇ·ñÓмü°´Ï£»ÈôP1²»Îª0xffÔò±íʾÓмü°´Ï£¬ÔòÑÓʱ10msÈ¥¶¶¶¯£¬ÔÙÖØжÁÐÐÏßP1¿Ú£¬ÔÙ´ÎÅжÏÊÇ·ñÓмü°´Ï¡£
ÈôȷʵÓмü°´Ï£¬ÔòÅжÏÄÄÒ»¸ö¼ü°´Ï£ºÏȸøµÚÒ»¸ùÁÐÏßP3.0Ë͵͵çƽ£¬¶øP3.1Ë͸ߵçƽ£¬È»ºó¶ÁÐÐÏßP1£¬ÅжÏP1ÊÇ·ñΪ0xff£»ÈôÊÇÔò±íʾ°´ÏµļüÔÚÕâµÚÒ»ÁУ»·ñÔò¸øµÚ¶þÁÐP3.1Ë͵͵çƽ£¬¶øP3.0Ë͸ߵçƽ£¬È»ºó¶ÁÐÐÏßP1£¬ÅжÏP1ÊÇ·ñΪ0xff£¬ÈôÊÇÔò±íʾ°´ÏµļüÔÚÕâµÚ¶þÁУ»ÕÒµ½°´¼üËùÔÚÁкó£¬ÔÙ¸ù¾Ý¶Áµ½µÄÐÐÏßÖµÖÐ0µÄλÖôӶøÅжϰ´¼üËùÔÚÐÐÏß¡£ È·¶¨°´¼üºó£¬Ö´Ðа´¼üËù¶ÔÓ¦µÄ·þÎñ³ÌÐò£»È»ºóµÈ´ý¼üÊÍ·Å£»°´¼üÊÍ·Åͨ¹ý¸øËùÓеÄÁÐÏßP3.0ºÍP3.1Ë͵͵çƽ£¬È»ºó¶ÁÐÐÏßP1µÄÖµÀ´½øÐÐÅжϣ»°´¼üÊͷźóÔÙ´ÎÑÓʱȥ¶¶¶¯£¬È»ºó·µ»ØÖØÐÂÅжÏÊÇ·ñÓмü°´Ï¡£
7¡¢¼òÊö51µ¥Æ¬»ú´®ÐÐË«»úͨÐŵĹý³Ì£¬Ð´Ã÷·¢ËͺͽÓÊÕʱÈíÓ²¼þ·Ö±ðÖ´ÐеIJÙ×÷¡£ ÏÈ
Êý¾Ý·¢ËÍʱ£¬ÔÚTI=0ʱ£¬CPU½«´ý·¢ËÍÊý¾ÝËÍÈëSBUF£¬Æô¶¯·¢ËÍ£»Êý¾ÝÓÉTXDÒý½Å°´Î»Ëͳö£¬·¢ËÍʱÖÓÓÉT1¿ØÖÆ£¬×îÏÈËͳöÆðʼ루0£©£¬È»ºóÒÀ´ÎÊÇ8λÊý¾Ý루µÍλÔÚÇ°£©£¬×îºóÊÇֹͣ루1£©£»Ò»Ö¡Êý¾Ý·¢ËÍÍê±Ïºó£¬Ó²¼þ×Ô¶¯½«TIÖÃ1£¬ÏòCPUÇëÇóÖжϣ»CPU½ÓÊÕµ½ÇëÇóÐźźó£¬Ð轫TIÇå0£¬È»ºó²ÅÄÜÆô¶¯ÏÂÒ»´Î·¢ËÍ¡£
Êý¾Ý½ÓÊÕʱ£¬ÔÊÐí½ÓÊÕλREN±ØÐëÖÃ1£¬½ÓÊÕÆ÷¿ªÊ¼¹¤×÷£»µ±½ÓÊÕµ½Æðʼ루0£©£¬Æô¶¯½ÓÊÕ£»ÔÚ²¨ÌØÂʵĿØÖÆÏ£¬°Ñ½ÓÊÕµ½µÄÊý¾ÝÒÀ´ÎÒÆÈëÒÆλ¼Ä´æÆ÷£»µ±½ÓÊÕÍêÒ»Ö¡Êý¾Ý£¬½«ÒÆλ¼Ä´æÆ÷ÖеÄÊý¾ÝËÍÈëSBUF£¬Í¬Ê±Ó²¼þ×Ô¶¯½«RIÖÃ1£¬ÏòCPUÇëÇóÖжϡ£CPU½ÓÊÕµ½ÇëÇóÐźźó£¬Ð轫RIÇå0£¬È»ºó²ÅÄÜÕý³£½ÓÊÕÏÂÒ»Ö¡Êý¾Ý¡£