This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

facing problem in serail reception UART(LR-232) daughter card with dsk6713!!!



Hello Everyone,

                         I am currently working  on an application using  dsk6713 for which i need uarts for serial data transmission and reception.for this i am using LR-232 uart daughter cards they also shipped demo programs with them.It works fine for serial transmission but reception part which is my real concern is confined to few bytes(means i received few bytes correct and rest of other are garbage).I made a loop back test program which receive serial data from pc(docklight application) to dsk6713 and send it back to pc again.following is my code it is interrupt based program which use HWi4 for serial interrupt and takes action as per requirement kindly guide me if there is any thing wrong in code.

#include "dsk6713_aic23.h"
#include "dsk6713_dip.h"
#include "dsk6713_led.h"
#include <stdlib.h>
#include <stdio.h>
#include "dsk6713.h"
#include <math.h>
#include <string.h>
#include <string.h>
#include "pc_demo.h"
#include <csl.h>
#include <string.h>

#define CHANNEL_TO_USE 4
#define Null 0
#define PI 3.1415926535897932384626433832795

//functions decalartion.

unsigned int UART_xmit_count(int chn);
int UART_send_block (int chn, unsigned char* buf, unsigned int length);
void initialize_UART (int chn, unsigned char divisor);
int UART_recv_block (int chn, unsigned char* buf, unsigned int length);
void delay(long value);
int UART_recv_byte (int chn, unsigned char* byte);
void ext_int(void);
unsigned int UART_recv_count(int chn);
unsigned int UART_xmit_count(int chn);

Uint32 fs = DSK6713_AIC23_FREQ_96KHZ;

unsigned char heading2[] = {" This demo program verifies the sending and receiving\015\012"};

unsigned char heading3[] = {" of data to and from the DSK. Type a number from 1-3,\015\012"};
unsigned char heading4[] = {" and the DSK will respond with the appropriate message\015\012\012"};

unsigned char menu[] = {" ---Menu---\015\012 1: Send FOX message\015\012 2: Send string of digits\015\012 3: Send Character set\015\012\012"};
unsigned char responLR-232-Tech_Ref.pdfse1[] = {" THE QUICK BROWN FOX JUMPS OVER A LAZY DOG 01234567890\015\012\012"};
unsigned char response2[] = {" 01234567890123456789012345678901234567890123456789\015\012\012"};
unsigned char response3[] = {" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\015\012\012"};
unsigned char bad_response[] = {" *** Please press 1,2 or 3 ***\015\012\012"};

void initialize_UART (int chn, unsigned char divisor)

{
switch (chn)
{
case 1:
// channel 1
UART_LCR1 = 0x80; // Set "Divisor Latch Access Bit"
UART_DLL1 = divisor; // Lower 8 bits of divisor
UART_DLM1 = 0x00; // Upper 8 bits of divisor

UART_LCR1 = 0x00; // Clear DLAB bit in Line Control Register
UART_LCR1 = 0x03; // 8 data bits, 1 stop bit, no parity
UART_IER1 = 0x01; // Enable RX int.
UART_FCR1 = 0x09; // Enable FIFO
UART_MCR1 = 0x0b; // Take Interrupt signals out of 3-state
break;
case 2:
// channel 2
UART_LCR2 = 0x80; // Set "Divisor Latch Access Bit"
UART_DLL2 = divisor; // Lower 8 bits of divisor
UART_DLM2 = 0x00; // Upper 8 bits of divisor

UART_LCR2 = 0x00; // Clear DLAB bit in Line Control Register
UART_LCR2 = 0x03; // 8 data bits, 1 stop bit, no parity
UART_IER2 = 0x01; // Enable RX int.
UART_FCR2 = 0x09; // Enable FIFO
UART_MCR2 = 0x0b; // Take Interrupt signals out of 3-state
break;
case 3:
// channel 3
UART_LCR3 = 0x80; // Set "Divisor Latch Access Bit"
UART_DLL3 = divisor; // Lower 8 bits of divisor
UART_DLM3 = 0x00; // Upper 8 bits of divisor

UART_LCR3 = 0x00; // Clear DLAB bit in Line Control Register
UART_LCR3 = 0x03; // 8 data bits, 1 stop bit, no parity
UART_IER3 = 0x01; // Enable RX int.
UART_FCR3 = 0x09; // Enable FIFO
UART_MCR3 = 0x0b; // Take Interrupt signals out of 3-state
break;
case 4:
// channel 4
UART_LCR4 = 0x80; // Set "Divisor Latch Access Bit"
UART_DLL4 = divisor; // Lower 8 bits of divisor
UART_DLM4 = 0x00; // Upper 8 bits of divisor

UART_LCR4 = 0x00; // Clear DLAB bit in Line Control Register
UART_LCR4 = 0x03; // 8 data bits, 1 stop bit, no parity
UART_IER4 = 0x01; // Enable RX int.
UART_FCR4 = 0x09; // Enable FIFO
UART_MCR4 = 0x0b; // Take Interrupt signals out of 3-state
break;
}
}


/********************************************************
The following routine reads a single character (byte)
from the UART receive buffer. If the receive buffer is
empty, -1 is returned.
********************************************************/
int UART_recv_byte (int chn, unsigned char* byte)
{
switch (chn)
{
case 1:
if (uiUART_recv_count1 == 0) return (-1);
*byte = ucUART_recv_buffer1[uiUART_recv_nextout1++];
if (uiUART_recv_nextout1 >= RECV_BUF_SIZE) uiUART_recv_nextout1=0;

/* disable interrupts around the following statement */
IRQ_disable(DC_INTERRUPT_SOURCE); // disable external interrupt
uiUART_recv_count1--;
IRQ_enable(DC_INTERRUPT_SOURCE); // enable external interrupt
break;

case 2:
if (uiUART_recv_count2 == 0) return (-1);
*byte = ucUART_recv_buffer2[uiUART_recv_nextout2++];
if (uiUART_recv_nextout2 >= RECV_BUF_SIZE) uiUART_recv_nextout2=0;

/* disable interrupts around the following statement */
IRQ_disable(DC_INTERRUPT_SOURCE); // disable external interrupt
uiUART_recv_count2--;
IRQ_enable(DC_INTERRUPT_SOURCE); // enable external interrupt
break;

case 3:
if (uiUART_recv_count3 == 0) return (-1);
*byte = ucUART_recv_buffer3[uiUART_recv_nextout3++];
if (uiUART_recv_nextout3 >= RECV_BUF_SIZE) uiUART_recv_nextout3=0;

/* disable interrupts around the following statement */
IRQ_disable(DC_INTERRUPT_SOURCE); // disable external interrupt
uiUART_recv_count3--;
IRQ_enable(DC_INTERRUPT_SOURCE); // enable external interrupt
break;

case 4:
if (uiUART_recv_count4 == 0) return (-1);
*byte = ucUART_recv_buffer4[uiUART_recv_nextout4++];
if (uiUART_recv_nextout4 >= RECV_BUF_SIZE) uiUART_recv_nextout4=0;

/* disable interrupts around the following statement */
IRQ_disable(DC_INTERRUPT_SOURCE); // disable external interrupt
uiUART_recv_count4--;
IRQ_enable(DC_INTERRUPT_SOURCE); // enable external interrupt
break;
}
return (0);
}


