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.

[参考译文] MSP432E401Y:使用32768石英的 UART 通信

Guru**** 2535750 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1131567/msp432e401y-uart-com-using-32768-quartz

器件型号:MSP432E401Y

您好!

我尝试配置时钟、以便可以使用来自 RTOSC 的32768 XTAL 作为 UART、如下所示:

我编写以下代码只是为了测试该函数的单元、但它听起来不起作用。

/* DriverLib 包括*/
#include

/*标准包括*/
#include
#include
#include

/*通过控制台显示包括*/
#include "uartstdio.h"

空配置 UART (uint32_t 系统时钟)

/*启用到 GPIO 端口 A 和 UART 0的时钟*/
MAP_SysCtlPeripheralEnable (SYSCTL_Periph_GPIOA);
MAP_SysCtlPeripheralEnable (SYSCTL_Periph_UART0);

/*为 UART 0配置 GPIO 端口 A */
MAP_GPIOPinConfigure (GPIO_PA0_U0RX);
MAP_GPIOPinConfigure (GPIO_PA1_U0TX);
MAP_GPIOPinTypeUART (GPIO_Porta_base、GPIO_PIN_0 | GPIO_PIN_1);

/*将 UART 配置为 9600 bps 8-N-1格式*/
UARTStdioConfig (0、9600、系统时钟);

int main (空)

uint32_t systemClock;

/*将系统时钟配置为120 MHz */
系统时钟= MAP_SysCtlClockFreqSet (SYSCTL_OSC_EXT32、32768);

/*初始化串行控制台*/
ConfigureUART (systemClock);

/*打印横幅*/
UARTprintf ("我现在可以讲话\r\n);

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你好 Jonathan、

    我想了解为什么您可能希望使用32.768kHz 晶体而不是仅使用 PIOSC?

    我之前从未见过将 RTC 晶体用于 UART 的任何用例。 我无法真正评论它是否起作用。 我可以在劳动节假期回来时尝试测试、但我强烈建议只使用已证明有效的 PIOSC。

    此致、

    Ralph Jacobi