1 year ago
Using UART2 interrupt based
Posted bymahmed10610分 3 repliesHi , i am using custom board based on DA1468x and i am using UART 1 and UART 2 in my project.
UART 1 is being used for printf and i want to use UART2 to communicate between another board DA1468x based.
Writing is not an problem i have sucessfully wrote bytes to UART2.
Problem is that how should i read bytes from uart. Should i poll in another task for UART2 read or should i use interrupt. In my previous experience on other microcontroller i have used interrupt based uart reception but in this case i am confused. What do you suggest.
And if interrupt based method is recommeneded so is there any example code available for interrupt assigning to uart2 reception because i cannot find so far.
Thanks alot
1 year ago
Hi mahmed106,
You could use UART1 for the printf() and UART2 with the adapters. By default, the printf () is using UART2 but you could change it to UART1 if you should add #define CONFIG_RETARGET and #define CONFIG_RETARGET_UART HW_UART1 into custom_config_xxx.h heder file. For the UART2, we recommend the usage of the adapters. In general we recomned the usage of the adapters in a multitasking environment as the FreeRTOS. Be aware that UART2 has implemented HW flow control (rts/cts). There is no need for two different tasks for UART1 and UART2.
Thanks, PM_Dialog