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

Can't get TI flag to be set when writing into SBUF

Hi,

I'm trying to simulate working of a UART.
When I write into SBUF, the TI flag doesn't
go high even though I have enabled interrupts.

Is there any way I can simulate it using SOUT VTREG. can't find example how to use SOUT.

Parents
  • "I would like to use the interrupt based approach. Could you please post the same code in the way you suggest me to write."

    If I did that I'd be posting code nearly identical to Keil's example. If you are having trouble understanding the code in their example just post any questions you might have.

    If you want to use interrupt driven serial comms in your project you may as well bite the bullet and use a full implementation. The code is there, it's free and it (probably) works. Once you have compiled it into your project you can forget about SBUF, TI and RI, all you need to do is use the standard 'C' library functions.

Reply
  • "I would like to use the interrupt based approach. Could you please post the same code in the way you suggest me to write."

    If I did that I'd be posting code nearly identical to Keil's example. If you are having trouble understanding the code in their example just post any questions you might have.

    If you want to use interrupt driven serial comms in your project you may as well bite the bullet and use a full implementation. The code is there, it's free and it (probably) works. Once you have compiled it into your project you can forget about SBUF, TI and RI, all you need to do is use the standard 'C' library functions.

Children
No data