I found this code in an old book from TI circa 1981.
I thought the gang here might find it interesting. Apologies. I have not assembled it and the tabs are all wrong but it's a neat idea.
It appears to work by measuring the time between mark and space in the signal and then looking up the rate interval for that measurement in the table.
Smart people at TI in 1981.
Minor edits per Stuart's comments
* autobaud for 9902 * Software Development, Texas Instruments 1981 LI R12,BASE SBO 31 LI R1,6200 LDCR R1,8 SBZ 13 CLR R3 * wait for start bit SBAUD TB 15 JEQ SBAUD * wait until rin goes back to space condition SBAUD1 INC R3 TB 15 JNE SBAUD1 * FIND THE BAUD RATE LI R4,BAUDTB-2 SBAUD2 INCT R4 C R3 *R4+ JH SBAUD2 * baud rate found - set recieve and transmit data interval * read a char and throw it away LDCR *R4,12 SBAUD3 TB 21 JNE SBAUD3 SBZ 18 BAUDTB DATA >0007,>001A * 19200 DATA >000E,>0034 * 9600 DATA >001D,>0068 * 4800 DATA >003B,>00D0 * 2400 DATA >0075,>01A0 * 1200 DATA >00EA,>0340 * 600 DATA >0246,>04D0 * 300 DATA >7FFF,>0638 * 110
Edited by TheBF, Sat Dec 15, 2018 10:02 AM.