Using UART2 interrupt based

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
mahmed106
Offline
Last seen:2 months 6 days ago
加入:2019-05-03所
Using UART2 interrupt based

Hi , 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

Keywords:
Device:
PM_Dialog
Offline
Last seen:3 days 13 hours ago
工作人员
加入:2018-02-08 11:03
Hi mahmed106,

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

mahmed106
Offline
Last seen:2 months 6 days ago
加入:2019-05-03所
So does this means that if

So does this means that if data is recieved on uart and i read it bit later i will recieve complete data or not?

I mean is there any hardware/software FIFO for uart reception, that i can read later or i have to read at that exact instance?

PM_Dialog
Offline
Last seen:3 days 13 hours ago
工作人员
加入:2018-02-08 11:03
Hi mahmed106,

Hi mahmed106,

According to the datasheet, only UART2 supports 16 bytes Transmit and receive FIFOs. There is DMA support on both UARTs.

Thanks, PM_Dialog