A header wizard


Closed Thread
Results 1 to 40 of 230

Thread: A header wizard

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by prstein View Post
    Right now it parses the .inc files for the selected PIC (if they're not in the default locations on you computer you have to set the paths). From the MPASM files it parses out all of the provided configuration settings, and from the PBP folder it parses out the current default configuration settings.
    That sounds great!

    I can get it to compile using something like this at the front of a large program, even with some includes thrown in for the PIC18F67J50. And I see the change in my PicKit2 programmer. (Doing so with PBP inc files configs remmed out).

    Code:
    asm
        CONFIG XINST = OFF
        CONFIG PLLDIV = 5
        CONFIG WDTPS = 512
        CONFIG CPUDIV = OSC1
        CONFIG FOSC = HSPLL
    endasm
    
    or:
    
    
    @ CONFIG XINST = OFF, PLLDIV = 5, WDTPS = 512, CPUDIV = OSC1, FOSC = HSPLL

    See Bruce's post here: http://www.picbasic.co.uk/forum/show...3087#post13087

    There are some issues with other newer chips though. For instance the PIC26J50 uses OSC instead of FOSC, which really throws a wrench in the works. (See semi work around here: http://www.picbasic.co.uk/forum/show...0854#post90854 ) If anyone wanted to get fancy: If it was one of the chips that required a change to the pbp .inc file .... It could ask you "would you like me to edit your 18F26j50.inc file?" That would be so much nicer than looking through the list of chips, finding it, commenting other stuff out, and entering new settings, then hitting save. Don't know how many other chips we are talking about here though.

    I am not sure if it helps, but here is a PDF with a lot of chip's configs:
    http://ww1.microchip.com/downloads/e...ngs_51537f.pdf
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default

    Hi Paul,

    Just curious. Do you plan on having your program open source?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Just curious. Do you plan on having your program open source?
    Hello Dave,

    I certainly have no objections to sharing the code for this but I haven't a clue about how to explicitly "open source" a project. I'm open to suggestions.

    I'm writing the application in Delphi v4, mostly because I've been writing in various flavors of C/C++ for the past several months and I wanted (needed!) a change...8^)

    Best Regards,
    Paul

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by prstein View Post
    Hello Dave,

    I certainly have no objections to sharing the code for this but I haven't a clue about how to explicitly "open source" a project. I'm open to suggestions.

    I'm writing the application in Delphi v4, mostly because I've been writing in various flavors of C/C++ for the past several months and I wanted (needed!) a change...8^)

    Best Regards,
    Paul
    Not sure how the big open projects work...
    I guess to do it right a license needs to be decided on, GNU?
    Other than that jut make the code available someplace for folks to play with. If someone adds a function/fix then they let you know. You then work their code into a version if possible then release the updated version.
    If you do not want to incorporate code from others just make yours available someplace.

    If we can find others using Delphi or Python that want to help with this we could give out parts that need worked on. The "J" chip problem comes to mind.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    It is so much fun to see such intrest in this. And to think, I started it. Its about time I had a useful idea - lol.

    I am working on working on learning python so I can help somehow. Don't know if I will be up to speed in time for first rev's, but at least I may be able to help maintain it.

    As for the 18xxJxx problem, my first question is how would we go about programing it without the wizard? When we know the answer to that, the wizard will just do the writing for us. I do like the idea of having the wizard "fix" the .inc file for us. That really seems like the most seemless solution. But that may be another chunk of code.

    @Dave and Paul, are your programs looking at the dir to find all the available *.inc files? So updates will just automaticlly be added?

    @Dave, If I am reading your code right, did you have to hard code all the cases for the config options?
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

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


    Did you find this post helpful? Yes | No

    Default

    @Dave and Paul, are your programs looking at the dir to find all the available *.inc files? So updates will just automaticlly be added?
    Mine is. The dir is copied to the server.
    @Dave, If I am reading your code right, did you have to hard code all the cases for the config options?
    Nope.
    Code:
    file = open("%s" % subject,"r")
    text = file.readlines()
    file.close()
    
    for line in text:
        m = re.match(r"_", line)   # Looks for everything starting with "_"
        if m: print line, "<br>"
    So because of the "J" chips a second pass will be needed.
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    So because of the "J" chips a second pass will be needed.
    Maybe better to trigger off the "J" and have seperate routines? Or is the differance not that clear in the parts?
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  8. #8
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cncmachineguy View Post
    It is so much fun to see such intrest in this. And to think, I started it. Its about time I had a useful idea - lol.
    With great power comes great responsibility! Hope you hang in long enough to put it through thorough testing...

    As for the 18xxJxx problem, my first question is how would we go about programing it without the wizard? When we know the answer to that, the wizard will just do the writing for us. I do like the idea of having the wizard "fix" the .inc file for us. That really seems like the most seemless solution. But that may be another chunk of code.
    I think that has now been resolved. Thanks, scalerobotics!

    @Dave and Paul, are your programs looking at the dir to find all the available *.inc files? So updates will just automaticlly be added?
    Yes, that it exactly.

    For fun I've attached a screenshot of the application's current status...

    Best Regards,
    Paul
    Attached Images Attached Images  

  9. #9
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by prstein View Post
    With great power comes great responsibility! Hope you hang in long enough to put it through thorough testing...
    I'm here for a good while. I've been coding with just assy for about 10 years as a hobby, nothing big. Finally took the plunge to do things a bit easier and buy PBP. Enrolled in a python class starts on 9/15. Decided not to go the self taught route on this one. Too many times I start to learn a new language and quit cuz something doesn't make sense to me.

    As for the "thorough" testing, I will put it through all I can.

    Thanks for jumping on board. Looks like a nice start you have!
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  10. #10
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Not sure how the big open projects work...
    I guess to do it right a license needs to be decided on, GNU?
    Other than that jut make the code available someplace for folks to play with. If someone adds a function/fix then they let you know. You then work their code into a version if possible then release the updated version.
    If you do not want to incorporate code from others just make yours available someplace.

    If we can find others using Delphi or Python that want to help with this we could give out parts that need worked on. The "J" chip problem comes to mind.
    Very good, Dave.

    As soon as I have the code actually doing something beyond parsing the files (shouldn't be more than a few days) I'll set up two files on a server, one of just the executable and the another including all the source. I'll administer the overall "broad release" version and incorporate any improvements/fixes created by others.

    Best Regards,
    Paul

  11. #11
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Hello scalerobotics,

    Whoa. Thanks for that great info! I've mostly been using the wiki article as a reference.

    When I copy just your code,
    Code:
    asm
        CONFIG XINST = OFF
        CONFIG PLLDIV = 5
        CONFIG WDTPS = 512
        CONFIG CPUDIV = OSC1
        CONFIG FOSC = HSPLL
    endasm
    it compiles just fine. When I add the single line "PORTB.0 = 0" it gives me two warnings and an error:

    Warning[220] c:\pbp\pbppic18.lib 958 : Address exceeds maximum range for this processor.
    Error[118] c:\pbp\pbppic18.lib 958 : Overwriting previous address contents (FFF9)
    Error[118] c:\pbp\pbppic18.lib 958 : Overwriting previous address contents (FFFA)

    So, did you have to do the "replace OSC with XTAL in PBPPIC18.LIB" thing to get it to work?

    Best Regards,
    Paul

  12. #12
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by prstein View Post
    When I add the single line "PORTB.0 = 0" it gives me two warnings and an error
    Something is fishy here. I can add the line without errors. I am using MPASM 5.35, and PBP 2.60A.

    So, did you have to do the "replace OSC with XTAL in PBPPIC18.LIB" thing to get it to work?
    Yes, I did have to for the 18F26j50. Not the best solution. As it might break any include file that tried to look at the osc speed. But I still like it better than editing the .inc file by hand each time I try something different. I'll be keeping my eyes peeled to see if MeLabs can make a proper fix. Microchip has thrown the curveball, making changes that affect their 3rd party development tools.

    If yours or Dave's header program could do it and relieve some of the configuritis pain I feel each time I go to a new chip, (or one I forgot), that sure would be great.

    Thanks you guys for giving it a go.
    http://www.scalerobotics.com

  13. #13
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    Something is fishy here. I can add the line without errors. I am using MPASM 5.35, and PBP 2.60A.
    My MPASM is 5.20, the files distributed on the MELabs site. Can you tell me where to download without having to get the whole 98 MB MPLAB IDE?

    Best Regards,
    Paul

  14. #14
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by prstein View Post
    Can you tell me where to download without having to get the whole 98 MB MPLAB IDE?
    Sorry Paul, if there is one I don't know about it.
    http://www.scalerobotics.com

  15. #15
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    Sorry Paul, if there is one I don't know about it.
    Downloaded and installed the latest MPASM stuff I could find--it's v5.31. Anyway, that took care of that issue!

    Thanks for the terrific advice! Now back to coding...(after replying to some more posts...)

    Best Regards,
    Paul

  16. #16
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by prstein View Post
    My MPASM is 5.20, the files distributed on the MELabs site. Can you tell me where to download without having to get the whole 98 MB MPLAB IDE?

    Best Regards,
    Paul
    Honestly ...
    The MPASM section itself is 62 Mo on the HDD ...

    AND No separate Download from µChip site ...

    Time for your PC to grow a bit, don't you think ???

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  17. #17
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Honestly ...
    The MPASM section itself is 62 Mo on the HDD ...

    AND No separate Download from µChip site ...

    Time for your PC to grow a bit, don't you think ???

    Alain

    Thank You, Alain.

    I have bitten the bullet and downloaded. Once I started installing I was able to direct it to *not* install anything but MPASM for the 8-bit microcontrollers.

    And, since this is the first time I think we've ever communicated directly, I think your avatar is one of the most amusing that I've ever seen.

    Best Regards,
    Paul

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