AnsweredAssumed Answered

FRDM-KL25Z UART0 Serial port reading wrong

Question asked by Peng Liang on Oct 23, 2013
Latest reply on Apr 3, 2016 by Ajinkya J

Hi all,


I wrote a program for UART0 driver. Test the program by typing keyboard and send back on the screen the char that i typed. I am using pooling method to check if RDRF is 1, then get the value from UART0->D register.


However, this program works for sending out the chars. it does not work for read the char from the keyboard.


for example, I can send a string "uart0 test" to the screen without problem. but if I type 'a' on the keyboard. it returns weird char on the screen. I checked return value in hex is 0xB0. it suppose to be 0x61.


any idea why? this so strange.


I have no problem sending out a string. just cannot read a right value back. I have tried many ways, bypass openSDA, connect a serial port directly; using static volatile variable. but it does not work at all.


Thanks in advance