中级会员
- 积分
- 263
- 威望
- 199
- 贡献
- 22
- 兑换币
- 0
- 注册时间
- 2008-10-26
- 在线时间
- 21 小时
|
<><STRONG><FONT size=5>The refference project is as fellow:</FONT></STRONG></P><P>#include <hidef.h> /* common defines and macros */<BR>#include <mc9s12dg128.h> /* derivative information */<BR>#pragma LINK_INFO DERIVATIVE "mc9s12dg128b"</P><P>void delayms(int ms)<BR>{ <BR> int ii,jj;<BR> if (ms<1) ms=1;<BR> for(ii=0;ii<ms;ii++)<BR> for(jj=0;jj<1335;jj++); //16MHz--1ms <BR> } </P><P>void main(void) {<BR> /* put your own code here */<BR> unsigned char LedCnt=0;<BR> <BR> DDRB=0xFF;<BR> PUCR_PUPBE=1;<BR> <BR> EnableInterrupts;</P><P> for(;;) { <BR> <BR> LedCnt=(LedCnt>0XFE?0:++LedCnt);<BR> delayms(800); //修改延时以修改数据发送频率<BR> <BR> //低电平灯亮用这句,注释掉下面那句 <BR> PORTB=~LedCnt;<BR> <BR> //高电平灯亮用这句,注释掉上面那句 <BR> //PORTB=LedCnt; <BR> <BR> } /* wait forever */<BR> /* please make sure that you never leave this function */<BR> </P><P>在这个程序中 EnableInterrupts;是什么意思 具体的作用是什么呢???</P> |
|