Changing the Configuration Settings


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2007
    Posts
    26

    Default Changing the Configuration Settings

    Greetings,

    I am using MicroCode Studio to write my code and then click Project/Compile and Program. This then opens meProg and I click Ctrl-P to program the PIC. The PIC is connected using MeLabs U2 USB Programmer. I do all this but am not really totally sure of what is going on.

    My problem is I want to increase the oscilation value from 4 to 20. It says in the manual that I need to open an .inc file with the same name as my PIC and change XT to HS.

    First problem is where is this inc file. There are a bunch in C:\PBP and I am guessing these are the ones. But next problem is there is not one exactly the same name as my PIC (PIC18F4620). However, there is one 18F46K20.INC.

    There is a line in this file with OSC and XT in it: __CONFIG _CONFIG1H, _FOSC_XT_1H
    So I change XT for HS as mentioned in the manual: __CONFIG _CONFIG1H, _FOSC_HS_1H

    I then change the define to: DEFINE OSC 20
    I change my 4MHz Ceramic Resonator with a 20MHz Ceramic Resonator, and all should be good one would think.

    But it isn't - my program output does not work.

    All I am doing is sending simple SEROUT2 i.e. Serout2 0, 16468, [$1b, $52, 1, DEC test]
    My program seems to be running slower than when I had it using 4MHz

    Anyone got any ideas of what I am doing wrong.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Check the version of PBP. You are looking in the right place for the *.inc file. Not sure of the version support started for the 18F4620. It is in PBP 2.47 but not in PBP 2.43.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Oct 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    This is where it all gets a bit confusing for us new at this. The MicroStudio version I am using is 3.0.0.5 and the melabs Programmer is version 4.21 these are the only two programs I am using. How these relate to PBP or the version number 2.47 or 2.43 I am not sure. The only reason I looked in the PBP directory is that I did a search for .inc files and noticed that directory. I am happy to spend time reading about this somewhere but finding that special somewhere, where it is explained well seems to be the trick.

    Cheers Bruce

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    In Microcode Studio, click Help, and click about, it will open a pretty blue box and will display the versions of Microcode Studio and PBP. FSOSC is an oscillator with a fail safe backup oscillator which runs at something like 31.25 Khz. I do not have experience with any 18f series chips, if you are a noobie, maybe you should start out with a simpler 16F series chip like 16F648A, it has 4K memory, an eeprom and plenty of features to confuse you but far less than what you are using. This chip, the 18F, has OSCON register, Methinks it has something to do with your problem.
    JS
    EDIT: this is copy and pasted from the 18f4620.inc file in MPASM.
    _OSC_HS_1H ' no F in there
    Last edited by Archangel; - 24th October 2007 at 06:55. Reason: add
    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.

  5. #5
    Join Date
    Oct 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    Yes, I think that is good advice that I should start with a simpler PIC and learn the ropes a bit before jumping in the big pool. At least then I know it is not advanced features that might be mudding the waters and confusing me. By the way my version of PBP (I get it now PicBasicPro) is version 2.5. My problem is that I want to know it all right away, and I see that is not going to happen. Thanks for all the help it has been very useful.

    Cheers Bruce

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. PIC 16F684 Configuration Settings
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th April 2007, 15:18
  3. Changing Settings ???
    By tico in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 28th December 2006, 03:10
  4. Replies: 7
    Last Post: - 14th July 2006, 03:21
  5. Changing CONFIGURATION word from within program
    By btaylor in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th March 2006, 10:01

Members who have read this thread : 1

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