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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/09/12 18:41
Modified:
  01/09/12 19:43

Read: times


 
#185396 - Use Timer2 since a S52 has a timer2
Responding to: ???'s previous message
From the bible:
RCAP2 = 65536 - F_CPU / 32 / 31250
this is 65525 for 11.059MHz
i.e. 31418 baud

Incidentally, now that I have had a play, I see that you can do the sum very easily. e.g.
7.3728MHz -> RCAP2 = 65536 - 7 -> 7.3728/7 = +5.3%
11.059MHz -> RCAP2 = 65536 - 11 -> 11.059/11 = +0.54%
14.7456MHz -> RCAP2 = 65536 - 15 -> 14.7456/15 = -1.7%
18.432MHz -> RCAP2 = 65536 - 18 -> 18.432/18 = +2.4%%

UARTs need to be within +-2% of your desired baud rate. I would be quite happy with 0.5%. It looks as if 11.059 is your only viable choice. 14.74Mhz should just work.

I am sure there are some tables somewhere. I just got the calculator out.

Anyway, why are you worrying about the F_CPU? You simply choose the best crystal for your critical peripherals. Then scale all your non-hardware calculations.

David.

List of 6 messages in thread
TopicAuthorDate
31.25K Baud Rate w/Crystals Other Than 6, 12 or 24MHz            01/01/70 00:00      
   Use Timer2 since a S52 has a timer2            01/01/70 00:00      
      Timer2 Baud Rate            01/01/70 00:00      
         Your maths look fine            01/01/70 00:00      
            I just got the calculator out            01/01/70 00:00      
               It Works!!!            01/01/70 00:00      

Back to Subject List