资源简介

MSP430的C语言版跑马灯程序,调试通过,绝对可用,直接参考就行

资源截图

代码片段和文件信息

//
//    4 键 时钟程序
//    左边第一键 调整分钟 加一调整
//    左边第二键 调整时钟 加一调整
//    右边第一键 开启蜂鸣器
//    右边第二键 点亮发光二极管
//
//
#include 
# define  uint unsigned int
# define  uchar unsigned char

uchar time = 1 ;

void delay(int x)   // 5*x+12  nop
      {             //128- 23    256-49
      while(x--);   
      }             //192- 36    280- 54   448- 87

void main(void)

  WDTCTL = WDTPW + WDTHOLD;             // Stop WDT
  BTCTL = BTFRFQ1+BT_ADLY_250;  ;           // ACLK/(256*16)
  IE2 |= BTIE;                              // Enable BT interrupt
  P6DIR = 0xff ;
    _EINT();
  for(;;)                              
  {
    _BIS_SR(LPM3_bits);                    // CPU off
    _NOP();                             // Required only for C-spy
  }
}

// Timer A0 interrupt service routine
//interrupt[TIMERA0_VECTOR] void Timer_A (void)
#pragma vector=BASICTIMER_VECTOR
__interrupt void basic_timer_ISR(void)
    {
        time = time << 1 ;
        if(time == 0x80 )
            time = 1 ;
        P6OUT = time+0X80 ;
    }


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    .CA....      2661  2010-08-16 18:37  流水灯\413TEST.dep

    .CA....     11915  2007-05-24 22:56  流水灯\413TEST.ewd

    .CA....     43713  2007-05-23 11:29  流水灯\413TEST.ewp

    .CA....       161  2007-05-13 21:28  流水灯\413TEST.eww

    .CA....     14718  2007-05-13 23:18  流水灯\Debug\Exe\149test.d43

    .CA....      6401  2007-05-23 11:30  流水灯\Debug\Exe\413TEST.d43

    .CA....       164  2007-05-14 14:39  流水灯\Debug\Obj\149test.pbd

    .CA....       183  2010-08-16 18:35  流水灯\Debug\Obj\413TEST.pbd

    .CA....      5971  2010-08-16 18:35  流水灯\Debug\Obj\led_413.r43

    .CA....     21216  2007-05-13 23:18  流水灯\Debug\Obj\led_test.r43

    .CA....     28018  2007-05-13 21:49  流水灯\Debug\Obj\time_4k_413.r43

    .CA....      1128  2007-05-23 11:30  流水灯\led_413.c

    .CA....      5059  2007-05-14 14:39  流水灯\settings\149test.dbgdt

    .CA....       940  2007-05-14 14:39  流水灯\settings\149test.dni

    .CA....      3493  2007-05-14 14:39  流水灯\settings\149test.wsdt

    .CA....      5857  2010-08-16 18:37  流水灯\settings\413TEST.dbgdt

    .CA....       943  2010-08-16 18:37  流水灯\settings\413TEST.dni

    .CA....      4654  2010-08-16 18:37  流水灯\settings\413TEST.wsdt

     目录          0  2010-10-25 09:17  流水灯\Debug\Exe

     目录          0  2010-10-25 09:17  流水灯\Debug\List

     目录          0  2010-10-25 09:17  流水灯\Debug\Obj

     目录          0  2010-10-25 09:17  流水灯\Debug

     目录          0  2010-10-25 09:17  流水灯\settings

     目录          0  2010-10-25 09:17  流水灯

----------- ---------  ---------- -----  ----

               157195                    24


评论

共有 条评论