Hello all.
I am implementing more features in my Stellaris Launchpad board (I am using the last Stellarisware installation package for LM4F devices, not Tivaware) and I wanted to stream ADC data as fast as I could to a interface app in a Windows PC. Starting with something simple, I was using UART0 with the UARTStdioInit(0); instruction to get it working (being the baudrate as default 115200).
//
// Initialize the UART.
//
ROM_SysCtlPeripheralEnable (SYSCTL_PERIPH_GPIOA);
ROM_GPIOPinConfigure (GPIO_PA0_U0RX);
ROM_GPIOPinConfigure (GPIO_PA1_U0TX);
ROM_GPIOPinTypeUART (GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
UARTStdioInit(0);
After that I called the function:
UARTStdioConfig(ulPortNum,1000000 , MAP_SysCtlClockGet());
to set up 1Mbps, which works fine for short strings via UARTprintf("string to send");
After that I tried to send an array of 1100 bytes of hexadecimal data, and that is my problem right now. I am using the function:
UARTwrite((uint8_t *)buf_msx,1100); which calls: MAP_UARTCharPut(g_ulBase, pcBuf[uIdx]);
So to my understanding, this function shouldn't return until all the data is correctly sent.
When I read the data in an hexadecimal terminal, I get only about 600 bytes of the 1100 expected.
---------------------------------------------------------------------------------------------------------------------------
Then I have tried to setup a udma (channel9 for UART0 Tx) with the same results.
UARTDMAEnable(UART0_BASE, UART_DMA_TX);
UARTEnable(UART0_BASE);
IntEnable(INT_UART0); //Enable the UART interrupt.
//uDMA initialization
// Enable uDMA peripheral
SysCtlPeripheralEnable(SYSCTL_PERIPH_UDMA);
uDMAEnable();
// Set uDMA control table
uDMAControlBaseSet(ucControlTable);
//choose 9 Channel to UART0TX
uDMAChannelAssign(UDMA_CH9_UART0TX);
uDMAChannelAttributeDisable(9, UDMA_ATTR_ALL);
uDMAChannelControlSet(9 | UDMA_PRI_SELECT,
UDMA_SIZE_8 | UDMA_SRC_INC_8 | UDMA_DST_INC_NONE | UDMA_ARB_4);
uDMAChannelTransferSet(9 | UDMA_PRI_SELECT, UDMA_MODE_BASIC, buf_msx,
(void *) (UART0_BASE + UART_O_DR), 1100/2);
uDMAChannelEnable(9);
....
....
....
//In the interrupt the rest and enable again
uDMAChannelTransferSet(9 | UDMA_PRI_SELECT, UDMA_MODE_BASIC, buf_msx,
(void *) (UART0_BASE + UART_O_DR), 1100/2);
uDMAChannelEnable(9);
If I split up the amount of Dma sent data in 16byte size packets in the interrupt, I get like 900 bytes, but not the whole frame.
Is there anything I am doing wrong?
Which is the max speed for the VirtualCOM?
Is there any limitation in size?
Is there any example for this?
Thank you