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
  • "If I am to write to SBUF in the isr then I am facing an issue of reentrancy."

    How do you figure that?

    "My main interest is to say, write "Hello World" and I would like to use some_func(char *str) in the main(void) so I would give something like some_func("Hello World") in the main and our serial ISR is exected to print it and then wait for the next string whenever I send through some_func. How should do that?"

    How about this:

    printf("Hello world");

    If you compiled Keil's serial interrupt code that is all you would have to do. Why are you determined to reinvent the wheel?

Reply
  • "If I am to write to SBUF in the isr then I am facing an issue of reentrancy."

    How do you figure that?

    "My main interest is to say, write "Hello World" and I would like to use some_func(char *str) in the main(void) so I would give something like some_func("Hello World") in the main and our serial ISR is exected to print it and then wait for the next string whenever I send through some_func. How should do that?"

    How about this:

    printf("Hello world");

    If you compiled Keil's serial interrupt code that is all you would have to do. Why are you determined to reinvent the wheel?

Children