我想使用 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 ,那些不存在。它们的名称可能与您复制的示例不同。
关于c - msp430F1611 SPI 通信,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52530301/