Variables not appearing in Watch Window MPLabv7.3


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile a possible work around?

    John,

    Try this in MPLab (if you have not already done so)

    1)Open “Watch” from “View” Menu
    2)Open “File Registers” from “View” Menu
    3)With the mouse, physically click on your variable name in the File Register Window ( in the name column) and drag it to the Watch window.

    Something to try,


    Paul Borgmeier
    Salt Lake City, Utah
    USA

  2. #2
    jd76duke's Avatar
    jd76duke Guest


    Did you find this post helpful? Yes | No

    Default Halfway there

    Hi Paul,

    Thanks for the recommendation. It has helped. I saw some of my BYTE sized variables in the file register list and I can add them to my Watch Window. It seems my real problem is that I can't see Bit sized variables. Most of my variables are single bits as I have alot of momentary switches on my IO pins.

    I'm beginning to suspect that maybe the MPLAB doesnt recognize BIT variables.

    Thanks,

    John

  3. #3
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by jd76duke
    I'm beginning to suspect that maybe the MPLAB doesnt recognize BIT variables.
    MPLAB does not recognize bit variables - it only recognizes byte sized variables. Luckily, as stated in the PBP manual, "Bits are packed into bytes as possible". In the "file Register" window of MPLAB you should be able to find all your PBP declared variables. Because MPLAB only knows bytes and you defined your variables as bits, your assigned names for bits are lost.

    PBP will replace your named bits with a single name like "PB01" and "PB02", which will contain your assigned bits (8 per variable). In the watch window, you can see PB01 change as your bits change. You can even drag PB01, etc., to the watch window if you want. The only real difficulty is that the order that you assigned your bits are not mapped directly into the byte name in the same order. For example your first bit declared might be bit0 of PB01 and the second might be bit5. I beleive it is done alpabetically but am not sure - a little elbow grease debugging and you can map these out. Anyway, check it out and see. MPLAB SIM is great!

    Paul Borgmeier
    Salt Lake City, Utah
    USA

  4. #4
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Another option – take control yourself

    Switch0_7 VAR BYTE ' define a bank of 8 switches
    sw0 VAR Switch0_7.0 ' alias to bit0
    sw1 VAR Switch0_7.1 ' alias to bit1
    etc.

    Use sw0, sw1, etc., as if you had assigned them as bit variables.

    Now in MPLAB you will see Switch0_7 and know what bit is what.

    Paul Borgmeier
    Salt Lake City, Utah
    USA

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