AnsweredAssumed Answered

Question on Receiving Data Via UART

Question asked by spdavis on Oct 2, 2013
Latest reply on Oct 4, 2013 by spdavis

Hello All,

 

     I am using the SHARC EZ-Lite 21469 Evaluation Board and VisualDSP++.  I am have written a simple program under the VDK to transmit and receive messages via the UART on the Eval Board.  I have a serial cable connected from my PC serial port to the SHARC Eval Board serial port.  I am able to send messages to the terminal emulator on the PC. That part of the program works well.

 

    My problem is receiving a string from the PC to the Eval Board.  When I receive the string from the PC,I can only seem to retrieve the first character in the string.  In the ISR routine, I have the following code in my ISR to retrieve the characters:

 

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

void P13I_Entry(void) {

/* Insert your ISR code here */

 

int value;

int count = 0;

value = *pUART0RBR;

char_recvd[count] = value;

count++;

while ((*pUART0LSR & UARTDR) == 1)

{

           char_recvd[count] = value;

           count++;

  }

flag = 1;

}

 

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

:

I would have expected char_recvd[] to capture all the characters in the sent string.  However it only captures the first character of the string.

It looks like the first character is captured by the first "char_recvd[count] = value" statement.  I would have thought the additional characters would be retrieved in the while loop, but this does not seem to be the case. 

 

I am just starting embedded programming, so I may be missing something obvious.  I did try clearing the UARTDLAB bit (bit 7 of the UART0LCR register) at the end of the loop, but that did not help.

 

Note that "char_recvd[]" and "flag" are global variables.  The string I am sending from the PC to the SHARC will always consist of 10 characters.

 

Thanks for any help!

 

Stephen

Outcomes