/********************************************************
The following routine first checks if there is space
in the UART transmit buffer for 'length' characters.
If there is, it places the characters (bytes) into
the buffer. If there is not enough room in the
transmit buffer, the routine returns -1, and does
not place anything in the transmit buffer.
The actual sending of the bytes to the UART will be
handled transparently by the interrupt routine when
the UART is free to accept data.
********************************************************/


int UART_send_block (int chn, unsigned char* buf, unsigned int length)
{
unsigned int index;
switch (chn)
{
case 1:
if ((uiUART_xmit_count1+length-1) >= XMIT_BUF_SIZE) return (-1);
for (index=0; index<length; index++)
{
ucUART_xmit_buffer1[uiUART_xmit_nextin1++]=buf[index];
if (uiUART_xmit_nextin1 >= XMIT_BUF_SIZE) uiUART_xmit_nextin1=0;
}
/* disable interrupts around the following statement */
IRQ_disable(DC_INTERRUPT_SOURCE); // disable external interrupt
uiUART_xmit_count1 += length;
UART_IER1 = 0x03;
IRQ_enable(DC_INTERRUPT_SOURCE); // enable external interrupt
break;

case 2:
if ((uiUART_xmit_count2+length-1) >= XMIT_BUF_SIZE) return (-1);
for (index=0; index<length; index++)
{
ucUART_xmit_buffer2[uiUART_xmit_nextin2++]=buf[index];
if (uiUART_xmit_nextin2 >= XMIT_BUF_SIZE) uiUART_xmit_nextin2=0;
}
/* disable interrupts around the following statement */
IRQ_disable(DC_INTERRUPT_SOURCE); // disable external interrupt
uiUART_xmit_count2 += length;
UART_IER2 = 0x03;
IRQ_enable(DC_INTERRUPT_SOURCE); // enable external interrupt
break;

case 3:
if ((uiUART_xmit_count3+length-1) >= XMIT_BUF_SIZE) return (-1);
for (index=0; index<length; index++)
{
ucUART_xmit_buffer3[uiUART_xmit_nextin3++]=buf[index];
if (uiUART_xmit_nextin3 >= XMIT_BUF_SIZE) uiUART_xmit_nextin3=0;
}
/* disable interrupts around the following statement */
IRQ_disable(DC_INTERRUPT_SOURCE); // disable external interrupt
uiUART_xmit_count3 += length;
UART_IER3 = 0x03;
IRQ_enable(DC_INTERRUPT_SOURCE); // enable external interrupt
break;

case 4:
if ((uiUART_xmit_count4+length-1) >= XMIT_BUF_SIZE) return (-1);
for (index=0; index<length; index++)
{
ucUART_xmit_buffer4[uiUART_xmit_nextin4++]=buf[index];
if (uiUART_xmit_nextin4 >= XMIT_BUF_SIZE) uiUART_xmit_nextin4=0;
}
/* disable interrupts around the following statement */
IRQ_disable(DC_INTERRUPT_SOURCE); // disable external interrupt
uiUART_xmit_count4 += length;
UART_IER4 = 0x03;
IRQ_enable(DC_INTERRUPT_SOURCE); // enable external interrupt
break;

}
return (0);
}


/********************************************************
The following routine returns the number of characters
in the receive memory buffer. Note that the interrupt
service routine (ISR) could potentially add a character to
the receive buffer immediately after this function is
called. This will not harm the integrity of the data.
Any characters placed in the receive buffer by the
ISR in this way will be picked up the next time this
function is called.

********************************************************/
unsigned int UART_recv_count(int chn)
{
switch (chn)
{
case 1:
return (uiUART_recv_count1);

case 2:
return (uiUART_recv_count2);

case 3:
return (uiUART_recv_count3);

case 4:
return (uiUART_recv_count4);

default:
return (0);
}
}

/********************************************************
The following routine returns the number of characters
in the transmit memory buffer. Note that the interrupt
service routine (ISR) could potentially remove a character from
the receive buffer immediately after this function is
called. This will not harm the integrity of the data.


********************************************************/
unsigned int UART_xmit_count(int chn)
{
switch (chn)
{
case 1:
return (uiUART_xmit_count1);

case 2:
return (uiUART_xmit_count2);

case 3:
return (uiUART_xmit_count3);

case 4:
return (uiUART_xmit_count4);

default:
return (0);
}
}

/*****************************************
The following interrupt routine is triggered by a rising edge on
External Interrupt #4. This ISR handles the UART's transmit data and
receive data interrupts for all UART channels.

*****************************************/

