Do the caps in a 4 mhz clock make a difference


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    The capacitor shouldn't affect too much, btw their tolerance is often high... so don't worry too much.

    This will help if we see your actual code.

    'Beer is proof that God loves us and wants us to be happy. This also make ugly people looking better
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Apr 2007
    Location
    Southern Ontario
    Posts
    50


    Did you find this post helpful? Yes | No

    Default

    Thank you for the help I will try and get the right caps for the crystal. I am new to electronics but can help with water problems if anyone needs them.
    Snap
    Beer is proof that God loves us and wants us to be happy.

  3. #3
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Are you counting 1000 overflows to equal 1 second?
    [(256-131*8)*1000 = 1000000uS]

    If so, you need to realize that TMRO has a 2 cycle delay after you write to it (see the datasheet). This would equate to [2*1000*60 = 120000uS (or .12S)] of your error (per minute). The other (part of the erro) from the fact that after you detect the overflow, TMRO is still counting ... you probably have some latency before getting to it to rewrite the 131. I bet this latency is the rest of your error (i.e., you are resetting a TMRO that has interrupted and carried on with counting when you re-write to it).

    Options
    1) adjust in software
    2) free running TMRO - does not stop TMRO http://www.picbasic.co.uk/forum/showthread.php?t=2129

    Lastly, you want XTAL caps of 15-33 pF (not 0.20pF or 0.22pF). It should not matter the value as long as you are in the ballpark – they should run your XTAL near the stated tolerance for the XTAL. I cannot image persuading the XTAL to vary by a percent or so day to day as suggested earlier in this thread – maybe I have been lucky the last 10 years, who knows.

    Good Luck,
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by paul borgmeier View Post
    Lastly, you want XTAL caps of 15-33 pF (not 0.20pF or 0.22pF). It should not matter the value as long as you are in the ballpark – they should run your XTAL near the stated tolerance for the XTAL. I cannot image persuading the XTAL to vary by a percent or so day to day as suggested earlier in this thread – maybe I have been lucky the last 10 years, who knows.
    Good Luck,
    I was throwing out ideas earlier. I've never tried to see how far I could 'pull' a crystal or even if I could do it.
    But you're definetly right about reloading the timer. A guy should add a number to the timer rather than reload it with a fixed value in a case like this.

    And I think it would really help in this case to see some more code...

  5. #5
    Join Date
    Apr 2007
    Location
    Southern Ontario
    Posts
    50


    Did you find this post helpful? Yes | No

    Default

    I Used the code from Dogan Ibrahims book Pic Basic programming and projects.
    Project 16 I copied the code onto my laptop and do not have the time to copy the entire thing out here. The main point of my question was if the caps could effect the clock and I understand (by the answers) they can if they are way out I really apprecate all the help and will publish the code if you want it but I just wanted to understand the relationship between a clock and the 22pf caps.
    Thanks again
    Snap
    Beer is proof that God loves us and wants us to be happy.

  6. #6
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    ...

    'Beer is proof that God loves us and wants us to be happy. This also make ugly people looking better


    That means, the beer is a religious drink given by God.

    Therefore, it is also the proof that God exists.

    To atheists, let it be provided as an evidence of God, then.

    WoW!
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. 12F683 - how to set it to use external 4 MHz clock?
    By jimbostlawrence in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 29th September 2009, 09:16
  2. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 00:55
  3. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. Replies: 5
    Last Post: - 11th February 2007, 23:55

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts