Topic

FAQ
Login Register
TLSR8253 using 2 UARTs
Apr 28, 2022 05:42

/

A

/A

I need to use 2 UARTs in my project with TLSR8253. I used an example with 1 UART using  DMA and it has been working fine. But I can't see how can I use 2 UARTs with DMA.

Is it possible?

When I look in dma.h file I can see the following definition of the DMA channels:

typedef enum{
   DMA0_UART_RX,
   DMA1_UART_TX,
   DMA2_RF_RX,
   DMA3_RF_TX,
   DMA4_AES_DECO,
   DMA5_AES_CODE,
   DMA6,
   DMA7_PWM,
}DMA_chn_Typdef;


So there are only DMA0 and DMA1 channels that can be used for UART DMA.

Does it mean that I can use only 1 UART with DMA?

And if I want to use the second UART I would need to use non-DMA, with Interrupts?

Can you please confirm?


In the example there was the following function to initialize UART:


void app_uart_init(void){

 //WaitMs(100);

 //leave enough time for SWS_reset when power on

 //note: dma addr must be set first before any other uart initialization! (confirmed by sihui)     

 uart_recbuff_init( (unsigned char *)&rec_buff, sizeof(rec_buff)); // uart tx/rx pin set    

 uart_gpio_set(UART_TX_PD7, UART_RX_PB7);

 uart_reset(); //will reset uart digital registers from 0x90 ~ 0x9f, so uart setting must set after this reset  

 //baud rate: 115200 uart_init(12, 15, PARITY_NONE, STOP_BIT_ONE); uart_dma_enable(1, 1);

 //uart data in hardware buffer moved by dma, so we need enable them first 

 irq_set_mask(FLD_IRQ_DMA_EN);

 dma_chn_irq_enable(FLD_DMA_CHN_UART_RX |FLD_DMA_CHN_UART_TX, 1); //uart Rx/Tx dma irq enable

 uart_irq_enable(0, 0); //uart Rx/Tx irq no need, disable them // irq_enable(); enabled in main.c !!!

}

There is a note "//note: dma addr must be set first before any other uart initialization! (confirmed by sihui)". But I can't see where dma addr is set?


wes58 [Author] Apr 28, 2022 10:24
0
/A

Hi Soyo,

So, there are 3 sets of pins with UART but only one UART can be used (DMA or non-DMA)?

So I can't use 1 DMA UART and 1 non-DMA uart?

If I can't do that, that would be the end of my project then. I will have to look for different BLE chip.

4 replies
TL_Soyo Apr 28, 2022 09:59
0
/A

Hi,

   TLSR8253 only support one hardware uart,and fuction"uart_recbuff_init" is used to set dma addr

wes58 [Author] Apr 28, 2022 10:24
0
/A

Hi Soyo,

So, there are 3 sets of pins with UART but only one UART can be used (DMA or non-DMA)?

So I can't use 1 DMA UART and 1 non-DMA uart?

If I can't do that, that would be the end of my project then. I will have to look for different BLE chip.

wes58 [Author] May 05, 2022 15:36
0
/A

Hi hk.wang

I don't know why I couldn't see your reply on the forum.

hk.wang in the post TLSR8253 using 2 UARTs replied to you
I suggest you may get to know the tlsr9 series on wiki, it support 2 uart.


Anyway, I had a look at the Datasheet of TLSR9218, which looks good. The problem is that TLSR9x chips or any development boards/dongles  are not available anywhere. Mouser is the distributor of Telink products but they don't have any TLSR9x products.