Part Number: TMDS273GPEVM
Hardware :- TPR12 EVM (TMDS273GPEVM)
Software :- CCS 11.1.0.00011, MCU+ 8.2
I am sending data over UART continuously from MATLAB. I am trying to receive this data via UART in Interrupt mode on the EVM by modifying uart_echo test. I am continuously getting TIMEOUT error.
However, I can receive data correctly in POLLED mode. The only modification between the two tests is the transfer mode (from INTERRUPT to POLLED).
I have attached my MATLAB and test code on EVM.
Does the INTERRPUT mode expect some delay between transmissions?
clear
clc
s = serialport("COM5",115200)
idx0 = uint8(1);
idx1 = uint8(2);
idx2 = uint8(3);
idx3 = uint8(4);
idx4 = uint8(5);
idx5 = uint8(6);
idx6 = uint8(7);
var = 0;
while (var<50000)
write(s,idx0,"uint8");
write(s,idx1,"uint8");
write(s,idx2,"uint8");
write(s,idx3,"uint8");
write(s,idx4,"uint8");
write(s,idx5,"uint8");
write(s,idx6,"uint8");
var = var + 1;
end
void uart_echo(void *args)
{
UART_Params uartParams;
UART_Params_init(&uartParams);
uartParams.baudRate = 115200U;
uartParams.transferMode = UART_CONFIG_MODE_INTERRUPT;
uartParams.readMode = UART_TRANSFER_MODE_BLOCKING;
uartParams.writeMode = UART_TRANSFER_MODE_BLOCKING;
uartParams.dataLength = UART_LEN_8;
uartParams.stopBits = UART_STOPBITS_1;
uartParams.parityType = UART_PARITY_NONE;
uartParams.readCallbackFxn = NULL;
uartParams.writeCallbackFxn = NULL;
UART_Transaction uartTrans;
UART_Handle handle;
handle = UART_open(0U, &uartParams);
if (handle == NULL)
{
printf("UART handle is NULL");
}
UART_Transaction_init(&uartTrans);
uartTrans.timeout = 10000U;
while(1)
{
printf("########## New Read Started ##########\n");
uint32_t status;
uint8_t printidx = 0U;
uint8_t pu8TempUARTdata[7U];
uartTrans.buf = (void*)&pu8TempUARTdata[0];
uartTrans.count = 7;
status = UART_read(handle, &uartTrans);
if (status == 0 && pu8TempUARTdata[0] == 1)
{
while (printidx<7)
{
printf("Value at idx %u = %u\n", printidx, pu8TempUARTdata[printidx]);
printidx++;
}
printf("################################\n");
}
else if (status == 0 && pu8TempUARTdata[0] != 1)
{
printf("Character missed/ Incorrect read\n");
// while (printidx<7)
// {
// printf("Value at idx %u = %u\n", printidx, pu8TempUARTdata[printidx]);
// printidx++;
// }
printf("################################\n");
}
else
{
printf("UART Read Operation Failed\n");
}
}
return;
}