AnsweredAssumed Answered

using the uart example ofADSP-21369 EZ-KIT Lite problem

Question asked by jett on Mar 17, 2011
Latest reply on Apr 19, 2011 by DeepV

HI all

 

i using the  UART echo back (C) example

now my put a value from pc ,then my 369 system is receive the data .and i find that the data i receive that is not equal to me sent.

 

when i change the baud rate the value which i received is not change yet.

 

void initUART()
{
    /* Sets the Baud rate for UART0 */   
    *pUART0LCR = UARTDLAB;  //enables access to Divisor register to set baud rate
    *pUART0DLL = 0x1c;      //0x21c = 540 for divisor value and gives a baud rate of19200 for core clock 331.776MHz
    *pUART0DLH = 0x02;
 
    /* Configures UART0 LCR */
    *pUART0LCR = UARTWLS8;
                   // word length 8
                //   |UARTPEN|                 // parity enable ODD parity
               // UARTSTB ;                 // Two stop bits                     
    *pUART0RXCTL = UARTEN;       //enables UART0 in receive mod

  // *pUART0TXCTL = UARTEN;       //enables UART0 in core driven mode
      *pUART0IER   = UARTRBFIE;    // enables UART0 receive interrupt
    SRU(LOW,DPI_PB08_I) ;   
 
  //  xmitUARTmessage(welcomemessage,sizeof(welcomemessage));  
}

 

void UARTisr()
{
  int value,i, te

temp=*pUART0IIR;

   if((temp&4)==4)
   {

     value = *pUART0RBR;   
    // i  =   *pUART0LBR;                                      // UART Receive Buffer Register (RBR)

   }

 

   if ((temp&2)==2)
     {

 

         ;  // transmit interrupt code ->should enter here now

     }
/* echoes back the value on to the hyperterminal screen*/
}

 

main()
{

 

    *pPICR2 &= ~(0x3E0); //Sets the UART0 receive interrupt to P13

 

    *pPICR2 |= (0x13<<5);
   
    initPLL_SDRAM();
    initTimer0 ();
   
    *pUART0LCR=0;

 

    interrupt(SIG_P13,UARTisr);
    initDPI();
    initUART();

 

   
   while(1)
   {
   };
   
}

 

hope some advice.

 

thanks

 

jett

Outcomes