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.

UCD3138: some questions about void init_uart0(void) UCD3138 firmware

Part Number: UCD3138


Hello
I am learning the UCD3138 full-bridge hard switch development board firmware
I have some questions about void init_uart0(void)
Void init_uart0(void)
{
Uart0Regs.UARTCTRL3.bit.SW_RESET = 0;
Uart0Regs.UARTCTRL3.bit.CLOCK = 1; //internal clock select;
Uart0Regs.UARTCTRL3.bit.SW_RESET = 1;
Uart0Regs.UARTIOCTRLSCLK.bit.IO_FUNC = 0;
}
I don't know why in initializing UART0, SW_RESET = 0 first, and SW_RESET = 1 last, which is why?
The UART uses an internal clock. Which module is the internal clock and where is it set?

  • A low to high edge on SW_RESET bit, resets the UART peripheral including its internal counters, so it can starts working fresh and initialized properly and not having any random states inside.
    This UART module is used in several TI chips, in case of UCD3138, CLOCK=0 (external clock) is not supported.
  • Hello
    Can it be understood that when the UART is initialized, the software reset is masked to prevent the software reset from interfering with the UART initialization.
    After the initialization is completed, the software can be reset again, right?
    UCD3138 has 3 clock modules: T24, T16PWM and WD.
    Which module is the UART internal clock?
    Thank you
    ZJYL
  • Yes. The firmware can apply a reset at any time, even aftyer initialization.
    But it is usually not needed if you do not change anything in the UART configuration.

    As an example, if you apply an auto baud rate correction algorithm that modifies the baud rate setting you will need to apply reset after the change.
    But otherwise a reset may not be required.

    T24, T16PWM and WD are timer modules and not clock sources.

    The UART uses a 15.625 MHz clock for its operation.

  • Got it,Thank you!