11-14-2013 08:03 AM
I am running into a problem where the UART does not send out a responce to an incoming message until it gets a second incoming message. This causes the responce to the message to be delayed once and ultimatly is throwing off my PC app. In the attached image, you see two messages sent to the Zynq (yellow bytes) before the Transmitter sends the first responce (white bytes). No matter what interrupt manipulation I use, it is always delayed until the 2nd message comes in. I posted a capture of how it is supposed to look, from our current system. Could this be how I have the UART set up? I will post that at the very bottom of the thread also.
Here is how I have the interrupt handler configured.
void UART_int_Handler(void *CallBackRef, u32 Event, unsigned int ByteCount) { switch (Event) { case XUARTPS_EVENT_RECV_TOUT: break; case XUARTPS_EVENT_RECV_DATA: { XUartPs_Recv(&uartPtr, &incomingChar, 1); //Receive a byte tl_get((BYTE)incomingChar); //Process on the byte and store it in a buffer break; //The interrupt will fire again until the message is obtained } case XUARTPS_EVENT_SENT_DATA: tl_put(); //This sends data out byte by byte break; default: break; } }
#define UART_IXR_MASK (XUARTPS_IXR_RXOVR | XUARTPS_IXR_TXEMPTY) uartConfig = XUartPs_LookupConfig(XPAR_PS7_UART_1_DEVICE_ID); XUartPs_CfgInitialize(&uartPtr, uartConfig, uartConfig->BaseAddress); XUartPs_SetBaudRate(&uartPtr, 19200); setupIntr(); XUartPs_SetHandler(&uartPtr, UART_int_Handler, (void*) &uartPtr); XUartPs_SetInterruptMask(&uartPtr, UART_IXR_MASK); XUartPs_SetOperMode(&uartPtr, XUARTPS_OPER_MODE_NORMAL);
11-15-2013 05:13 AM
For some reason, the interrupt was not going off until 20 bytes were recieved. I set the RX threshold to 1, and things work as expected.
11-15-2013 05:13 AM
For some reason, the interrupt was not going off until 20 bytes were recieved. I set the RX threshold to 1, and things work as expected.
11-15-2013 12:54 PM