uart中断配置如下:
1. 中断映射到INT5
2. IER.bit5 = 1
3. uart本身的收发中断使能
4. 全局中断使能,enable_interrupt.
串口配置就是8位,不loopback,收,发启动,但是就是不能产生收中断,发空中断可以产生,奇怪?
还有我看了串口的配置中没有发现串口的复位在哪里配置?
另外我在150Mhz使用115200波特率发现,有误码,而且本身手册上也没有提到115200波特率,我想问是不是对这个波特率支持不够,请教如上问题,谢谢?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
如果你不确定uart的中断处理的流程的话,建议下载starterware,可参靠OMAPL138的starterware中的uart例子
以下为设置uart2的流程:
/* Enabling the PSC for UART2.*/
PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_UART2, PSC_POWERDOMAIN_ALWAYS_ON,
PSC_MDCTL_NEXT_ENABLE);
/* Setup PINMUX */
UARTPinMuxSetup(2, FALSE);
/* Enabling the transmitter and receiver*/
UARTEnable(SOC_UART_2_REGS);
/* 1 stopbit, 8-bit character, no parity */
config = UART_WORDL_8BITS;
/* Configuring the UART parameters*/
UARTConfigSetExpClk(SOC_UART_2_REGS, SOC_UART_2_MODULE_FREQ,
BAUD_115200, config,
UART_OVER_SAMP_RATE_16);
/* Enabling the FIFO and flushing the Tx and Rx FIFOs.*/
UARTFIFOEnable(SOC_UART_2_REGS);
/* Setting the UART Receiver Trigger Level*/
UARTFIFOLevelSet(SOC_UART_2_REGS, UART_RX_TRIG_LEVEL_1);
/*
** Enable AINTC to handle interrupts. Also enable IRQ interrupt in ARM
** processor.
*/
SetupInt();
/* Configure AINTC to receive and handle UART interrupts. */
ConfigureIntUART();
/* Preparing the 'intFlags' variable to be passed as an argument.*/
intFlags |= (UART_INT_LINE_STAT | \
UART_INT_TX_EMPTY | \
UART_INT_RXDATA_CTI);
/* Enable the Interrupts in UART.*/
UARTIntEnable(SOC_UART_2_REGS, intFlags);
while(1);