TOSLINK UART, limited to 9600 baud. Need ideas for improving speed/stability
The receiver is meant to receive signals with at least 0.1 Mbit/s data rate, it expects data with encoding like manchester to have about 50% duty cycle for the light being on or off. The bits sent from UART at 9600 bps is just too slow and even baud rate is set to 115200 bps it would still work poorly as there is no encoding. The data has too long on and off periods to be received properly, depending on the data sent. So if you must make it work, you could do the encoding in software so that hardware can send continuous encoded data stream at 115200 bps