Hi, I tried to write and read data through the UART pins using 'printf' and 'scanf' commands.The simulations in keil and Proteus seems to be OK but when I try to use the hardware the write string at the RXD pin is reflected at the TXD pin partially for the P89V51RD2 and fully for the 89c51. I tried 'puts' and 'gets' routines also. Please help me suggesting C codes for the use.
umar_ka@yahoo.com 19/08/2014
Umar;
You say that your program in the simulation/debugger works. Then it would appear you have some type of hardware problem.
Look at the following link for information how to Assign the simulator Comm ports to the actual PC Comm ports and use an Oscope to ensure your data signals are correct.
http://www.keil.com/support/man/docs/uv4/uv4_cm_assign.htm
Bradford
"Look at the following link for information how to Assign the simulator Comm ports to the actual PC Comm ports and use an Oscope to ensure your data signals are correct"
That's not going to help if the problem is in the target hardware!
It also won't show if the problem is due to incorrect configuration of the UART by the embedded code.
But it can be useful to verify the higher-layer communication with an external device...
a not uncommon beginner mistake is to 'forget' to include a MAX232 (equivalent)