uart中断配置如下:
1. 中断映射到INT5
2. IER.bit5 = 1
3. uart本身的收发中断使能
4. 全局中断使能,enable_interrupt.
串口配置就是8位,不loopback,收,发启动,但是就是不能产生收中断,发空中断可以产生,奇怪?
还有我看了串口的配置中没有发现串口的复位在哪里配置?
另外我在150Mhz使用115200波特率发现,有误码,而且本身手册上也没有提到115200波特率,我想问是不是对这个波特率支持不够,请教如上问题,谢谢?
whagiew zhang:
你好,6747的uart支持115200应该是没有问题的。
你的中断未产生是怎么判断的?查查中断入口函数地址,全局中断,还有硬件管脚是否有信号之类的吧
Gary Wu:
如果你不确定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);
Jacob1:
回复 Gary Wu:
你好,谢谢,我再查查看。
yang jing:
赫赫,我的UART也有同样情况。增加延时,会好很多。如果有条件,加一个uart 协议。也会可靠很多。
quan da:
回复 yang jing:
你好,请问具体要怎么做
TI中文支持网
