This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

msp430f2471

Other Parts Discussed in Thread: MSP430F2471, ADS1298, MSP430F247

    有用过 msp430f2471 这款芯片的吗? 从开始用就感觉不是很稳定。

    我用的是 msp430f2471 控制 ads1298,程序实验已经完成,多数情况下运行正常,有时会有这样的情况:

    用下载器连接电路板,直接下载程序并运行,电路板正常工作,断开下载器,直接上电,电路板不工作,通过LED亮灭的位置能知道是 msp430f247 与 ads1298 的SPI通讯有误。

    这种现象并不普遍,十块电路板中有那么一二块会出现,哪位高人指点下这是个什么情况?谢谢!

  • 觉得程序的问题可能性比较大,注意spi通讯的时序.

    但也有可能是电路的问题,不容易猜到

     

  •      SPI 通讯方面似乎只有初始化要注意,我的初始化程序如下:

    void  SPI_Init(void)

      P5SEL |= 0x0E;                            // P5.3,2,1 option select
      UCB1CTL1 |= UCSWRST;
      UCB1CTL0 |= UCMST + UCMSB + UCSYNC    //3-pin, 8-bit SPI master  
      UCB1CTL1 |= UCSSEL_2;                                    // SMCLK
      UCB1BR0 = 2;                          
      UCB1BR1 = 0;                              
      UCB1CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**
    }

    与1298通讯片段如下:

    BYTE  ADS_Init(void)
    {
          BYTE i;
          while(UCB1STAT & UCBUSY);
          UCB1TXBUF = SDATAC;                       //Stop Read Data Continuously mode
          for(i = 0; i < 0x40; i ++)
            _NOP();
          while(UCB1STAT & UCBUSY);
          UCB1TXBUF = 0x20;                           // Read From Register   001r rrrr, where r rrrr is the starting register address.  
          while(UCB1STAT & UCBUSY);
          UCB1TXBUF = 0x00;                         // 000n nnnn, where n nnnn is the number of registers to read – 1.

          while(UCB1STAT & UCBUSY);
          UC1IFG &= ~UCB1RXIFG;
          UCB1TXBUF = 0x00;                   
          while (!(UC1IFG & UCB1RXIFG));
          i = UCB1RXBUF;

         return  i;

    }

    由于大多数情况下运行正常,程序中我也找不出错误,请指点下还有要注意的地方吗? 谢谢!