This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Running parallel program

HI,
I have designed a controller for a system for my project. I have interfaced RS 232with it and rx and transmit data to DS89c420.
I have been asked to stop all the operation on entering a particular char say Q, my question is dat is it possible to run a side program that monitors the SBUF continuously on side of the main program...
I did monitored the SBUF at the start nd end of the main loop but since the SBUF gets d data regularly from the main program, any thing i enter in between the program will get over written..
Plss help me .

Parents
  • Another thing here is to recognize that SBUF is not one register.

    It is a read-only register for received data.
    And a write-only register for transmitted data.
    Above two are sharing the same address.

    So what your main loop put into SBUF for transmission will not affect what values you may be able to read out of SBUF when the UART have received data from the other side.

    You obviously have to look at the status bits to know if the write-only SBUF register is ready for more outgoing data. And if the read-only SBUF register have received any data that needs to be read out before next character gets received.

Reply
  • Another thing here is to recognize that SBUF is not one register.

    It is a read-only register for received data.
    And a write-only register for transmitted data.
    Above two are sharing the same address.

    So what your main loop put into SBUF for transmission will not affect what values you may be able to read out of SBUF when the UART have received data from the other side.

    You obviously have to look at the status bits to know if the write-only SBUF register is ready for more outgoing data. And if the read-only SBUF register have received any data that needs to be read out before next character gets received.

Children