Other Parts Discussed in Thread: MSP430F5132
主题中讨论的其他器件:MSP430F5132
您好!
此设计使用 P3.0和 P3.1进行 UART 通信、但无法使其正常工作。 我可以使用我找到的示例、使用 P1.1和 P1.2进行串行通信。 但是、这些引脚被分配为 ADC 输入。 我认为我的问题是、我不熟悉如何映射到这些引脚。
谢谢、
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.
Other Parts Discussed in Thread: MSP430F5132
您好!
此设计使用 P3.0和 P3.1进行 UART 通信、但无法使其正常工作。 我可以使用我找到的示例、使用 P1.1和 P1.2进行串行通信。 但是、这些引脚被分配为 ADC 输入。 我认为我的问题是、我不熟悉如何映射到这些引脚。
谢谢、
您好、Rodney、
同样、这些引脚已在 UART 的代码中设置。 您需要为 UART 回波添加的唯一内容是为 ISR 编写以下内容:
while (!(UCA0IFG&UCTXIFG)); // USCI_A0 TX 缓冲器就绪?
UCA0TXBUF = UCA0RXBUF; // TX -> RXed 字符
我在 TID 代码中看到的唯一缺失是、虽然它将这些引脚映射到用于 UART 的 eUSCI 模块、但我在代码中看不到这些引脚被设置为它们的辅助功能的任何位置 (它们需要用于引脚映射)。 因此、请尝试在 init_io 函数中包含以下行:
P3SEL |= BIT0;
P3SEL |= BIT1;
请尝试一下、并告诉我它是否起作用、
Nathan