DSPRelated.com
Forums

DM6437 UART - Problem for sending large data

Started by bora...@hotmail.com August 22, 2008
I am using DM6437EVM board. I am trying to Send and Receive data of upto 1024 bytes directly to and from an PC Application . DM6437 is able to send the data to PC Application but only few number of bytes. Few bytes are not getting received or send .
If I try to debug the application then it sends the data appropriately, but if try to send with running the application directly, then only few bytes gets transferred.
Is it overrun issue or its taking time to send the data ?

I am using FIFO mode for the same.
Thanks,
Amol Borawake
Amol,

On Fri, Aug 22, 2008 at 10:43 AM, wrote:
> I am using DM6437EVM board. I am trying to Send and Receive data of upto
> 1024 bytes directly to and from an PC Application . DM6437 is able to send
> the data to PC Application but only few number of bytes. Few bytes are not
> getting received or send .
> If I try to debug the application then it sends the data appropriately, but
> if try to send with running the application directly, then only few bytes
> gets transferred.
> Is it overrun issue or its taking time to send the data ?

My *guess* would be data overrun. If that is the case you will see
data as [C=char sent, D=char dropped] -the interval is not exact:
C-D-D-D-C-D-D-D-D-C-D-D-D-C-D-D-D-D-D-C-D-D-D-C-D-D-D-C-D-D-D-D-D-D-C-D-D-D-C
To test you can send [10 of each character]
AAAAAAAAAABBBBBBBBBB...ZZZZZZZZZZaaaaaaaaaa...zzzzzzzzzzz
and look at the pattern received.
Of course, looking at the code carefully will likely find the problem.

mikedunn
>
> I am using FIFO mode for the same.
> Thanks,
> Amol Borawake

--
www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
I am using DM6437EVM board. I am trying to Send and Receive data of upto 1024 bytes directly to and from an PC Application . DM6437 is able to send the data to PC Application but only few number of bytes. Few bytes are not getting received or send .
>If I try to debug the application then it sends the data appropriately, but if try to send with running the application directly, then only few bytes gets transferred.
>Is it overrun issue or its taking time to send the data ?
>
>I am using FIFO mode for the same.
>Thanks,
>Amol Borawake
>


Hi,
I tried that option too.
Sometimes I am getting false characters like 'M','N' getting recevied like
AAAAAAAAAABBBBBBBNBBBBBB... ( 'N' character while receiving 'B')
and even sometimes If I have send character 'B' 10 times ..then at receiving side I am getting 13 or 14 characters.

Do I need to reset the Transmission after sending 10 bytes or so ?
What should I do ?
AAAAAAAAAABBBBBBBNBBBBBB
Hallo Amol,

I also had this problem some time ago with the UART of DM6437 EVM. The EVMDM6437_UART_... functions didn't seem to work correctly. So I wrote an own small UART-API which then worked for my purposes. I am not sure what was the reason, maybe a bug in the xmt- and recvReady() functions.

Here are my functions, just check if they are useful for you.

Tobias

=========================
# include "evmdm6437_uart.h"

UART_Handle priv_EVMDM6437_UART_open( Uint16 id, Uint32 baudrate )
{
UART_Handle uart_handle;
Uint32 divisor;
unsigned int curLSR;

/*
* UART clk / ( baudrate * 16 )
* = 27,000,000 / ( 115200 * 16 )
* = 14
*/
divisor = 27000000 / ( baudrate * 16 );

switch ( id )
{
case 0:
uart_handle = ( UART_Handle )&UART_MODULE_0;
break;
case 1:
uart_handle = ( UART_Handle )&UART_MODULE_1;
break;
default:
return ( UART_Handle )-1;
}

uart_handle->regs->PWREMU_MGMT = 0; // Reset UART TX & RX components

b_usleep( 100 );

uart_handle->regs->DLL = ( divisor & 0xff ); // Set baud rate
uart_handle->regs->DLH = ( divisor >> 8 ) & 0xff;

uart_handle->regs->FCR = 0x0007; // Clear UART TX & RX FIFOs
// Enable TX & RX FIFOs 14-byte
uart_handle->regs->IER = 0x0000; // Disable interrupts
uart_handle->regs->LCR = 0x0003; // 8-bit words,
// 1 STOP bit generated,
// No Parity, No Stick paritiy,
// No Break control
uart_handle->regs->MCR = 0x0000; // RTS & CTS disabled,
// Loopback mode disabled,
// Autoflow disabled

uart_handle->regs->PWREMU_MGMT = 0x6001; // Emulation Free,
// Enable TX & RX componenets

curLSR = uart_handle->regs->LSR; // clear error bits by reading LSR

if ( ( uart_handle->regs->IIR & 0xC0 ) == 0xC0 )// Check FIFOs are Enabled
return uart_handle;
else
return ( UART_Handle )-1;
}
Int16 priv_EVMDM6437_UART_xmtReady( UART_Handle uart_handle )
{
return uart_handle->regs->LSR & (1<<5);
}
Int16 priv_EVMDM6437_UART_rcvReady( UART_Handle uart_handle )
{
unsigned int curLSR = uart_handle->regs->LSR;
if ( curLSR & 0x9E) {
++s_nRecvErrors;
}
return curLSR & 1;
}
void priv_EVMDM6437_UART_getChar( UART_Handle uart_handle, unsigned char* data )
{
*data = uart_handle->regs->RBR;
}

void priv_EVMDM6437_UART_putChar( UART_Handle uart_handle, unsigned char data )
{
uart_handle->regs->THR = data;
}
HI

Thanks for the suggestions.
I tried out with adding acknowledgement after sending some bytes. In this case, I am sending few no of bytes and receiving an acknowledgement after that. So with this way I am able to transfer the data upto almost 6,00,000 Bytes and may be more than that.

Thanks for the suggestion.

Thanks,
Amol Borawake