18F2520 clock speed ?


Closed Thread
Results 1 to 25 of 25

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Gixxer View Post
    It has an 18f2520 with a 10Mhz smt crystal, according to the docs it is actually running at 40Mhz, I assume that has been accomplished by the provided pre-programmed software.
    Most of the 18F's can multiply the crystal frequency X4, using the Phase Locked Loop feature. So you can run at 40mhz with a 10mhz crystal.

    The options for using the x4 PLL with the HS oscillator are set in the configs.
    This thread explains all that better than I could.

    Presetting Configuration Fuses (PIC Defines) into your Program
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    <br>
    DT

  2. #2
    Join Date
    Dec 2007
    Location
    Toronto, Ontario
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    Hi DT,

    Thanks for that reply. I am able to set all config fuses using the melabs U2 programmer software. I did set the 10mhz xtal to 'HSPLL' under xtal setting, which worked but is also the source of my problem. For example, if I flash an led using a 4mhz xtal at 1hz(1000ms) pause between flashes, it will flash once per second. Using the same program, running at 10 or 40mhz, the led flashes very fast, not at 1hz. This is the problem I'm having with the baud, with 4mhz xtal it all works great and with the 10mhz xtal all I get is garbage at the output. So, obviously 9600 baud at 4mhz is not the same as with a 10mhz xtal. How do I make it output 9600 baud at 10 or even 40mhz ?

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    PBP assumes you're running at the default 4MHz (regardless what crystal or PLL multiplyer you're using) and bases all it's timings on that unless you tell it otherwise...

    Look for DEFINE OSC in your manual...

    There's also a whole section entitled "How fast is fast enough?" (section 7.1 in my manual).

  4. #4
    Join Date
    Dec 2007
    Location
    Toronto, Ontario
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    Thanks Melanie,

    That explains my problems with any xtal other than 4mhz. I will check into my PBP manual for info about DEFINE OSC, but will that allow the use of other osc frequencies ?
    Also, where do I find your book ?
    And one more thing, are there any threads in this forum already explaining the implementation of Xbee's with pics. I do have mine working @ 4mhz, and they are great, just want more info.

    thanks alot
    John

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Gixxer View Post
    Also, where do I find your book ?
    .....................ffffffffffffffffffftttt

  6. #6
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Close Ski - but no cigar...

    The correct answer is "It was in the bottom of the box when you bought your software".

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    Close Ski - but no cigar...
    The correct answer is "It was in the bottom of the box when you bought your software".
    Aw....shucks! I knew I should've taken Door #2.
    Could I get a consolation prize on my way out the door?
    (somebody else around here did say I've been 'off' for the past couple of weeks or something)

Similar Threads

  1. Clock Speed
    By Del Tapparo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th November 2007, 02:06
  2. Replies: 14
    Last Post: - 26th September 2007, 05:41
  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. clock speed
    By Armando Herjim in forum General
    Replies: 1
    Last Post: - 30th November 2006, 12:25
  5. Faster Clock Speed for Shiftin/out?
    By achilles03 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th December 2005, 02:15

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