Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/22/09 20:00
Read: times


 
#166370 - choose a "magic" frequency crystal ...
Responding to: ???'s previous message
Aleksandar Stancic said:
I have a two layer board, it does have GND polygon planes on both sides,
and the freq will be 20MHz.

48MHz is just a way to test faster UART programming

... such as 18.432MHz or 22.1184MHz. These divide to the "standard" UART speeds better than 20MHz or even 48MHz. With 20MHz, the autobaud routine cannot establish proper baudrate.

On my webpage* you can find an excel chart showing on which baudrates can successfully autobaud the P89V51RD2 (Philips/NXP (and, actually, SST) variety of the 'RD2 sub-family) - you enter crystal and "assymmetry" between 0 and 1 (caused by distorted edges on the RS232 line and the non-zero decision level of the RS232 receiver), and the error value for "bad" baudrates turn red - watch out also that the last 2 columns contain probability that either of the two reload value will be calculated, so where there's only one red value, the percentage of the "nonred" one will give you the probability of autobauding at that baudrate. Particularly, if you leave the "assymetry" value at -0.3us, and set crystal frequency to 20MHz (20000000), both reload values for 115200 baud result in error impossible to communicate with. Interestingly, at 57600 baud the error is small enough for both cases so it will autobaud on that baudrate every time; but at 38400, the probability of the one reload value resulting in too high error ("red") is >90%, so 38400 will probably not work at all; and 28800 will work 4 times in 5 attempts.

Even if the autobauding routine is different in the Atmel variety so that chart is not valid for you at all, the rough picture remains true.

JW


--
* sorry it's down today and will most probably remain so for the rest of the week - I forgot to pay the registration fee for the domain in time :-( Meantime, here it is from the internet archive.


List of 14 messages in thread
TopicAuthorDate
AT89C51ED2 changing speed on its own            01/01/70 00:00      
   apply proper reset            01/01/70 00:00      
      apply proper reset            01/01/70 00:00      
         then that's R0 not R1            01/01/70 00:00      
         MAX1232 + 4k7 pull-up            01/01/70 00:00      
            I beliebe this chip has a built-in watchdog and thus ...            01/01/70 00:00      
               I don't like those on-chip watchdogs and Vcc monitors            01/01/70 00:00      
                  Should be always on            01/01/70 00:00      
                  external vs internal            01/01/70 00:00      
                     ..            01/01/70 00:00      
                        Ground plane?            01/01/70 00:00      
                           no ground plane            01/01/70 00:00      
                              choose a "magic" frequency crystal ...            01/01/70 00:00      
                                 20MHz and 57600            01/01/70 00:00      

Back to Subject List