c - msp430F1611 SPI 通信

标签 c spi msp430

我想使用 SPI 通信与任何其他 Controller (例如 Arduino )或其他 MSP430F1611 进行通信,我访问了此 (gist.github.com/.../3326502) 链接并尝试加载此代码,但有一个问题,

这些代码行显示错误,

 P1SEL = BIT1 + BIT2 + BIT4;
  P1SEL2 = BIT1 + BIT2 + BIT4;
  UCA0CTL1 = UCSWRST;                       // **Put state machine in reset**
  UCA0CTL0 |= UCMSB + UCSYNC;               // 3-pin, 8-bit SPI master
  UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**
  IE2 |= UCA0RXIE;  

错误是,

Error[Pe020]: identifier "P1SEL2" is undefined
Error[Pe020]: identifier "UCA0CTL1" is undefined 
Error[Pe020]: identifier "UCSWRST" is undefined 
Error[Pe020]: identifier "UCA0CTL0" is undefined 
Error[Pe020]: identifier "UCMSB" is undefined 
Error[Pe020]: identifier "UCSYNC" is undefined 
Error[Pe020]: identifier "UCA0RXIE" is undefined 

请帮我解决这个问题。

谢谢

尊敬。

最佳答案

这些寄存器在 MSP430F1611 中不可用。
据此register definition header file ,那些不存在。它们的名称可能与您复制的示例不同。

查看家庭手册:http://www.ti.com/lit/ug/slau049f/slau049f.pdf

关于c - msp430F1611 SPI 通信,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52530301/

相关文章:

c - 了解指针(在 C 中): converting int pointer to char and changing values

linux - 在 linux 上读写 spi eeprom

c - 树莓派 uint8_t 对齐

c++ - 向函数传递特定的数组索引值

C - 按钮按下一次,注册两次 - MSP430

c++ - 如何将编译选项传播到 CMake 中的子目录?

c - 为什么 y 没有被取消引用?

c - 为什么 fgets 不输入第一个值?

interrupt - STM32 SPI 在使用中断时丢弃数据

assembly - MSP430 CMP运算符