zain.mir wrote: softuart library [...] works but not for a 115200 baud rate.
At 115.2K baud the bit time is 8.68uS. That's only 694 CPU cycles at 80MHz. I've operated my SW UART code at 115.2K transmiting but reception is dicey at best at that speed. Lower baud rates are more likely to work because there is more "room" to allow for system NMI servicing, system call overhead, etc.
You might be able to get the code you referred to to work if you change the CPU speed to 160MHz. You might also be able to modify the referenced code so that it is more efficient. Some possibilities:
o Strip it down to support a single SW UART.
o Change pin I/O to support only the two pins you want thus eliminating the table lookup.
o Read the RTC Timer2 register directly rather than calling system_get_time(). I haven't looked at system_get_time() to see how much overhead it adds.
o Eliminate RS485 support and everthing else you don't need.
If none of that works and you still insist on using 115.2K baud you'll probably have to add an external UART chip.