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
    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

  2. #2
    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