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.

[参考译文] RTOS/LAUNCHXL-CC2650:如何修改 serial_bootloader 代码以使用固定的11520 UART 波特率

Guru**** 2568565 points


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

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/589370/rtos-launchxl-cc2650-how-to-modify-serial_bootloader-code-to-use-fixed-11520-uart-baudrate

器件型号:LAUNCHXL-CC2650

工具/软件:TI-RTOS

 在 serial_bootloader 工程中、UART 波特率似乎通过以下代码自动获取:

   while ((ui32Interface =

               UARTAutoBaud (\ui32Ratio)= 0)

 

现在、我们 要使用115200的固定波特率。 如何修改以使用固定的115200波特率?

 

我在 UARTConfig()函数中找到以下代码。 但没有有关如何使用的说明文档。

   HWREG (UART0_BASE + UART_O_IBRD)= iProcRatio >> 6;

   HWREG (UART0_BASE + UART_O_FBRD)= iProcRatio & UART_FBRD_DIVFRAC_M;

 

我应该使用以下代码吗?

   HWREG (UART0_BASE + UART_O_IBRD)= 115200 >> 6;

   HWREG (UART0_BASE + UART_O_FBRD)= 115200和 UART_FBRD_DIVFRAC_M;

 

 

谢谢。

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

    您可以查看 driverlib 函数、了解在直接访问寄存器时如何设置波特率。
    文件:C:\ti_tirtos_cc13xx_cc26xx_2_21_00_06\products\cc26xxware_2_24_03_17272\driverlib\uart.c
    函数名称:UARTConfigSetExpClk