Config help


+ Reply to Thread
Results 1 to 10 of 10

Thread: Config help

  1. #1
    Join Date
    Jun 2013
    Posts
    30

    Default Config help

    I need to use a crystal of 12 MHz for my project,I read the PBP manual and it state that if the crystal is beyond 4Mhz ,a HS config must be set or the MCU may not work,But they are very limited resource in the manual about config,is there any resource available on the command?

    Thank you

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,283

    Default Re: Config help

    Hi,
    Not wanting to sound like a smart-ass but since you asked for a resource I'm going to send you right back to the manual. Section 4.9 covers the #CONFIG/#ENDCONFIG directive in some detail and there's quite a bit of information on this forum.

    /Henrik.

  3. #3
    Join Date
    Jun 2013
    Posts
    30

    Default Re: Config help

    Yes,I read it,it do have some example,but what all those word means?
    CONFIG XINST = OFF
    CONFIG PLLDIV = 5
    CONFIG WDTPS = 512
    CONFIG CPUDIV = OSC1

    This is part of the example,what is all those word after config means,why 512'why 5?what to be set off,there are no explanation ,what all those number means?

    And most of all,how to set the MCU to operate at 12mhz?obviously is not Define osc 12.i tried
    Last edited by Sabahan; - 2nd September 2014 at 00:16.

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    1,731

    Default Re: Config help

    And most of all,how to set the MCU to operate at 12mhz?obviously is not Define osc 12.i tried
    as has been discussed thousands of times osc must be in upper case ( OSC) and only tells the compiler what osc frequency to base its timing calculations on.

    CONFIG XINST = OFF
    CONFIG PLLDIV = 5
    CONFIG WDTPS = 512
    CONFIG CPUDIV = OSC1
    are config word (sometimes refered as fuse ) settings for a particular pic chip , they must match the chip you are using and the particular configuration that you want it to adopt.
    read the data sheet .
    consult your manual on methods of setting the "config word(s) " for your chip

  5. #5
    Join Date
    Jun 2013
    Posts
    30

    Default Re: Config help

    I found something interesting to read,about the config

    http://melabs.com/support/config_defaults.htm

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    1,731

    Default Re: Config help

    if you need more help you will get a better result by providing the forum with your pbp version , the chip you are using and the actual code (in code tags) you have tried

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,817

    Default Re: Config help

    Quote Originally Posted by richard View Post
    if you need more help you will get a better result by providing the forum with your pbp version , the chip you are using and the actual code (in code tags) you have tried
    Hi Sabahan,
    What Richard said is critical as Configs are handled differently in PBP 3.xx over any prior version. The HS in the config statement simply turns up the power to the OSC so as to enable it to run faster. As stated above DEFINE OSC 12 simply makes PBP aware of the change from default 4 mhz, and has no effect on the actual OSC.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  8. #8
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,253

    Default Re: Config help

    Quote Originally Posted by Sabahan View Post
    Yes,I read it,it do have some example,but what all those word means?
    CONFIG XINST = OFF
    CONFIG PLLDIV = 5
    CONFIG WDTPS = 512
    CONFIG CPUDIV = OSC1
    ...
    Some reading if you are still on PBP v2.6 or earlier:

    http://www.picbasic.co.uk/forum/showthread.php?t=15982

    Robert

  9. #9
    Join Date
    Jun 2013
    Posts
    30

    Default Re: Config help

    I'm using PBP3,seems that there are not much info on the net on this topic

  10. #10
    Join Date
    May 2013
    Location
    australia
    Posts
    1,731

Similar Threads

  1. config
    By n0yox in forum PBP3
    Replies: 12
    Last Post: - 10th June 2014, 08:07
  2. PIC12F675 - config
    By Vezito in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th June 2011, 20:29
  3. ADC Config
    By TrevorDawes in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th April 2010, 01:34
  4. config help please?
    By karenhornby in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 17th June 2008, 23:49
  5. Need help with config
    By Darrenmac in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 25th February 2008, 06:57

Posting Permissions

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