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

strange interrupt behaviour

Hopefully someone can give me a tip. I'm completely lost on what's happening.

I have the following problem. Using a 87C51RC processor I'm using 2 timers with interrupt, Serial comm with interrupt and the PCA timer with interrupt.
The problem is that, while there is no code which generates a serial interrupt (nothing is written to SBUF) the TI flag is set after the Timer0 interrupt has been processed. In other words, after a Timer0 interrupt the TI flag is set for no apparent reason. I read after doing a search on the forum that sometimes a timing issue can cause a problem. after building several loops to reduce speed, and reducing the level of optimization. I still have no idea where to look. I would greatly appreciate any help on this issue. I am using:
C51 Ver. 7.01
BL51 Ver. 5.01
uVision2 Ver 2.31

Kind regards
John Garrelts

Parents
  • When you do SBUF=0 the UART will transmit the zero then set TI once it is ready to accept another character for transmission. The time between writing to SBUF and TI being set will depend on the baudrate you are using.

    I don't think you really want to transmit a zero - there is no need to 'reset' SBUF.

    Stefan

Reply
  • When you do SBUF=0 the UART will transmit the zero then set TI once it is ready to accept another character for transmission. The time between writing to SBUF and TI being set will depend on the baudrate you are using.

    I don't think you really want to transmit a zero - there is no need to 'reset' SBUF.

    Stefan

Children
No data