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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/10/05 16:52
Modified:
  10/10/05 16:57

Read: times


 
#102175 - How to count seconds
Responding to: ???'s previous message
Rohit said:
This means we can\\\'t simply count the number of overflows from it counting from 0 to 65536. We\\\'ll be introducing even more inaccuracy. In the case of an 11.0592Mhz crystal, this inaccuracy will be about 0.44%, but if we were to use this same program with a 12.000Mhz crystal, the inaccuracy would be 1.70% which is much worse. Other crystal frequencies could result in even less accuracy.

For a software based RTC you need to count seconds. So, what happens if you have a 11.0592MHz crystal and use the internal timer/counters?
When each overflow from counting from 0 to 65536 gives you a tick, then you get a time base of 1 / (11.0592MHz / 12 / 65536) = 0.07111111sec. If you now count 14 of such ticks, you will get a period of 14 x 0.07111111sec = 0.99555554sec. If you count 15 ticks, you will get 15 x 0.07111111sec = 1.06666665sec.
So, you will have a problem, because neither 14 nor 15 ticks will give you excatly 1sec. Best deviation is (1 - 0.99555554) x 100 / 1 = 0.44%.

Kai

List of 19 messages in thread
TopicAuthorDate
Software Based RTC            01/01/70 00:00      
   Context            01/01/70 00:00      
      Link to my RTC - sftware crystal freq.            01/01/70 00:00      
   The precision is depending on the fracti            01/01/70 00:00      
   How to count seconds            01/01/70 00:00      
      How to decide count for a 3.5795Mhz,            01/01/70 00:00      
         the frequency range does not matter            01/01/70 00:00      
            the "tricks"            01/01/70 00:00      
         3.93216MHz is better            01/01/70 00:00      
            4.915200            01/01/70 00:00      
            3.93216 ??            01/01/70 00:00      
               3.93216 is standard frequency            01/01/70 00:00      
                  Can i have some clarifications on XTALS            01/01/70 00:00      
                     manufacturing tolerances            01/01/70 00:00      
                        low frequencies Crystals are bigger ?            01/01/70 00:00      
                     32.768kHz means low current consumption            01/01/70 00:00      
                        so higher Frequeny crystals are accurate            01/01/70 00:00      
                           Yes!            01/01/70 00:00      
   The Right Frequency            01/01/70 00:00      

Back to Subject List