What does SCON0_TI = 1 mean for the EFM8?

SCON0 is the UART0 serial port control register (Serial CONtrol 0). TheĀ TI bit enables theĀ *Transmit Interrupt,*i.e. when the transmission of a byte is finished, the CPU will be interrupted.


SCON0_TI = 1;

is neccessary for some of the EFM8 UART libraries (like the STDIO UART library) so they initialize properly. Although this is a simplification, the library needs to know that there is no UART transmission going on at the moment.

Also, don’t forget to enable global interrupts using

IE_EA = 1;

else, the UART0 transmit interrupt will never be run.