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.

UART Receive interrupt problem in TMS320C5505



Hi

      I face Receive interrupt problem. I use without CSL. my Program post here.

#include<stdio.h>
#include "usbstk5515.h"
#include "usbstk5515_uart.h"
char message[]="Embedded System with DSP \n \r";
int i,j,l,k;
char receiver[255];
void main()
{
           USBSTK5515_init( );


/*----------UART Inialized at 9600--------------*/
         SYS_EXBUSSEL &= ~0xF000; //
         SYS_EXBUSSEL |= 0x1000; // Set parallel port to mode 1 (SPI, GPIO, UART, and I2S2)
         SYS_PRCNTRLR &= ~0x0080; // Make sure UART is out of reset
         SYS_PCGCR1 &=(~(1<<2)); // Enable UART clock
         UART_PWREMU_MGMT = 0X7FFF; // Place the UART transmitter and receiver in reset

         UART_DLL = 0X008b; // 9600-Set baud rate
         UART_DLH = 0X0002;
         printf("\nSet baud rate 9600\n");

         // Clear UART TX & RX FIFOs
         UART_FCR = 0x000F; // Non-FIFO mode
         UART_IER = 0X0003; // Enable interrupts
         UART_LCR = 0X0003; // 8-bit words,
         // 1 STOP bit generated,
         // No Parity, No Stick paritiy,
         // No Break control
        for(j=0;message[j]!='\0';j++)
        {
                 while((UART_LSR & 0x60)==0); // Wait for TX ready
                EVM5515_UART_putChar(message[j]); // Write 1 byte
        }
        while(1)
        {
           
              if(i>3)
              {
                      for(i=0;i<3;i++) printf("%c",receiver[i]);
                      i=0;
              }
       }
}
interrupt void UART_intrDispatch(void)
{
        receiver[i]=UART_RBR;
        i++;
     
}

please help me.

Regards

Ramanathan.S

 

  • Hello Ramanathan,

     Its always been suggested to Use the CSL, as it eases out the implementation of the application code..

     The configuration looks ok : I was not sure whether you are using DMA ( DMA is enabled) .

     You could diagonise your code by  enabling the loopback mode in modem control register.  This method will help ensure that your TX , RX configurations are correct and generation of respective interrupts.

    Please let me know if you have further issues.

    Regards

     Vasanth

     

  • Hello Vasantha

        I have attach my project file here. Let me know what is the problem in this code.


    regards

    Ramanathan.S4034.ReceiveInterrupt.rar

  • Hello Ramanathan,

     Did you try the loopback method that was suggested earlier.

    You could do the comparison of the interrupt despatcher code that you had created with the CSL implementation.

    Also In your gel file its observed that the PLL_CNTL1 (IOaddress=0x1C20) is set to 0x8004. This looks incorrect and it has to be 0x8BE8 for generating System clock of 100Mhz clock.

    Looks like TX Intr generated in your code, and when Loopback is enabled RX data ready is set. (used C5515 gel file).

    Hope you could check your code as suggested above.

    Regards

     Vasanth