??? 01/30/09 16:57 Read: times |
#161843 - what sort of modem? Responding to: ???'s previous message |
If you mean "Hayes-compatibile" POTS modem, it relies on detecting the 'A' (and 'a') character, as all commands start with 'AT' (there is a single exception, 'A/', but still starting with 'A').
Autobaud means, that you don't know the baudrate in advance, so all of the following must be done "manually", maybe with help of edge-sensitive interrupts or regular timer interrupts or similar. 'A' (0x41) over UART is: ____ _ _ _____ |_| |_________| |_| S 1 0 0 0 0 0 1 0 P S = START, P = STOP So, you wait until falling edge, time the startbit, and basically you know the baudrate now. However, it's a good practice to time also the following 0th bit, as RS232 transceivers etc. tend to be "asymmetric" (a 1-bit 0 has often different duration than a 1-bit 1). You should also "manually" receive the rest of character to ensure it is indeed 'A' ('a' is for your homework ;-) ), and ignore if it is not. After the stopbit (middle of it actually) you should fire up the hardware UART receiver for the rest of the message, until some endmark (CR = 0x0D in case of the Hayes modem). If not Hayes-compatibility is the goal, there are also other characters to autobaud upon. For example the 'RD2-s bootloaders autobaud on 'U' (which is a train of 1-bit long 0s and 1s - this might seem a nice option but in fact it is not really the best one, if an application tries to throw a lot of them consecutively it's hard to distinguish a "legitimate" 1 from the stopbit). An another example is BASIC52, which autobauds on CR(0x0D). JW |
Topic | Author | Date |
Auto buad detect operation | 01/01/70 00:00 | |
what sort of modem? | 01/01/70 00:00 | |
Thanks Jan | 01/01/70 00:00 | |
a), but maybe some of b) too... :-) | 01/01/70 00:00 | |
Thanks again Jan | 01/01/70 00:00 | |
Does V.250 help? | 01/01/70 00:00 | |
not likely | 01/01/70 00:00 |