Can't identify a character in Asinchronical Communication

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Can't identify a character in Asinchronical Communication

963 次查看
juanignaciotroi
Contributor III

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

标记 (1)
0 项奖励
回复
1 回复

905 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Juan Ignacio Troisi,

     From your description, the KE02 UART is working correctly, and the Asinchronical communication also have no problem.

     Your main problem is just the LCD display problem, it seems your code and the LCD caption is not matching, you should check your LCD datasheet, what the caption it is needing.

    Besides, I suggest you test the fixed LCD display character at first,  after the LCD display problem is solved, then add the asinchronical communication to display the dynamic character.

Wish it helps you!

If you still have question, please let me know!

Have a great day,

Jingjing

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复