欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

專(zhuān)注電子技術(shù)學(xué)習(xí)與研究
當(dāng)前位置:單片機(jī)教程網(wǎng) >> MCU設(shè)計(jì)實(shí)例 >> 瀏覽文章

帶中斷MSP430G2553控制程序和錯(cuò)誤處理

作者:huqin   來(lái)源:本站原創(chuàng)   點(diǎn)擊數(shù):  更新時(shí)間:2014年04月08日   【字體:


MSP430G2553板LED在P1.0和P1.6,和P1.3連著一個(gè)按鈕開(kāi)關(guān),可以對(duì)其進(jìn)行中斷編程。
#include "MSP430G2553.h"
int ms,k,i;
char jj[]={
           0x01,0x00,0x40,0x00,0x01,0x00,0x40,0x00,0x40,0x00,0x01,
           0x00,0x40,0x00,0x01,0x00,0x41,0x00,0x41,0x00,0x41,0x00
          };
void delay(int ms)
{
  while(ms--)
   {
    for(i=0;i<120;i++);
   }
}
int main( void )
{
  // Stop watchdog timer to prevent time out reset
  WDTCTL = WDTPW + WDTHOLD;
  P1DIR |=BIT6+BIT0;
  P1IE  |=BIT3;
  P1IES |=BIT3;
  P1IFG &=~BIT3;
  _BIS_SR(GIE);
  while(1)
  {
    for(k=0;k<22;k++)
    {
     P1OUT=jj[k];
     delay(300);
    }
  }
}
 #pragma   vector=PORT1_VECTOR
 __interrupt void zhansan(void)
      {
     
        for(k=0;k<5;k++)
        {
           P1OUT |=BIT6+BIT0;
           delay(1000);
           P1OUT &=~(BIT6+BIT0);
           delay(1000);
        }
        P1IFG &=~BIT3;
      }
IAR調(diào)試msp430時(shí)出現(xiàn)警告提示:
The stack plug-n failed to set a breakpoint on "main". The Stack window will not be able to display stack contents. (You can change this setting in the Tool>Options dialog box.)需要進(jìn)行以下配置:
 1. iar->options->linker->output->format;
    選擇 Debug information for c-SPY選項(xiàng)
 2. iar->Tools->options->stack->去掉選項(xiàng)“stack pointer(s) not valid until program reaches”
 

關(guān)閉窗口

相關(guān)文章