hello everyone,
How can I configure the DMA to send data without using the function uart2_open()?
Currently I configure my own UART read callback without uart2_open(), so I don't use the DMA. The reason is as follows:
I'm trying to use the CC2340 UART for LIN communication. I need to use the read callback to complete the reception of the LIN message.
There is an example uart2callback which is provided in SDK 7.10, but the read callback has a delay due to the DMA enabled in the function uart2_open().
This delay P0 is terrible for LIN communication.
In LIN communication I only need to receive 1 Byte, so I don't need DMA and FIFO, but their enable causes delay with Receiving.
However, with the function HwiP_create() I successfully configured a UART read callback without DMA and FIFO. It works good and no long receive delays.
For UART transmit, there is a function UARTPutChar() in SDK 7.10. (Path: simplelink_lowpower_f3_sdk_7_20_00_01_eng\source\ti\devices\cc23x0r5\driverlib)
//***************************************************************************** // // Blocks until there is space in the data register, and writes a byte to it // //***************************************************************************** void UARTPutChar(uint32_t base, uint8_t data) { // Wait until space is available. while (HWREG(base + UART_O_FR) & UART_FR_TXFF) {} // Send the char. HWREG(base + UART_O_DR) = data; }
Very weirdly my code has gotten stuck in this while loop, 2 times.
I never found out why and am very afraid of this happening again.
So is it possible to configure the UART transmit separately as DMA transmit and not use the function uart2_open()?
Is there any info available?
Thank you
Best Regards,
Peter