Hello:
I am developing using CW development studio and using a KE02 MCU. With PE I created a AS component. I'm just trying to receive a character (sent by a RS232 terminal) using an interrupt, show it in a LCD alphanumeric display and finally the MCU returns that character to the terminal.
The ISR program consists of:
void AS1_OnRxChar(void)
{
AS1_TComData ch; // TComData type is defined in the AS1.h header file
//Read received character and send it if no error is detected
if(AS1_RecvChar(&ch) == ERR_OK)
lcd_erase_display();
lcd_gotoxy(0,0); //going to the position (0,0) of my display
lcd_send_byte(ch,1);
AS1_SendChar(ch);
}
What is happening is that when I send through the terminal a single character, the LCD shows ' ||| ' but the terminal receives correctly the sent character when returning it. However, if I send two characters at a time, the LCD receives just the first one and correctly (and the terminal receives correctly the returned character too).
What is happening? Why cant I identify a single character?
I have checked that AS1_TComData ch; is just a character and not a pointer to character.
Thank you very much