Hi,
I have 2 questions, more like 1 big question and a big doubt.
Let's suppose I'm trying to make a DMX transmitter on the launchpad (LM4F) about 6 DMX streams using 6 UART's (2 to 8) what would be the best approach to do that ? I need to keep the signal integrity (6 of them) while doing other stuff in the meanwhile (like reading from USB and/or other heavy CPU tasks).
The next question, or more like problem, is that I've been trying for a couple of days to trigger UART TX interrupt and I never get it triggered... here is my sample code:
Note: I do have UART1IntHandler in the vector table, and I shortened the code for better reading
// UART 1 Interrupt Handler
void UART1IntHandler(void)
{
unsigned long ulInts = ROM_UARTIntStatus(UART1_BASE, true);
ROM_UARTIntClear(UART1_BASE, ulInts);
UARTprintf("Got TX Interrupt");
}
// Initialization
void init()
{
ROM_FPULazyStackingEnable();
ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);
// Initialize debug UART
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
GPIOPinConfigure(GPIO_PA0_U0RX);
GPIOPinConfigure(GPIO_PA1_U0TX);
ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
UARTStdioInit(0);
}
// TX Only
void initUart1()
{
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
GPIOPinConfigure(GPIO_PB1_U1TX);
ROM_GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_1);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);
ROM_UARTConfigSetExpClk(UART1_BASE, ROM_SysCtlClockGet(), DMXSPEED, DMXFORMAT);
ROM_UARTFIFOLevelSet(UART1_BASE, UART_FIFO_TX1_8, UART_FIFO_RX1_8);
ROM_UARTIntDisable(UART1_BASE, 0xFFFFFFFF);
ROM_UARTIntEnable(UART1_BASE, UART_INT_TX);
ROM_IntEnable(INT_UART1);
ROM_UARTEnable(UART1_BASE);
}
// main function.
int main(void) {
init();
UARTprintf("Init completed.\nStarting UART1 Init.\n");
initUart1();
UARTprintf("Uart1 Init Completed.\nSending data to UART1 to trigger INT.\n");
ROM_UARTCharPutNonBlocking(UART1_BASE, 10);
while(1)
{
}
}
Best regards.