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.

关于msp430f5438与CC2520之间SPI通讯问题

Other Parts Discussed in Thread: MSP430F5438, CC2520

您好!我现在调试CC2520芯片,用的是msp430f5438的SPI通信,但是SPI通信有些问题,请问需要配置msp430f5438中SPI的破特率吗?我用的是8M晶振。

这是我的SPI初始化

    UCB1CTL1 |= UCSWRST;                         
    UCB1BR0 = 0x00;
    UCB1BR1 = 0x00;
    UCB1CTL1 = UCSSEL0 | UCSSEL1;               
    UCB1CTL0 |= UCCKPH | UCSYNC | UCMSB | UCMST;
    UCB1CTL1 &= ~UCSWRST;  

 

请专家帮忙看下,读CC2520的寄存器的时候,得到的值总是不对,读什么寄存器都是0x80.

  • 请参考demo code里的spi配置如下:

    UCA0CTL1 |= UCSWRST;                      // **Put state machine in reset**

     UCA0CTL0 |= UCMST+UCSYNC+UCCKPL+UCMSB;    // 3-pin, 8-bit SPI master

                                               // Clock polarity high, MSB

     UCA0CTL1 |= UCSSEL_2;                     // SMCLK

     UCA0BR0 = 0x02;                           // /2

     UCA0BR1 = 0;                              //

     UCA0MCTL = 0;                             // No modulation

     UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**

     UCA0IE |= UCRXIE;                         // Enable USCI_A0 RX interrupt