• AVR Freaks

Hot!Unable to add watch variables

Author
dwayner
New Member
  • Total Posts : 9
  • Reward points : 0
  • Joined: 2007/10/27 15:42:31
  • Location: Edmonton Alberta Canada
  • Status: offline
2015/12/14 15:07:11 (permalink)
0

Unable to add watch variables

Good day to all.
 
I'm a long-time MPLAB user who is now doing his first project with MPLAB-X.  My current problem is that I am not able to add any of my RAM variables to the MPLAB-X watch window.
 
I'm currently using MPLAB-X version 3.15 with a Real-ICE and Emulation Header for the 16F1782.  My code is written in absolute mode and I currently assign RAM variables using the cblock & endc directives.
 
The symptom is that although I can watches for special function registers, I am NOT able to add any of my declared RAM variables.
 
A quick Google search brings up others with similar problems but the solution is not given in those conversations - the threads just stop.
 
Can someone tell me what I have to change in my source code to allow MPLAB-X to display my user variables in a watch window?
 
Many thanks!
 
dwayne
#1

6 Replies Related Threads

    ric
    Super Member
    • Total Posts : 23859
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Unable to add watch variables 2015/12/14 15:12:19 (permalink)
    +1 (1)
    dwayner
    ...
    Can someone tell me what I have to change in my source code to allow MPLAB-X to display my user variables in a watch window?
    ...

    I suspect the only change that will work is to move from absolute mode to linking mode.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    dwayner
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2007/10/27 15:42:31
    • Location: Edmonton Alberta Canada
    • Status: offline
    Re: Unable to add watch variables 2015/12/14 15:46:24 (permalink)
    0
    Can you point me towards a tutorial or instructions on how to modify my source code from absolute mode to relocatable?  I'm truly not looking forward to having to mess with linker files - they seem to be a continuing source of problems for relocatable-code newbies like myself.
     
    Many thanks!
     
    dwayne
    #3
    DarioG
    Allmächtig.
    • Total Posts : 54081
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: Oesterreich
    • Status: offline
    Re: Unable to add watch variables 2015/12/14 15:50:25 (permalink)
    0
    You should not even need a linker file - the MPLAB will pick a standard one for you Smile

    GENOVA :D :D ! GODO
    #4
    GeorgePauley
    Moderator
    • Total Posts : 1160
    • Reward points : 0
    • Joined: 2009/12/01 13:59:30
    • Location: Chandler AZ
    • Status: offline
    Re: Unable to add watch variables 2015/12/15 08:55:05 (permalink)
    +1 (1)
    MPLAB X automatically handles so much of the relocatable stuff when creating new projects that the "art" of converting from absolute to relocatable is becoming lost.  I would suggest reading chapter 6 of the MPASM manual which gives examples of both relocatable and absolute.  http://ww1.microchip.com/downloads/en/DeviceDoc/33014L.pdf

    I can never remember all the rules for what's visible and what's not in assembly files.  But I usually just "punt" and make variables I really want to see global.  <chuckle>  But if you are in absolute mode, that means you know the address of your variables.  I think you can add to the watch window based on address?
    #5
    dwayner
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2007/10/27 15:42:31
    • Location: Edmonton Alberta Canada
    • Status: offline
    Re: Unable to add watch variables 2015/12/15 16:11:43 (permalink)
    +4 (4)
    I found my problem with the help of Microchip Support: it turns out that I had NOT checked the "Absolute Mode" check box in the MPASM portion of the project settings menu.
     
    Upon ticking that box and rebuilding my project, I could now add my RAM variables to a watch window in MPLAB-X.
     
    I appreciate the help and I'm documenting my findings so that the next person who runs into this problem might have an easier time than I did.
     
    Many thanks!
     
    dwayne
    #6
    lewjoubert
    New Member
    • Total Posts : 22
    • Reward points : 0
    • Joined: 2004/07/22 14:28:09
    • Location: Gold Coast Australia
    • Status: offline
    Re: Unable to add watch variables 2019/06/19 23:05:28 (permalink)
    0
    When building in ASM.
    Project properties -> MPASM ->check "Absolute Mode"
    Declare variable eg:
        cnt3        EQU 0x23
        CNT4       EQU 0x24
    How to load a variable, highlight the variable in your source code, right click in watch window or on the highlighted variable in the source code -> Add New Watch and it appears highlighted in the watch window - click OK.
    This worked for me, both absolute and relocatable.
    MPLABX v5.20

    A monkey in silk is a monkey no less - Rodriguez.
    #7
    Jump to:
    © 2019 APG vNext Commercial Version 4.5