interrupt void c_int04()
{
unsigned char temp;
volatile unsigned char trash;

// If the uart is ready to accept a char, AND there is something
// to send, send it, and adjust the pointer and count
while(1)
{ // service channel 1 transmitter
temp = UART_LSR1;
if (((temp & 0x20) == 0x20) && uiUART_xmit_count1)
{
if(uiUART_xmit_count1 == 1) UART_IER1 = 0x01; // if last byte, disable tx int
UART_THR1 = ucUART_xmit_buffer1[uiUART_xmit_nextout1++];
if(uiUART_xmit_nextout1 >= XMIT_BUF_SIZE) uiUART_xmit_nextout1 = 0;
uiUART_xmit_count1--;
}
// service channel 2 transmitter
temp = UART_LSR2;
if (((temp & 0x20) == 0x20) && uiUART_xmit_count2)
{
if(uiUART_xmit_count2 == 1) UART_IER2 = 0x01; // if last byte, disable tx int
UART_THR2 = ucUART_xmit_buffer2[uiUART_xmit_nextout2++];
if(uiUART_xmit_nextout2 >= XMIT_BUF_SIZE) uiUART_xmit_nextout2 = 0;
uiUART_xmit_count2--;
}
// service channel 3 transmitter
temp = UART_LSR3;
if (((temp & 0x20) == 0x20) && uiUART_xmit_count3)
{
if(uiUART_xmit_count3 == 1) UART_IER3 = 0x01; // if last byte, disable tx int
UART_THR3 = ucUART_xmit_buffer3[uiUART_xmit_nextout3++];
if(uiUART_xmit_nextout3 >= XMIT_BUF_SIZE) uiUART_xmit_nextout3 = 0;
uiUART_xmit_count3--;
}
// service channel 4 transmitter
temp = UART_LSR4;
if (((temp & 0x20) == 0x20) && uiUART_xmit_count4)
{
if(uiUART_xmit_count4 == 1) UART_IER4 = 0x01; // if last byte, disable tx int
UART_THR4 = ucUART_xmit_buffer4[uiUART_xmit_nextout4++];
if(uiUART_xmit_nextout4 >= XMIT_BUF_SIZE) uiUART_xmit_nextout4 = 0;
uiUART_xmit_count4--;
DSK6713_LED_on(3);

}

// If a character is waiting in the UART FIFO, and there
// is room in the receive buffer, get the character, and
// adjust the pointer and count.

// service channel 1 receiver
temp = UART_ISR1;
if ((temp & 0x05) == 0x04)
{
if (uiUART_recv_count1 < RECV_BUF_SIZE)
{
ucUART_recv_buffer1[uiUART_recv_nextin1++] = UART_RBR1;
if(uiUART_recv_nextin1 >= RECV_BUF_SIZE) uiUART_recv_nextin1 = 0;
uiUART_recv_count1++;
}
else
trash = UART_RBR1; // discard char if buffer is full
}
// service channel 2 receiver
temp = UART_ISR2;
if ((temp & 0x05) == 0x04)
{
if (uiUART_recv_count2 < RECV_BUF_SIZE)
{
ucUART_recv_buffer2[uiUART_recv_nextin2++] = UART_RBR2;
if(uiUART_recv_nextin2 >= RECV_BUF_SIZE) uiUART_recv_nextin2 = 0;
uiUART_recv_count2++;
}
else
trash = UART_RBR2; // discard char if buffer is full
}
// service channel 3 receiver
temp = UART_ISR3;
if ((temp & 0x05) == 0x04)
{
if (uiUART_recv_count3 < RECV_BUF_SIZE)
{
ucUART_recv_buffer3[uiUART_recv_nextin3++] = UART_RBR3;
if(uiUART_recv_nextin3 >= RECV_BUF_SIZE) uiUART_recv_nextin3 = 0;
uiUART_recv_count3++;
}
else
trash = UART_RBR3; // discard char if buffer is full
}
// service channel 4 receiver
temp = UART_ISR4;
if ((temp & 0x05) == 0x04)
{
if (uiUART_recv_count4 < RECV_BUF_SIZE)
{
ucUART_recv_buffer4[uiUART_recv_nextin4++] = UART_RBR4;
if(uiUART_recv_nextin4 >= RECV_BUF_SIZE) uiUART_recv_nextin4 = 0;
uiUART_recv_count4++;
}
else
trash = UART_RBR4; // discard char if buffer is full
}

// It is imperative that no interrupts are pending when this ISR
// exits. So check if any more interrupts are pending and service them.

if ((UART_ISR1 & 0x01) == 0) continue;
if ((UART_ISR2 & 0x01) == 0) continue;
if ((UART_ISR3 & 0x01) == 0) continue;
if ((UART_ISR4 & 0x01) == 0) continue;
break;
}
}

int UART_recv_block (int chn, unsigned char* buf, unsigned int length)
{
unsigned int index;
switch (chn)
{
case 1:
if (uiUART_recv_count1 < length) return (-1);
for (index=0; index<length; index++)
{
buf[index] = ucUART_recv_buffer1[uiUART_recv_nextout1++];
if (uiUART_recv_nextout1 >= RECV_BUF_SIZE) uiUART_recv_nextout1=0;
}
/* disable interrupts around the following statement */
IRQ_disable(DC_INTERRUPT_SOURCE); // disable external interrupt
uiUART_recv_count1 -= length;
IRQ_enable(DC_INTERRUPT_SOURCE); // enable external interrupt
break;

case 2:
if (uiUART_recv_count2 < length) return (-1);
for (index=0; index<length; index++)
{
buf[index] = ucUART_recv_buffer2[uiUART_recv_nextout2++];
if (uiUART_recv_nextout2 >= RECV_BUF_SIZE) uiUART_recv_nextout2=0;
}
/* disable interrupts around the following statement */
IRQ_disable(DC_INTERRUPT_SOURCE); // disable external interrupt
uiUART_recv_count2 -= length;
IRQ_enable(DC_INTERRUPT_SOURCE); // enable external interrupt
break;

case 3:
if (uiUART_recv_count3 < length) return (-1);
for (index=0; index<length; index++)
{
buf[index] = ucUART_recv_buffer3[uiUART_recv_nextout3++];
if (uiUART_recv_nextout3 >= RECV_BUF_SIZE) uiUART_recv_nextout3=0;
}
/* disable interrupts around the following statement */
IRQ_disable(DC_INTERRUPT_SOURCE); // disable external interrupt
uiUART_recv_count3 -= length;
IRQ_enable(DC_INTERRUPT_SOURCE); // enable external interrupt
break;

case 4:
if (uiUART_recv_count4 < length) return (-1);
for (index=0; index<length; index++)
{
buf[index] = ucUART_recv_buffer4[uiUART_recv_nextout4++];
if (uiUART_recv_nextout4 >= RECV_BUF_SIZE) uiUART_recv_nextout4=0;
}
/* disable interrupts around the following statement */
IRQ_disable(DC_INTERRUPT_SOURCE); // disable external interrupt
uiUART_recv_count4 -= length;
IRQ_enable(DC_INTERRUPT_SOURCE); // enable external interrupt
break;
}
return (0);
}

