Looking at pic basic pro symbol values in mplab 8.15a simulator


Closed Thread
Results 1 to 11 of 11

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Have you tried opening the watch window, and selecting your variables?

    It works fine for me. Never tried mouseover, but I definitely can watch variables change
    when I have the watch window open. And they change as the PBP program runs. It doesn't
    need to be stopped before they update.
    Attached Images Attached Images  
    Regards,

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

  2. #2
    Join Date
    Apr 2009
    Location
    Pittsburgh, PA
    Posts
    17


    Did you find this post helpful? Yes | No

    Default

    Hey Bruce, sadly yes that's the window that I add the variables to but it always says 'value not found'. Do you have the Symbols tab in the workspace window populated with variables, functions etc? That's the other tab in the window that lists all the source code in the project.

    Thanks again.

    Quote Originally Posted by Bruce View Post
    Have you tried opening the watch window, and selecting your variables?

    It works fine for me. Never tried mouseover, but I definitely can watch variables change
    when I have the watch window open. And they change as the PBP program runs. It doesn't
    need to be stopped before they update.

  3. #3
    Join Date
    Sep 2007
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    The variables you declared in the PBP program should appear in the watch window Add Symbol dropdown, but an underscore "_" will be appended in front of the name. ("myvar" shows as "_myvar".) The exception to this are BIT-variables, which will not show by name.

    In the build options for the source file, make sure that "Use MPASM Assembler" and "Source-level Debug" are checked.

    You will need to specify the type of variable by right-clicking in the watch window after you add the variable. All variables are displayed as bytes by default.
    Charles Leo
    microEngineering Labs, Inc.
    http://melabs.com

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


    Did you find this post helpful? Yes | No

    Default

    Looks like you can go to File, then Import, then selected the file.cod file, and then you can select your variables. Very nice Bruce, I did not know that either.

    <img>http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3393</img>
    Attached Images Attached Images  
    http://www.scalerobotics.com

  5. #5
    Join Date
    Apr 2009
    Location
    Pittsburgh, PA
    Posts
    17


    Did you find this post helpful? Yes | No

    Default

    Excellent thanks Charles_Leo, scalerobotics and Bruce.

    I look forward to trying that when I get home tonight and tracking down the relevant part of the documentation that I might have missed.

    I also look forward to contributing to the forum when I get up to speed.

    Cheers.

  6. #6
    Join Date
    Apr 2009
    Location
    Pittsburgh, PA
    Posts
    17


    Did you find this post helpful? Yes | No

    Thumbs up

    I thought I posted a final reply - I got this working ok - the _ variables were in the symbol list. Sadly the bit variables are not there, which I find a bit strange.

    Thanks again for the help.

  7. #7
    Join Date
    Sep 2007
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    PBP BIT variables in MPLAB:

    Bit variables in PBP are created as aliases to individual bits within a byte variable created to hold them. MPLAB won't display the bit aliases, but it will display the byte container variable. The problem is, you don't know the name of the container variable or the placement of the specific bits without digging into the .ASM file.

    One solution is to create your own container variable and bit aliases. This won't make the bit names show in MPLAB, but it will allow you to show the container variable. You'll know which bits are which, because you defined their locations in the first place. There's no performance penalty using this method, because it's exactly what PBP would do if you declared bit variables. There are, in fact, advantages... like the ability to initialize multiple bit variables with a single command.

    <code>
    mybits VAR BYTE

    bitflag0 VAR mybits.0
    bitflag1 VAR mybits.1
    bitflag2 VAR mybits.2
    </code>

    Now the variable "_mybits" will be available in the MPLAB watch window, and you'll know how the individual bits in the variable relate to your program.
    Charles Leo
    microEngineering Labs, Inc.
    http://melabs.com

  8. #8
    Join Date
    Apr 2009
    Location
    Pittsburgh, PA
    Posts
    17


    Did you find this post helpful? Yes | No

    Thumbs up

    Excellent Charles! I fully intend to use this technique.

    Nice one.

    Quote Originally Posted by Charles_Leo View Post
    PBP BIT variables in MPLAB:

    Bit variables in PBP are created as aliases to individual bits within a byte variable created to hold them. MPLAB won't display the bit aliases, but it will display the byte container variable. The problem is, you don't know the name of the container variable or the placement of the specific bits without digging into the .ASM file.

    One solution is to create your own container variable and bit aliases. This won't make the bit names show in MPLAB, but it will allow you to show the container variable. You'll know which bits are which, because you defined their locations in the first place. There's no performance penalty using this method, because it's exactly what PBP would do if you declared bit variables. There are, in fact, advantages... like the ability to initialize multiple bit variables with a single command.

    <code>
    mybits VAR BYTE

    bitflag0 VAR mybits.0
    bitflag1 VAR mybits.1
    bitflag2 VAR mybits.2
    </code>

    Now the variable "_mybits" will be available in the MPLAB watch window, and you'll know how the individual bits in the variable relate to your program.

Similar Threads

  1. divide in pic basic pro
    By f6ggy in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 7th October 2003, 16:12
  2. pic basic pro for synthetiseur
    By f6ggy in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd October 2003, 21:01
  3. pic basic pro (novice user)
    By f6ggy in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd October 2003, 14:29
  4. help pic basic pro
    By f6ggy in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th September 2003, 00:55
  5. How to use 93C46 Type EEPROM using PIC Basic PRo
    By in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 1st April 2003, 04:07

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

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