Actually I intend to design a DLL interface for serial communication supporting MARK and SPACE mode. When the data from outside come, I wish the simulation to put them into the registers of the 8051. However, as mentioned before, the SBUF seems of little use, and I have tried SIN, which I assumed that the value in SBUF would change with it accordingly but found that it was of no help. What should I do to get the data into the registers? Thanks!
If your 8051 code works with the standard uVision COM port interface, then the fault must lie in your DLL. I have tried the code assigning com1 to sin and sout, however, ch can not get the value from com2.
"I have tried the code assigning com1 to sin and sout, however, ch can not get the value from com2." Well of course it can't! If you've assigned SIN and SOUT to COM1 they will obviously not get anything from COM2!!!
If you've assigned SIN and SOUT to COM1 they will obviously not get anything from COM2!!! As previously described, I run a program sending data from COM2 to COM1!
"I run a program sending data from COM2 to COM1!" Have you checked independently that the connection from COM2 to COM1 is actually working? eg, by using Hypoterminal?
Yes, I have checked them, they are working normally. My previous test in the keil is using the program pasted above. I checked it assigning COM1 to sin and sout, while using a program to send out data from COM2.