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/06 17:11
Read: times


 
#106907 - why not '52?
Responding to: ???'s previous message
Using it with e.g. 16MHz crystal:
  • use T2 in Programmable ClockOut mode down to 16MHz/4/65536 = cca 62Hz; for the worst case the error is:
    the real frequency f depends on real divider n (f=16MHz/4/n); as f<=1kHz; n<=4000. n is a rounding of ideal divider N=16MHz/4/F (F is the requred frequency) so it differs from it by abs(n-N)<=0.5; we won't bother with abs assuming n<N (it makes no difference, we could make the proof for the other case in the same way), so the maximum possible relative error is (F-f)/f=(16MHz/4/n-16MHz/4/N)/(16MHz/4/n)=(1-n/N)<=1-n/(n+0.5)=0.5/(n+0.5)<0.000125=125ppm.
    The real maximum occurs at 989Hz, has relative value of 121ppm which means absolute error of cca 0.12Hz. Note that the common xxMHz crystals have error (inaccuracy+drift) of 50-100ppm.

  • use an interrupt-driven counter (any, T2 will do) for frequencies below 62Hz. The error given by interrupt latency will be in the order of a couple of us, well below 1 ppm...

  • stop toggling output pin for Fout=0Hz :-)

Of course any other crystal value will do, the higher the better, recalculate as needed.

Am I missing something?

Jan Waclawek

List of 28 messages in thread
TopicAuthorDate
frequency generation            01/01/70 00:00      
   Use an NCO            01/01/70 00:00      
      Microcontroller emulates NCOs            01/01/70 00:00      
         Nice but...            01/01/70 00:00      
            we can think of something            01/01/70 00:00      
         nothing special            01/01/70 00:00      
   how about a PLL (Phase Locked Loop)            01/01/70 00:00      
      PLL            01/01/70 00:00      
         0 ?            01/01/70 00:00      
            Part no?            01/01/70 00:00      
               Clock speed            01/01/70 00:00      
            0 Hz Frequency            01/01/70 00:00      
               Differenece between...            01/01/70 00:00      
   If Max is 1 kHz, ...            01/01/70 00:00      
      more details            01/01/70 00:00      
         Difficult !            01/01/70 00:00      
   8253?            01/01/70 00:00      
      Mode 3            01/01/70 00:00      
         mode 3 again            01/01/70 00:00      
      Example            01/01/70 00:00      
         1MHz / 1001            01/01/70 00:00      
            Concretely...            01/01/70 00:00      
      Overview of functions            01/01/70 00:00      
      What do you think?            01/01/70 00:00      
         why not '52?            01/01/70 00:00      
            is it possible?            01/01/70 00:00      
         its an option            01/01/70 00:00      
   please i need to square wave osscillator            01/01/70 00:00      

Back to Subject List