I recently found this example (both in C and asm) to do similar to the auto baud rate detection posted below for the 8051.

slaa215.zip ) ( slaa215.pdf )

del.icio.us | digg