打印

求高手帮忙

[复制链接]
1872|5
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
andyrulf|  楼主 | 2009-3-13 16:34 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
dc, ADC, AD, ADC1, TE
我用msp430f449开发系统附的光盘里IAR_3.40A C程序中ADC12的程序怎么通不过编译啊???代码如下:
#include          "msp430x44x.h" // Standard Equations

static unsigned int results;            // Needs to be global in this example
                                        // Otherwise, the compiler removes it
                                        // because it is not used for anything.

void main(void)

  WDTCTL = WDTPW+WDTHOLD;               // Stop watchdog timer
  P6SEL |= 0x01;                        // Enable A/D channel A0
  ADC12CTL0 = ADC12ON+SHT0_15;          // Turn on ADC12, 
  ADC12CTL1 = SHP;                      // Use sampling timer,
  ADC12IE = 0x01;                       // Enable ADC12IFG.0
  ADC12CTL0 |= ENC;                     // Enable conversions
  _EINT();                              // Enable interrupts  

  while(1)
  {
  ADC12CTL0 |= ADC12SC;                 // Start conversion
  _BIS_SR(LPM0_bits);                   // Enter LPM0 
   }
}

interrupt[ADC_VECTOR] void ADC12ISR (void)
{
  results = ADC12MEM0;                  // Move results,
  _BIC_SR_IRQ(LPM0_bits);               // 
}
编译报错:
Pe077:this declaration has no storage class or type specifier
Pe065:expected a “;”
把中断换成
#pragma vector = ADC_VECTOR
_interrupt void ADC_Interrupt(void)
//interrupt[ADC_VECTOR] void ADC12ISR (void)
{
  results = ADC12MEM0;                  // Move results, 
  _BIC_SR_IRQ(LPM0_bits);               // Clear LPM0, 
}
还是不行,报同样的错。
哪位知道的请帮个忙啊,感激涕零

相关帖子

沙发
linhai2009| | 2009-3-13 22:25 | 只看该作者

哪个是65行?

使用特权

评论回复
板凳
风的叶子| | 2009-8-19 16:39 | 只看该作者
应该是没有选对相应的单片机型号

使用特权

评论回复
地板
thf2008| | 2009-8-19 17:34 | 只看该作者
学习了

使用特权

评论回复
5
bit6019| | 2010-8-23 23:54 | 只看该作者
我见过的中断都是下面的写法,上面的也可以吗

使用特权

评论回复
6
msp430ing| | 2010-9-7 20:12 | 只看该作者
我用的是汇编,但是c的也看过,看到的也是下面的写法,下面的写法对不?哪位高手指点下

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

5

主题

13

帖子

1

粉丝