微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI WIFI设计交流 > CC3200串口接收wifi转发遇到的问题

CC3200串口接收wifi转发遇到的问题

时间:10-02 整理:3721RD 点击:

串口接收用中断方式实现,收满一定数目之后通过udp协议无线发走,但是在测试中遇到问题,当串口发送端给3200发送串口数据的时候,每隔10ms发送一包,实际测试速度达到50kb/s(波特率2Mbps),但是查看接收到的数据会有丢包,为了排除是UDP协议的问题,我关闭串口功能,让3200自己产生递增数然后udp发走,实测无丢包,且速度在200kb/s以上,附上串口函数与发送函数,请教各位老师分析一下原因,谢谢!

void uart0_handle()
{
	 int lRetVal = MAP_UARTIntStatus(UARTA0_BASE, true);
	 if(lRetVal & UART_INT_RT) //串口空闲中断
	 {
	   while(UARTCharsAvail(UARTA0_BASE))
	   {
		   tempdata1[cnt1++] = MAP_UARTCharGet(UARTA0_BASE);
	   }
	   MAP_UARTIntClear(UARTA0_BASE, UART_INT_RT);
	 }
	 if(lRetVal & UART_INT_RX) //串口接收中断
	 {
	   while(UARTCharsAvail(UARTA0_BASE))
	   {
		   tempdata1[cnt1++] = MAP_UARTCharGet(UARTA0_BASE);
	   }
	   MAP_UARTIntClear(UARTA0_BASE, UART_INT_RX);
	 }
	 MAP_UARTIntClear(UARTA0_BASE,UART_INT_RT|UART_INT_RX); //清中断
}
while(1){
if(cnt1 == PACKAGE)	 {for(t=0;t<cnt1;t++) MAP_UARTCharPut(UARTA0_BASE,tempdata1[t]);
	//				iStatus1 = sl_SendTo(iSockID, tempdata1, PACKAGE, 0,(SlSockAddr_t *)&sAddr, iAddrSize);cnt1 = 0;	 }
}

建议先排除UART串口传输数据到CC3200 M4处理器部分的程序,如果大数据量的串口传输数据,建议打开DMA并且增加使能UART的FIFO功能,减小中断的次数,提高传输的效率,或者直接使用SPI的方式传输大数据给CC3200的M4内核,

其中关于

SPI DMA的例子:

https://github.com/severin-kacianka/cc3200_dma_spi_example/ cc3200_dma_spi_example

Here are two examples that show how to use SPI with DMA and FIFO on the CC3200. I hope that they are a useful starting point for anyone, who wants to work on SPI and DMA in the future.

The examples are compiling fine on Linux with gcc 4.9.3 from http://launchpad.net/gcc-arm-embedded. All you need to change is the path for the SDK in the Makefile. The hardware setup is similar to the SPI example in the SDK: just connect two CC3200 via cable (Pins GND, P05, P06, P07 and P08). I have set the following jumpers: J6, J7, J8. J9. J10, J11, J12, J13.

simple_spi_transfer is an example of an SPI transfer without DMA and FIFO. The master sends a buffer to the slave, reads it back in the next transfers and verifies the checksums.

transfer_1024_byte implements a simple SPI/DMA transfer that will transfer 1024 (or whatever DMA_SIZE is set to) bytes from the master to the slave and back. It then calculates the buffer's CRC checksum and (on the master) compares the send checksum to the received checksum.

transfer_64k shows how to transfer a 64k buffer from the master to the slave and back again.

windows contains a Makefile send to me by Matt van de Werken that also works using the Launchpad tools in a Cygwin enviroment

请问,CC3200串口支持哪些波特率?

你好,最大到3Mbps

The CC3200 device includes two UARTs with the following features:
• Programmable baud-rate generator allowing speeds up to 3 Mbps
• Separate 16 x 8 TX and RX FIFOs to reduce CPU interrupt service loading
• Programmable FIFO length, including 1-byte deep operation providing conventional double-buffered interface
• FIFO trigger levels of 1/8, 1/4, 1/2, 3/4, and 7/8
• Standard asynchronous communication bits for start, stop, and parity
• Line-break generation and detection
• Fully programmable serial interface characteristics
– 5, 6, 7, or 8 data bits
– Even, odd, stick, or no-parity bit generation and detection
– 1 or 2 stop-bit generation
• RTS and CTS hardware flow support
• Standard FIFO-level and End-of-Transmission interrupts
• Efficient transfers using μDMA
– Separate channels for transmit and receive
– Receive single request asserted when data is in the FIFO; burst request asserted at programmed FIFO
level
– Transmit single request asserted when there is space in the FIFO; burst request asserted at programmed
FIFO level
• System clock is used to generate the baud clock

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top