??? 08/11/09 19:38 Read: times |
#168328 - Autobauding Responding to: ???'s previous message |
Hi Csmg,
When implementing an autobaud routine, you might try requiring the reception of the ASCII character 'U', which is 0x55, or in binary 01010101. Now all you need to do is measure the time between any two successive transitions. Or if you have time to do so, repeat the measurement and take the average. If you can't require the reception of a 'U', I've thought in the past that there might be a way to do this using any transmitted data. My idea is based on the Milikan oil drop experiment (the bane of undergraduate physics students the world over). Basically, you measure the time between successive transitions multiple times. You will then have a set of varying time periods ranging from the shortest to the longest. You know that the shortest period you can have is 1 bit. And you know that there is a maximum number of bits you can receive too (depending on your UART settings). Once you know your shortest period, assume it's one bit and see if the longest is more the 8 times (or 9 times) that time period. If the longest is shorter than 8 (or 9) times the shortest, test to see if all the periods are an integer multiple of the shortest (a condition that must be true, within the tolerance of your measurements of course). If they are not, divide the shortest time by 2 and repeat. If necessary divide the shortest time by 3 and repeat. If necessary, divide by 4 and repeat, or measure some more transitions and repeat. Good luck, Joe |
Topic | Author | Date |
Serial Auto Baud Rate Detection | 01/01/70 00:00 | |
what is the purpose of this line | 01/01/70 00:00 | |
Function Calls | 01/01/70 00:00 | |
Waiting for destruction | 01/01/70 00:00 | |
Re:Waiting for destruction - Suicidal Move! | 01/01/70 00:00 | |
Autobauding | 01/01/70 00:00 | |
Why must it be in 'C'?![]() | 01/01/70 00:00 |