ÓÐûÓÐÈËÓùýÁèÑôµ¥Æ¬»ú£¿
ÈËÆø£º
¡¾×ÖÌ壺´ó ÖРС¡¿
·¢²¼Ê±¼ä£º2007-09-12 08:40:26
>>>>>>>>ÌáÎÊÓÐûÓÐÖªµÀÁèÑô61ϵÁеĵ¥Æ¬»ú£¬ÔÚC±à³ÌʱÈçºÎµ÷ÓÃÖжϡ£¡£¡£
ÐÝ ÏÐ ¾Ó ±à¼
>>>>>>>>ÐÝÏÐÑøÉúÍø»Ø´ð£ºÎÒÕâÀïÓÐÒ»¸ö¶¨Ê±Æ÷AµÄÖжϵ÷ÓÃ,³ÌÐò±¾ÉíÄã²»ÐèҪȥÀí½âËüµ½µ×ÏëÒª×öʲô....ÄãÖ»ÐèÒª²Î¿¼Ï¸ñʽ,´ó¸Å¾ÍÊÇÕâÑùµÄ:
#include"hardware.h"
#include"unSPMACRO.h"
main()
{
int a,b,c;
INT_OFF();
*Port_IOA_Dir=0xffff;
*Port_IOA_Attrib=0xffff;
*Port_IOA_Data=0xffff;
*Port_IOB_Dir=0xffff;
*Port_IOB_Attrib=0xffff;
*Port_IOB_Data=0x00ff;
a=C_D8;
c=C_B1;
b=C_Fosc_256;
*Port_TimerA_Ctrl=a+b+c;
*Port_TimerA_Data=0xffff;
*Port_INT_Ctrl=0x1000;
INT_IRQ();
while(1)
{*Port_Watchdog_Clear=0x0001;
}
}
int a[200]={0xFFF0,0xFFEF,0xFFF1,0xFFEE,0xFFF1,0xFFED,0xFFF2,0xFFEC,0xFFF3,0xFFEB,0xFFF4,0xFFEA,0xFFF5,0xFFE9,0xFFF6,0xFFE8,0xFFF7,0xFFE8,0xFFF8,0xFFE7,0xFFF8,0xFFE6,0xFFF9,0xFFE5,0xFFFA,0xFFE5,0xFFFA,0xFFE4,0xFFFB,0xFFE3,0xFFFC,0xFFE3,0xFFFC,0xFFE2,0xFFFD,0xFFE2,0xFFFD,0xFFE2,0xFFFD,0xFFE1,0xFFFE,0xFFE1,0xFFFE,0xF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