In the debugger of uVision I would like to simulate the incomming of one data on the serial port. The problem is: when I change the value of SBUF, the debugger thinks that I want to send a data because the debugger automatically set the TI bit. So I would like to know how I can simulate a data reception with uVision 2 debugger ? Thanks
The debugger is doing exactly the right thing. SBUF is a read/write register with a direction latch. When you write to it (change it) the value goes to an output shift register and sets TI when the stop bit gets shifted out. When you read it you get the results of the last char shifted in. You cannot stuff something into SBUF to simulate a received char. Read from an array (that you create) instead of SBUF to simulate received chars. - Mark