Request for Code Review and Support for DTC and UART Transmission Issue on R5F10BGD

Hi Team,

I am sharing with you the DTC and UART individual code for the R5F10BGD microcontroller. I am trying to transmit 17 bytes of data on UART through DTC.

In this code, I am using UART1 for reception and transmission and DTC1 in repeated mode for copying the RAM data (local data variable which needs to be transmitted) to the UART transmit SFR register (SDR10L).

I observed that I get the expected data on the first try after resetting the microcontroller, but I do not get it on the second try.

I kindly request you to review the code and provide the required support. If any more input is required, kindly let me know.



Parents Reply Children
  • Yes, I have already confirmed it from my side. For your understanding, I shared the code with you.

    Could you please check it from your side as well? It might be better.

  • After all observations and execution on UART with DTC implementation, we have come to the following conclusion:
    1. DTC on UART Transmission can work but to trigger at least one interrupt hit is required to start DTC. So manually one byte needs to Transmit through UART.
    2. After starting DTC, DTC copies the data on the UART Transmit Register one by one, and each byte interrupt will again hit and trigger the same DTC, and it goes like ISR recursion. So, the system will take the same time as normal UART.
         3. The system will not perform any other execution while copying the data using DTC.
    So, we can conclude that with DTC and without DTC, UART transmission will perform the same type of execution in both cases, and this will not affect software quality and performance.
    Kindly confirm that our understanding is correct.
  • Your understanding is correct. One point is that DTC and UART are not designed to work together automatically (like on RA family) so manual configurations are necessary.

    The DTC just improves the transfer from memory to transmit register. When DTC is used this occurs without CPU intervention and this can improve overall performance.

    So in both cases 1 bytes needs to be transferred from memory to the transmit register. This can be done with using CPU or without using CPU and instead using DTC controller.

    An improvement on performance when using DTC is expected but if your application is not very focused on increasing performance, this way may not be really useful.

  • Thanks for your reply,
    could you please see my 3rd point, and let me know if at a time only one hardware will work (CPU or DTC)
    what major difference we have in both cases?

  • The DTC and CPU use the same bus so the CPU cannot transfer data while DTC transfer is ongoing.

    But CPU can execute other processing while the DTC transfer is ongoing.