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.
Thanks,
Ashutosh SinghUART_DTC_RXTX_Ready2Work.zip
Hello,
Ashutosh said: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.
Do you mean that you get the first 17 bytes transmitted but not after this ?
You have set the DTC mode to 'Normal' mode - not 'Repeat' mode - so the source address will not be set back to 0xFF31E after the first 17 transfers complete.
Yes, after reset I can send successfully 17 bytes of data (any data) but after this I cannot send again without reset
I checked both cases, but result is same.
In Repeat mode after 17 transfers, the source address will be set back to the start of the buffer so the operation will be the same. Please check again your code and if it executes the UART send function properly.
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.
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.