Sync with Internal clocks

Discussion in 'Embedded Systems and Microcontrollers' started by micropad, Dec 24, 2011.

  1. micropad

    Thread Starter Member

    Dec 24, 2011
    38
    0
    Dear All
    please advice what is the meaning of Timer0 "Sync with Internal clocks" of pic 16f877a MCU
    what is the in phase of internal clock and external clocks
     
  2. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    The timers increment at the same speed the CPU runs. Typically, Fosc/4, so if you have a 20Mhz crystal, the cpu executes 4 millioni instructions per second, and timer0 with no pre-scaler increments at 4Mhz.
     
  3. micropad

    Thread Starter Member

    Dec 24, 2011
    38
    0
    Thanks For reply

    Please advice how Timer0 increment at 4MHz if you have 20MHz crystal.
    I think it should be 5MHz (Fosc/4 = 5MHz) am I correct.
     
  4. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Yes, it was a typo on my part. I meant 5Mhz w/20Mhz Oscillator (4Mhz w/16Mhz Oscillator).
     
  5. micropad

    Thread Starter Member

    Dec 24, 2011
    38
    0
    if timer0 increments same as CPU rans. how we measure the frequency lower than the CPU rans in Sync with Internal clocks in counter modes

    please advice
     
  6. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Uwe the capture part of the CCP module, See the datasheet, timer0 and runs in the background while other code is running.
     
  7. micropad

    Thread Starter Member

    Dec 24, 2011
    38
    0
    Thanks for reply
    yes correct Timers running while other codes running
    so where I stuck is, why the external clock sync with internal clock and what is sync. I think internal clock and external clock should comes on in phase that is called sync

    please advice
     
  8. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    External clock, such as CLKOUT sync is to keep outside logic moving at the same speed as the CPU, or the fastest rate the CPU's pins could change state.
     
  9. micropad

    Thread Starter Member

    Dec 24, 2011
    38
    0
    Thanks for reply

    All are I pointed out related to timero counter mode
     
Loading...