/* The following delay routine is used to eat up some time during
initialization. For a 6713 running at 225 MHz (i.e. the 6713 DSK),
a value of 8000 passed to this routine causes a delay of
approximately 1 millisecond.
*/
void delay(long value)
{
volatile double x;
long i;
for(i=0;i< value; i++)
{
x=1;
}
}


void irq_ext_enable()
{
// First, globally disable interrupts
// CSR [Control Status Register] Bit 0 is GIE [Global Interrupt Enable]
// Set last bit to ZERO
CSR = (CSR)&(0xFFFFFFFE);
// Set the NMIE bit (bit #1) at the IER
IER |= 0x00000002;
// Set the INT4 bit (bit #4) at the IER
IER |= 0x00000010;
// Last, globally enable interrupts (CSR last bit to 1)
CSR |= 0x00000001;
}


int main()


{ short p=0;
comm_poll(); //.. INITIALIZING POLLING BASED PROGRAM ..//
CE2_CONTROL = 0x03d00f21; // set up CE2 memory space access timing
DC_REG |= 0x08; // raise daughter card reset signal
delay(8000L*250); // delay ~ 250 milliseconds
DC_REG &= ~0x08; // remove daughter card reset signal
delay(8000L*250); // delay ~ 250 milliseconds

CSL_init(); // initialize the Chip Support Library
DSK6713_LED_init();
initialize_UART(1,DATA_RATE_19200); // initialize the uart channels
initialize_UART(2,DATA_RATE_19200); // initialize the uart channels
initialize_UART(3,DATA_RATE_9600); // initialize the uart channels
initialize_UART(4,DATA_RATE_4000); // initialize the uart channels


irq_ext_enable(); //Initialize external interrupt

if(UART_xmit_count(CHANNEL_TO_USE) < 10)
{
UART_send_block(CHANNEL_TO_USE,heading1,strlen(heading1));
}

if(len = UART_recv_count(CHANNEL_TO_USE))
{

UART_recv_block (CHANNEL_TO_USE, buf, len);
}

return 0;
}

  • Hatim,

    My recommendation is to work on the demo programs first to get them working 100%. If you are starting from those, and they have problems, your code is certain to still have those problems.

    If you still have problems, contact the LR team to see if they believe you have hardware problems and need to replace your board(s).

    Regards,
    RandyP
  • Yes i have tried demo program first that are shipped with cd but they have same problem as i had discussed earlier..
  • Hatim,

    You may be debugging a hardware problem and not a software problem related to your code. You will want to get that demo program working before moving on to your code, or else you might never solve the real problem.

    If at all possible, try the demo on a second LR-232 board and on a second DSK6713 to try to determine if the problem is with the boards and which board.

    Regards,
    RandyP
  • Guru,
    I have spend a whole month in debugging that problem what else i can do regarding hardware check can you please refer what should be check in terms of hardware i have replace LR-232 with another LR-232 daughter card but result remains the same.One thing to ask regarding dsp kit what measures should i take to verify that dsp kit is working properly as serial transmission goes on fine.

    1.I have check emif clock configured at 90MHz by my gel file.
    2.Dsp is running @ 225Mhz.(how to verify this clock?)

    what else i can check????
  • Hatim,

    When you replaced the LR-232 with another LR-232 daughter card, did you test with the demo program on both boards or was this with your own program? It is not clear to me. It is important to get the demo working before trying to debug your code.

    Do you have a second DSK6713 you can test with both LR-232 daughter cards?

    If you cannot get the demo program working, you will want to contact LR-232 support. Do you have a contact there? It is not a board that I know or can readily support with any direct knowledge.

    If that all fails, you will need to debug the board and your code using the tools you have, such as an oscilloscope to confirm signals to/from the LR-232 and CCS to check variable values at critical points in time.

    And I will repeat that if the demo program is not working then it is not useful to debug your own program, yet.

    1. Have you checked that the EMIF clock is running at 90MHz using an oscilloscope?
    2. Find a CLKOUT signal that you can look at to verify that the DSP clock is running at 225MHz.

    Regards,
    RandyP
  • Hatim,

    I see you have another thread running to work on the demo loopback program. That is a good idea, and I will stay away from it so you get some community or other TI support.

    Your details on the other thread are very useful. The fact that you can receive a certain number of bytes before it goes to trash will lead you in your program debug.

    What are your compiler arguments? You can get these from the console output of the compiler. If you are not using the optimizer, you are probably running out of time when the interrupt occurs. This may mean you are not following the instructions with the readme or other documentation that comes with the board, but that is just a guess. If the demo program is supposed to work, then they would include documentation to get it working fully.

    To debug, you can look at what happens when the buffer gets to the number of bytes that you receive well. What happens in the code when that happens? Is there a constant or buffer size that matches that number?

    Work it and find data. Follow the code process.

    Try lowering the baud rate significantly, like to 150baud and see if the results change. Increase and decrease the buffer size in different places to see how that affects the results.

    Good luck.

    Regards,
    RandyP
  • main6713.hRandyP,

                  firstly it is to clarify that my first effort was to run the demo programs not my own which is definitely the way to go forward. There are following thing which i have done.

    1.I have checked the emif clock running at 90 MHz by oscilloscope on peripheral connector pin 78.

    2.I have also give an attempt to go with lower baud rate.

    3.Another important thing i know the limitation of buffer size capacity i am definitely not gone beyond the limit.

    4.How can i debug more than one byte by placing break points as data is transmitted(serially) continuously from PC and reception is Interupt based i can do this for a single byte but not for all data,hopefully you understand what i am trying to say.

    5. Last thing i have tried to debug by replacing another daughter card but no dsp kit i will go for that too.

    I have read all technical reference come with daughter card placing interrupt jumpers making RTS/CTS enabled etc etc but not able to succeed getting data from pc or some other device. i am going to attached everything what i got to get help in regard.

    /************************************************************
     *
     *  Copyright 2009 by Link Research. ALL RIGHTS RESERVED
     *  This software is provided for demonstration purposes only
     *  and is not guaranteed in any way as to its form or function.
     *  There are no restrictions for its use provided this disclaimer
     *  is included with all distributions of this source code.
     *
     ************************************************************/
    
    /*	UART daughtercard demo software for the 6713 DSK		*/
    
    #include "main6713.h"
    #include <csl.h>
    
    unsigned char buf[130];					// temporary data buffer
    int len;
    
    main ()
    {
    	CE2_CONTROL = 0x03d00f21; 			// set up CE2 memory space access timing
    
    	DC_REG |= 0x08;						// raise daughtercard reset signal
    	delay(8000L*250);					// delay ~ 250 milliseconds
    	DC_REG &= ~0x08;					// remove daughtercard reset signal
    	delay(8000L*250);					// delay ~ 250 milliseconds
    
    	CSL_init();							// initialize the Chip Support Library
    	
    	initialize_UART(1,DATA_RATE_19200);	// initialize the uart channels
    	initialize_UART(2,DATA_RATE_19200);	// initialize the uart channels
    	initialize_UART(3,DATA_RATE_19200);	// initialize the uart channels
    	initialize_UART(4,DATA_RATE_19200);	// initialize the uart channels	
    
    	IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt
    
    	// exit main() and fall into DSP/BIOS idle loop
    }			// end of main()
    
    /*   The following routine is executed every millisecond  */
    
    void main_loop(void)
    {
    
    		if(len = UART_recv_count(1))
    		{
    			UART_recv_block (1, buf, len);
    			UART_send_block (1, buf, len);
    		}
    		
    		if(len = UART_recv_count(2))
    		{
    			UART_recv_block (2, buf, len);
    			UART_send_block (2, buf, len);
    		}
    
    		if(len = UART_recv_count(3))
    		{
    			UART_recv_block (3, buf, len);
    			UART_send_block (3, buf, len);
    		}
    		if(len = UART_recv_count(4))
    		{
    			UART_recv_block (4, buf, len);
    			UART_send_block (4, buf, len);
    		}
    }
    
    
    /************************************************************	
    
    	Below are the subroutines described in the documentation
    	
    ************************************************************/
    void initialize_UART (int chn, unsigned char divisor)
    {
    	switch (chn)
    	{
    		case	1:
    	  		// channel 1
    		UART_LCR1 = 0x80;		// Set "Divisor Latch Access Bit"
    		UART_DLL1 = divisor;	// Lower 8 bits of divisor
    		UART_DLM1 = 0x00;		// Upper 8 bits of divisor
    		
    		UART_LCR1 = 0x00;		// Clear DLAB bit in Line Control Register
    		UART_LCR1 = 0x03;		// 8 data bits, 1 stop bit, no parity
    		UART_IER1 = 0x01;		// Enable RX int.
    		UART_FCR1 = 0x09;		// Enable FIFO
    		UART_MCR1 = 0x0b;		// Take Interrupt signals out of 3-state
    		break;	
    			case	2:
    	  		// channel 2
    	  	UART_LCR2 = 0x80;		// Set "Divisor Latch Access Bit"
    		UART_DLL2 = divisor;	// Lower 8 bits of divisor
    		UART_DLM2 = 0x00;		// Upper 8 bits of divisor
    	
    		UART_LCR2 = 0x00;		// Clear DLAB bit in Line Control Register
    		UART_LCR2 = 0x03;		// 8 data bits, 1 stop bit, no parity
    		UART_IER2 = 0x01;		// Enable RX int.
    		UART_FCR2 = 0x09;		// Enable FIFO
    		UART_MCR2 = 0x0b;		// Take Interrupt signals out of 3-state
    		break;		
    			case	3:
    	  		// channel 3
    	  	UART_LCR3 = 0x80;		// Set "Divisor Latch Access Bit"
    		UART_DLL3 = divisor;	// Lower 8 bits of divisor
    		UART_DLM3 = 0x00;		// Upper 8 bits of divisor
    	
    		UART_LCR3 = 0x00;		// Clear DLAB bit in Line Control Register
    		UART_LCR3 = 0x03;		// 8 data bits, 1 stop bit, no parity
    		UART_IER3 = 0x01;		// Enable RX int.
    		UART_FCR3 = 0x09;		// Enable FIFO
    		UART_MCR3 = 0x0b;		// Take Interrupt signals out of 3-state
    		break;			
    			case	4:
    	  		// channel 4
    	  	UART_LCR4 = 0x80;		// Set "Divisor Latch Access Bit"
    		UART_DLL4 = divisor;	// Lower 8 bits of divisor
    		UART_DLM4 = 0x00;		// Upper 8 bits of divisor
    	
    		UART_LCR4 = 0x00;		// Clear DLAB bit in Line Control Register
    		UART_LCR4 = 0x03;		// 8 data bits, 1 stop bit, no parity
    		UART_IER4 = 0x01;		// Enable RX int.
    		UART_FCR4 = 0x09;		// Enable FIFO
    		UART_MCR4 = 0x0b;		// Take Interrupt signals out of 3-state
    		break;
    	}	
    }
    
    /********************************************************
    	The following routine first checks if there is space
    	in the UART transmit buffer for one byte. If there is, it
    	places that single character (byte)	into the buffer. 
    	If there is no room in the transmit buffer,
    	the routine returns -1. 
    	The actual sending of the byte to the UART will be
    	handled transparently by the interrupt routine when
    	the UART is free to accept the byte.
    ********************************************************/	
    int UART_send_byte (int chn, unsigned char byte)
    {
    	switch (chn)
    	{
    	case	1:
    		if (uiUART_xmit_count1 >= XMIT_BUF_SIZE) return (-1);
    		ucUART_xmit_buffer1[uiUART_xmit_nextin1++]=byte;
    		if (uiUART_xmit_nextin1 >= XMIT_BUF_SIZE) uiUART_xmit_nextin1=0;
    		
    	/*	disable interrupts around the following 2 statements	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_xmit_count1++;
    		UART_IER1 = 0x03;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt
    		break;
    		
    	case	2:
    		if (uiUART_xmit_count2 >= XMIT_BUF_SIZE) return (-1);
    		ucUART_xmit_buffer2[uiUART_xmit_nextin2++]=byte;
    		if (uiUART_xmit_nextin2 >= XMIT_BUF_SIZE) uiUART_xmit_nextin2=0;
    		
    	/*	disable interrupts around the following 2 statements	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_xmit_count2++;
    		UART_IER2 = 0x03;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt	
    		break;
    
    	case	3:
    		if (uiUART_xmit_count3 >= XMIT_BUF_SIZE) return (-1);
    		ucUART_xmit_buffer3[uiUART_xmit_nextin3++]=byte;
    		if (uiUART_xmit_nextin3 >= XMIT_BUF_SIZE) uiUART_xmit_nextin3=0;
    		
    	/*	disable interrupts around the following 2 statements	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_xmit_count3++;
    		UART_IER3 = 0x03;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt	
    		break;
    
    	case	4:
    		if (uiUART_xmit_count4 >= XMIT_BUF_SIZE) return (-1);
    		ucUART_xmit_buffer4[uiUART_xmit_nextin4++]=byte;
    		if (uiUART_xmit_nextin4 >= XMIT_BUF_SIZE) uiUART_xmit_nextin4=0;
    		
    	/*	disable interrupts around the following 2 statements	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_xmit_count4++;
    		UART_IER4 = 0x03;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt	
    		break;
    	}	
    	return (0);
    }
    
    /********************************************************
    	The following routine reads a single character (byte)
    	from the UART receive buffer. If the receive buffer is
    	empty, -1 is returned.
    ********************************************************/	
    int UART_recv_byte (int chn, unsigned char* byte)
    {
    	switch (chn)
    	{
    	case	1:
    		if (uiUART_recv_count1 == 0) return (-1);
    		*byte = ucUART_recv_buffer1[uiUART_recv_nextout1++];
    		if (uiUART_recv_nextout1 >= RECV_BUF_SIZE) uiUART_recv_nextout1=0;
    		
    	/*	disable interrupts around the following statement	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_recv_count1--;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt
    		break;
    		
    	case	2:
    		if (uiUART_recv_count2 == 0) return (-1);
    		*byte = ucUART_recv_buffer2[uiUART_recv_nextout2++];
    		if (uiUART_recv_nextout2 >= RECV_BUF_SIZE) uiUART_recv_nextout2=0;
    		
    	/*	disable interrupts around the following statement	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_recv_count2--;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt	
    		break;
    		
    	case	3:
    		if (uiUART_recv_count3 == 0) return (-1);
    		*byte = ucUART_recv_buffer3[uiUART_recv_nextout3++];
    		if (uiUART_recv_nextout3 >= RECV_BUF_SIZE) uiUART_recv_nextout3=0;
    		
    	/*	disable interrupts around the following statement	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_recv_count3--;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt	
    		break;
    
    	case	4:
    		if (uiUART_recv_count4 == 0) return (-1);
    		*byte = ucUART_recv_buffer4[uiUART_recv_nextout4++];
    		if (uiUART_recv_nextout4 >= RECV_BUF_SIZE) uiUART_recv_nextout4=0;
    		
    	/*	disable interrupts around the following statement	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_recv_count4--;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt	
    		break;		
    	}
    	return (0);
    }
    /********************************************************
    	The following routine first checks if there is space
    	in the UART transmit buffer for 'length' characters.
    	If there is, it	places the  characters (bytes) into
    	the buffer. If there is not enough room in the
    	transmit buffer, the routine returns -1, and does
    	not place anything in the transmit buffer.
    	The actual sending of the bytes to the UART will be
    	handled transparently by the interrupt routine when
    	the UART is free to accept data.
    ********************************************************/	
    int UART_send_block (int chn, unsigned char* buf, unsigned int length)
    {
    unsigned int index;
    	switch (chn)
    	{
    	case	1:	
    		if ((uiUART_xmit_count1+length-1) >= XMIT_BUF_SIZE) return (-1);
    		for (index=0; index<length; index++)
    		{
    			ucUART_xmit_buffer1[uiUART_xmit_nextin1++]=buf[index];
    			if (uiUART_xmit_nextin1 >= XMIT_BUF_SIZE) uiUART_xmit_nextin1=0;
    		}
    	/*	disable interrupts around the following statement	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_xmit_count1 += length;
    		UART_IER1 = 0x03;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt
    		break;
    		
    	case	2:
    		if ((uiUART_xmit_count2+length-1) >= XMIT_BUF_SIZE) return (-1);
    		for (index=0; index<length; index++)
    		{
    			ucUART_xmit_buffer2[uiUART_xmit_nextin2++]=buf[index];
    			if (uiUART_xmit_nextin2 >= XMIT_BUF_SIZE) uiUART_xmit_nextin2=0;
    		}
    	/*	disable interrupts around the following statement	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_xmit_count2 += length;
    		UART_IER2 = 0x03;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt
    		break;	
    
    	case	3:	
    		if ((uiUART_xmit_count3+length-1) >= XMIT_BUF_SIZE) return (-1);
    		for (index=0; index<length; index++)
    		{
    			ucUART_xmit_buffer3[uiUART_xmit_nextin3++]=buf[index];
    			if (uiUART_xmit_nextin3 >= XMIT_BUF_SIZE) uiUART_xmit_nextin3=0;
    		}
    	/*	disable interrupts around the following statement	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_xmit_count3 += length;
    		UART_IER3 = 0x03;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt
    		break;
    		
    	case	4:
    		if ((uiUART_xmit_count4+length-1) >= XMIT_BUF_SIZE) return (-1);
    		for (index=0; index<length; index++)
    		{
    			ucUART_xmit_buffer4[uiUART_xmit_nextin4++]=buf[index];
    			if (uiUART_xmit_nextin4 >= XMIT_BUF_SIZE) uiUART_xmit_nextin4=0;
    		}
    	/*	disable interrupts around the following statement	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_xmit_count4 += length;
    		UART_IER4 = 0x03;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt
    		break;	
    
    	}
    	return (0);
    }
    
    /********************************************************
    	The following routine first checks to see if there are
    	at least 'length' bytes in the receive buffer.
    	If there are, it reads the  characters (bytes) into a
    	memory buffer pointed to by the passed argument: *buf. 
    	If there are not enough characters in the receive buffer
    	to satisy the requested block length,
    	the routine returns -1.
    	
    ********************************************************/	
    int UART_recv_block (int chn, unsigned char* buf, unsigned int length)
    {
    unsigned int index;
    	switch (chn)
    	{
    	case	1:	
    		if (uiUART_recv_count1 < length) return (-1);
    		for (index=0; index<length; index++)
    		{
    			buf[index] = ucUART_recv_buffer1[uiUART_recv_nextout1++];
    			if (uiUART_recv_nextout1 >= RECV_BUF_SIZE) uiUART_recv_nextout1=0;
    		}
    	/*	disable interrupts around the following statement	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_recv_count1 -= length;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt
    		break;
    		
    	case	2:
    		if (uiUART_recv_count2 < length) return (-1);
    		for (index=0; index<length; index++)
    		{
    			buf[index] = ucUART_recv_buffer2[uiUART_recv_nextout2++];
    			if (uiUART_recv_nextout2 >= RECV_BUF_SIZE) uiUART_recv_nextout2=0;
    		}
    	/*	disable interrupts around the following statement	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_recv_count2 -= length;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt
    		break;	
    
    	case	3:
    		if (uiUART_recv_count3 < length) return (-1);
    		for (index=0; index<length; index++)
    		{
    			buf[index] = ucUART_recv_buffer3[uiUART_recv_nextout3++];
    			if (uiUART_recv_nextout3 >= RECV_BUF_SIZE) uiUART_recv_nextout3=0;
    		}
    	/*	disable interrupts around the following statement	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_recv_count3 -= length;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt
    		break;	
    
    	case	4:
    		if (uiUART_recv_count4 < length) return (-1);
    		for (index=0; index<length; index++)
    		{
    			buf[index] = ucUART_recv_buffer4[uiUART_recv_nextout4++];
    			if (uiUART_recv_nextout4 >= RECV_BUF_SIZE) uiUART_recv_nextout4=0;
    		}
    	/*	disable interrupts around the following statement	*/
    		IRQ_disable(DC_INTERRUPT_SOURCE);	// disable external interrupt
    		uiUART_recv_count4 -= length;
    		IRQ_enable(DC_INTERRUPT_SOURCE);	// enable external interrupt
    		break;	
    	}
    	return (0);
    }
    
    /********************************************************
    	The following routine returns the number of characters
    	in the receive memory buffer. Note that the interrupt
    	service routine (ISR) could potentially add a character to
    	the receive buffer immediately after this function is
    	called. This will not harm the integrity of the data.
    	Any characters placed in the receive buffer by the
    	ISR in this way will be picked up the next time this
    	function is called.
    	
    ********************************************************/
    unsigned int UART_recv_count(int chn)
    {
    	switch (chn)
    	{
    	case	1:	
    		return (uiUART_recv_count1);
    
    	case	2:
    		return (uiUART_recv_count2);
    
    	case	3:
    		return (uiUART_recv_count3);
    
    	case	4:
    		return (uiUART_recv_count4);
    
    	default:
    		return (0);		
    	}	
    }
    
    /********************************************************
    	The following routine returns the number of characters
    	in the transmit memory buffer. Note that the interrupt
    	service routine (ISR) could potentially remove a character from
    	the receive buffer immediately after this function is
    	called. This will not harm the integrity of the data.
    	
    	
    ********************************************************/
    unsigned int UART_xmit_count(int chn)
    {
    	switch (chn)
    	{
    	case	1:	
    		return (uiUART_xmit_count1);
    
    	case	2:
    		return (uiUART_xmit_count2);
    
    	case	3:
    		return (uiUART_xmit_count3);
    
    	case	4:
    		return (uiUART_xmit_count4);
    
    	default:
    		return (0);		
    	}	
    }
    
    /*****************************************
    	The following interrupt routine is triggered by a rising edge on 
    	External Interrupt #4. This ISR handles the UART's transmit data and
    	receive data interrupts for all UART channels.
    	
    *****************************************/
    
    void ext_int(void)
    {
    	unsigned char temp;
    	volatile unsigned char trash;
    
    //   If the uart is ready to accept a char, AND there is something
    //	 to send, send it, and adjust the pointer and count
    	while(1)
    	{		//  service channel 1 transmitter
    		temp = UART_LSR1;
    		if (((temp & 0x20) == 0x20) && uiUART_xmit_count1) 
    		{
    			if(uiUART_xmit_count1 == 1) UART_IER1 = 0x01; // if last byte, disable tx int
    			UART_THR1 = ucUART_xmit_buffer1[uiUART_xmit_nextout1++];
    			if(uiUART_xmit_nextout1 >= XMIT_BUF_SIZE) uiUART_xmit_nextout1 = 0;
    			uiUART_xmit_count1--;
    		}
    			//  service channel 2 transmitter
    		temp = UART_LSR2;
    		if (((temp & 0x20) == 0x20) && uiUART_xmit_count2) 
    		{
    			if(uiUART_xmit_count2 == 1) UART_IER2 = 0x01; // if last byte, disable tx int
    			UART_THR2 = ucUART_xmit_buffer2[uiUART_xmit_nextout2++];
    			if(uiUART_xmit_nextout2 >= XMIT_BUF_SIZE) uiUART_xmit_nextout2 = 0;
    			uiUART_xmit_count2--;
    		}
    			//  service channel 3 transmitter
    		temp = UART_LSR3;
    		if (((temp & 0x20) == 0x20) && uiUART_xmit_count3) 
    		{
    			if(uiUART_xmit_count3 == 1) UART_IER3 = 0x01; // if last byte, disable tx int
    			UART_THR3 = ucUART_xmit_buffer3[uiUART_xmit_nextout3++];
    			if(uiUART_xmit_nextout3 >= XMIT_BUF_SIZE) uiUART_xmit_nextout3 = 0;
    			uiUART_xmit_count3--;
    		}
    			//  service channel 4 transmitter
    		temp = UART_LSR4;
    		if (((temp & 0x20) == 0x20) && uiUART_xmit_count4) 
    		{
    			if(uiUART_xmit_count4 == 1) UART_IER4 = 0x01; // if last byte, disable tx int
    			UART_THR4 = ucUART_xmit_buffer4[uiUART_xmit_nextout4++];
    			if(uiUART_xmit_nextout4 >= XMIT_BUF_SIZE) uiUART_xmit_nextout4 = 0;
    			uiUART_xmit_count4--;
    		}
    
    // If a character is waiting in the UART FIFO, and there
    //	is room in the receive buffer, get the character, and
    //	adjust the pointer and count.
    
    			//  service channel 1 receiver
    	temp = UART_ISR1;
    	if ((temp & 0x05) == 0x04)
    	{
    		if (uiUART_recv_count1 < RECV_BUF_SIZE) 
    		{
    			ucUART_recv_buffer1[uiUART_recv_nextin1++] = UART_RBR1;
    			if(uiUART_recv_nextin1 >= RECV_BUF_SIZE) uiUART_recv_nextin1 = 0;
    			uiUART_recv_count1++;
    		}
    		else
    			trash = UART_RBR1;	// discard char if buffer is full						
    	}	 
    			//  service channel 2 receiver
    	temp = UART_ISR2;
    	if ((temp & 0x05) == 0x04)
    	{
    		if (uiUART_recv_count2 < RECV_BUF_SIZE) 
    		{
    			ucUART_recv_buffer2[uiUART_recv_nextin2++] = UART_RBR2;
    			if(uiUART_recv_nextin2 >= RECV_BUF_SIZE) uiUART_recv_nextin2 = 0;
    			uiUART_recv_count2++;
    		}
    		else
    			trash = UART_RBR2;	// discard char if buffer is full						
    	}
    			//  service channel 3 receiver
    	temp = UART_ISR3;
    	if ((temp & 0x05) == 0x04)
    	{
    		if (uiUART_recv_count3 < RECV_BUF_SIZE) 
    		{
    			ucUART_recv_buffer3[uiUART_recv_nextin3++] = UART_RBR3;
    			if(uiUART_recv_nextin3 >= RECV_BUF_SIZE) uiUART_recv_nextin3 = 0;
    			uiUART_recv_count3++;
    		}
    		else 
    			trash = UART_RBR3;	// discard char if buffer is full						
    	}	 	
    			//  service channel 4 receiver	
    	temp = UART_ISR4;
    	if ((temp & 0x05) == 0x04)
    	{
    		if (uiUART_recv_count4 < RECV_BUF_SIZE) 
    		{
    			ucUART_recv_buffer4[uiUART_recv_nextin4++] = UART_RBR4;
    			if(uiUART_recv_nextin4 >= RECV_BUF_SIZE) uiUART_recv_nextin4 = 0;
    			uiUART_recv_count4++;
    		}
    		else
    			trash = UART_RBR4;	// discard char if buffer is full						
    	}
    		 	
    	// It is imperative that no interrupts are pending when this ISR
    	// exits. So check if any more interrupts are pending and service them.
    	
    	if ((UART_ISR1 & 0x01) == 0) continue;
    	if ((UART_ISR2 & 0x01) == 0) continue;	
    	if ((UART_ISR3 & 0x01) == 0) continue;	
    	if ((UART_ISR4 & 0x01) == 0) continue;
    	break;	
    	}
    }
    /* The following delay routine is used to eat up some tine during
       initialization. For a 6713 running at 225 MHz (i.e. the 6713 DSK),
       a value of 8000 passed to this routine causes a delay of 
       approximately 1 millisecond.
    */   
    void 	delay(long value)
    {
      volatile double x;
      long i;
    	for(i=0;i< value; i++)
    	{
    		x=1;
    	}
    }
    
    
    
    5658.LR-232-Tech_Ref.pdfUART_LAN_schematic.pdf

     

  • Hatim,

    hatim butt said:
    2.I have also give an attempt to go with lower baud rate.

    Good. What did you observe with the lower baud rate?

    hatim butt said:
    3.Another important thing i know the limitation of buffer size capacity i am definitely not gone beyond the limit.

    I do not know which buffer size you are talking about. There may be a FIFO buffer in the UART device on the LR-232 board; what size is it and how full does it ever get? There are buffers in the demo program; what size are they and how full do they get?

    Since you get an error on byte 14 and later, what is the significance of the numbers 13 or 14 with respect to any of your buffers or FIFOs?

    hatim butt said:
    4.How can i debug more than one byte by placing break points as data is transmitted(serially) continuously from PC and reception is Interupt based i can do this for a single byte but not for all data,hopefully you understand what i am trying to say.

    I am not really qualified to teach debugging skills, but I am sure you will get a lot of good ideas from your co-workers and from others if you search through this forum and on the internet.

    You can use the CCS Help->Search capability to learn what features there are for setting breakpoints. You can add code that looks for a certain status or criteria and then do a dummy instruction on which you can set a breakpoint when that status or criteria occurs.

    You can send 14 bytes exactly from the transmit side so only that number are received. Then look at it.

    hatim butt said:
    5. Last thing i have tried to debug by replacing another daughter card but no dsp kit i will go for that too.

    If you try 2 LR-232 cards and 2 DSK6713 cards, in all four combinations, then you can likely rule out a hardware problem. If the LR demo program does not work, then I would go back through their documentation to find out which step may have been skipped. And you will want to contact them since they wrote the software that is supposed to work.

    Check all of the DSK and LR board jumper settings and/or switch settings.

    There may be other questions still waiting to be answered above. Please look over those and reply back when you have those answers.

    Regards,
    RandyP

  • I am using the exact same hardware set and am working my way through similar sounding issues. I've just found this thread and haven't read it completely. However, I did notice that on initialization of channel 4 you have:

    initialize_UART(4,DATA_RATE_4000); // initialize the uart channels

    In my code DATA_RATE_4000 is not defined, mine has DATA_RATE_4800.

    I will be reviewing this thread carefully. Too bad we are having problems, but glad to see someone else is working the same issue.

    Best,

    Brooks
  • I have worked on this a whole month but didn't succeeded but happy to hear you talks about same issue if find some solution please help me too..about baud rate it was given with code but i have tried other baud rate as well...


    Regard's
    Hatim