Can I define the device and configuration word in the pbp source file?


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    May 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: Can I define the device AND configuration word in the pbp source file?

    Thanks, That link is where I found the original info.
    I even went to the trouble to include an excerpt in my original question
    and state why it did not seem to fix all my problems.

    That's HALF the solution to the two questions.

    Quoting that link...again...in more detail...
    @ DEVICE PIC16F628,XT_OSC

    The PIC type is optional, if it is included and you accidentally compile for a chip other than that specified (a 16F628 in this example), the compiler will report an error as a reminder you're potentially doing something wrong.

    End Quote.

    You'll notice that the PIC type does NOT appear to set the PIC type for the compiler.
    It seems to only illicit an error if the compiler command line PIC type differs.
    That's consistent with my attempts to use it. If I remove the PIC type from
    the compiler command line, it defaults to 16F84 and I get the wrong includes
    no matter what I put on the DEVICE line inside the .bas file.

    I want to ACTUALLY set the PIC type INSIDE the .bas file INSTEAD of on the command line.
    The PIC type would then NOT be included on the command line, but taken from the .bas file.
    ALL the required parameters would be encapsulated inside the .bas file.
    I'd need only one batch file to compile all my programs and I wouldn't have to guess
    which parameters to use next year when I try to edit the program.

    How do I do that?

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


    Did you find this post helpful? Yes | No

    Default Re: Can I define the device and configuration word in the pbp source file?

    I want to ACTUALLY set the PIC type INSIDE the .bas file
    I do not think there is a way to do that. You would still need to tell the batch file where to look for the code. I make a batch file for each project and keep it in the project's directory.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    May 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: Can I define the device and configuration word in the pbp source file?

    Well, seems like that's what everyone would want to do.
    Command line parameters should OVERRIDE what you put in the source file.

    Let's look at a workaround. IF I put a new DEFINE in the .bas file, it seems to get
    get passed through. If I edit the default .inc and .bas file to include a different
    processor's .inc and .bas files, and don't specify the processor on the command
    line, it seems to work.

    I should be able to edit the pbproc.bas and pbproc.inc files to include files conditioned
    by the new DEFINE. If I call all that without specifying a processor on the
    command line, I get a bunch of redefinition errors. My lack of understanding how preprocessor directives and ifdef's work seems the problem. Or maybe the
    DEFINES haven't been defined by the time I get to the .inc and .bas files.

    Ideas?

    Only other thing I think I know how to do is to parse the source file to pull out the
    processor type in my new DEFINE and use that to fill in the proc type in the
    pbpw command line.
    Shouldn't be hard, just ugly.

    I have more fun playing with the tools than the actual program.

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


    Did you find this post helpful? Yes | No

    Default Re: Can I define the device and configuration word in the pbp source file?

    You might find this interesting. It is all I use in a windows environment for the past year or so.
    http://www.picbasic.co.uk/forum/cont...75-FineLineIDE

    When on a linux box I do a batch file and write the code in gedit. I use to use emacs a lot, you might be able to do what you want with that tool.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    May 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: Can I define the device and configuration word in the pbp source file?

    Thanks,
    FinelineIDE looks like a terrific program.
    Unfortunately, it doesn't work for me.
    Can't figure out how to get it to produce the .LST file.
    Can't figure out how to use a Picstart+ programmer.
    But the killer is that it doesn't like my touchpad mouse.
    The mouse vertical scroll feature gets locked on and scrolls
    all over the place.
    Fineline default horizontal scroll cuts off the first 9 columns.
    Can fix it with the horizontal scroll bar, but it pops back to cutting
    off 9 after a vertical scroll.
    If I actually use the mouse horizontal scroll, all it likes to pop to the
    middle so nothing shows.
    I can indent a couple of times so the program is visible most of the time,
    but it still shifts horizontally against my will. To be fair, this is an
    ancient touchpad with a win2k driver running on win7...but it seems to work
    on everything else.

    Can't use it for general programming, but it might come in handy
    debugging those cases where I have nested IF statements with
    the endifs in the wrong places.

    I bit the bullet and used the DEFINE syntax to put Pictype in the .bas file.
    Wrote a program to parse it out, construct a pbpw command line
    then post-process the hex file to remove the configuration word for the
    bootloader. One click and I got hex exactly like I want it from whatever
    source file I use.

    Thanks, mike

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


    Did you find this post helpful? Yes | No

    Default Re: Can I define the device and configuration word in the pbp source file?

    To bad about FineLine. It really is a nice program.

    Just curious, what are you using to write your PBP code with and what did you use to write the parser/command line to create the hex?
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    May 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: Can I define the device and configuration word in the pbp source file?

    I use windows notepad to write picbasic code. My programs are simple, typically
    fit on two pages. I do all the heavy lifting with Hotpaw Basic on a Palm.
    The pic just interfaces hardware and sends raw data via RS232 or SIR or bluetooth/SPP
    to the Palm. It's usually interrupt driven, so I've found simulators pretty much useless.

    I used quickbasic to write the parser/control code for PBPW until I ran into a situation
    where I absolutely had to use a long filename. After a LONG search, I finally switched
    to FREEBasic and the companion fbide. It's very short on debugging help, but it
    has a lot of nice string functions. The dialect is annoyingly different from QB,
    but documentation is good. Been working out well for writing small "scripts".

    I don't recall exactly why I didn't use VisualBasic6, but think it had to do with wanting
    a single .exe file I could transport to another machine without a lot of drama.

    I'd like to expand my user interfaces from Palm to WinCE. Best free basic-like compiler
    I've found is Aristar Dialect. Works, but I'd like more control over the serial
    port hardware. Any ideas in that area?

    Thanks, mike

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