Getting Configs straight


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2007
    Posts
    70

    Default Getting Configs straight

    On my exteenth day and night of using picbasic I am a bit muddled still about the config settings.

    Is it true there is no menu of some sort like in MPLAB to set configuration bits?

    If I get this straight, EVERY time I compile some pic basic code it has the .inc file compiled along with it? The config flags here are in effect the default setting for all pic projects you do with that include?

    If this is the case, is it also true that you can supercede these by putting your configs in your main program .bas in between an ASM and ENDASM?

    OK, last one! Hypothetically, could these configs be in an include? how deeply can I bury them? Not that I want to... I just want to understand the language.

    I am about to take the manual to bed with me(4am), that might clear up some questions...

    I am sure someone here can help in a more succinct manner..

    Thanks in advance

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    vacpress, I do all of my flashing of processors with MPLAB. There is an extensive configuration menu available for all of there different processors. I never set the configuration registers from within the source code. That is one thing that confuses many people. I mearly set the configuration just before I flash the device. I suppose that is one of the perks of using MPLAB for programming as well as compiling. I hear of so many people having problems with there 2nd and 3rd party budget flash programmers it makes me laugh. If they only sent a little money on something to flash processors with that will grow with the product line and they will have for a very long time. I have an PICKIT2 and an ICD2 that I use for debugging and have never looked back yet. As far as the configuration bits go you can import your hex file into MPLAB set the configuration bits to your liking and the export it with all configuration bits set ready for flashing with your 2nd or 3rd party programmer.

    Dave Purola,
    N8NTA

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


    Did you find this post helpful? Yes | No

    Default

    See this post http://www.picbasic.co.uk/forum/showthread.php?t=543

    Melanie did a good job explaining this, but If you still have questions let us
    know.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4
    Join Date
    Jan 2007
    Posts
    70


    Did you find this post helpful? Yes | No

    Default melanie via bruce -danke!

    bruce,

    no kidding, melanie did do a good job is spelling it out! however, reading through the thread i still have a question.

    is there an 'order of operations' for where config bits are pulled from? where does the compiler look for these specifically? i am having trouble tracking down a complete list of files that get compiled at any given time by PBP... it goes to fast for me to read them..

    also, if i 'Import' a .hex file i compiled out of microcode studio into MPLAB, does it set the config flags? in other words, say i load a .hex i downloaded precompiled, and wanting to know what is going on, import it into mplab - are the settings in the configuration bit window current for the imported .hex or just defaults?

    i have tried some experimenting, and cannot exactly tell. its a real bugger working with 3 different programs instead of say 1...

    ok. ive edited this post cuz noone read it yet... i have learned that you apparently CAN put fuses in a seperate include... mister e recomends 'configfuse.cfg'
    Last edited by vacpress; - 23rd January 2007 at 20:12. Reason: read more, learned more

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    PBP has a device specific header file for each PIC it supports. This gets
    included automatically each time you compile. In these header files are
    generic "default" config fuse settings.

    These are embedded in the .hex file. When you import a .hex file into
    MPLAB these default config fuse settings are used, and should show up
    in the config screen when viewed in MPLAB. You can either accept them,
    or change them from within MPLAB.

    I always include config fuse settings in my source. Changing them with your
    programmers software, or from within MPLAB, can lead to confusion down
    the road.

    I.E. If you can't tell by looking at the source what they were set to when
    you last programmed the target -- how will you know/remember the next
    time what you manually set them to?

    It's much easier to just drop them directly into your source code (or use the
    generic defaults) than trying to remember what they were "manually" set to
    previously.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6
    Join Date
    Jan 2007
    Posts
    70


    Did you find this post helpful? Yes | No

    Default thanks,thanks

    yeah. after once again and more carefully reading through the PBP manual, i have finally found the information about 'what all' files go into a typical pic basic compile... and i even now know what a .mac file is, finally!

    i also answered another of my own questions... which was 'can i bury the configs in a seperate include?'

    the answer seems to be 'yes'. although i am not certain to what extent, as it came out of some old forum post which suggests putting your config fuses in a configfuses.cfg...i do not know if this is a special or arbitrary file name... i will probably get around to trying this soon and may even remember to report back...

    i am imagining .cfg files with names like... 18f45504musb.cfg which would setup a 4550 at 4mhz with the usb regulator turned on... possibly make a few as i really do work with just a few different chip types...

    anyone tried anything like this?

    it sure would be cool if microcode studio had an API so I could begin automating some of this stuff...

    cheerio, robert

Similar Threads

  1. Replies: 33
    Last Post: - 19th March 2010, 03:02
  2. Pic 18f4620
    By 78Davide in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2009, 19:24
  3. IDE with emulation!
    By T.Jackson in forum PBP Wish List
    Replies: 22
    Last Post: - 26th February 2008, 20:39
  4. programming straight assembly with epic?
    By clr2cont in forum Off Topic
    Replies: 1
    Last Post: - 2nd March 2007, 15:12
  5. Replies: 5
    Last Post: - 28th June 2006, 21:32

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