setting a watch on a variable

Author
ruffrecords
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2009/10/23 14:08:24
  • Location: UK
  • Status: offline
2016/02/01 02:45:04 (permalink)
0

setting a watch on a variable

I am using a PIc16F1827 writing code in assembler.
I can add a watch to any of the defined SFRs no problem but I cannot seem to set one to one of my variables. I define a bunch of them using a CBLOCK directive and list their names.
What am I doing wrong?
Cheers
Ian
#1

19 Replies Related Threads

    ric
    Super Member
    • Total Posts : 22101
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: setting a watch on a variable 2016/02/01 02:48:08 (permalink)
    +1 (1)
    You have to tell MPLABX you are working in absolute mode, otherwise it assumes linking mode (which doesn't recognise CBLOCK as variable definitions).
    There's a checkbox for absolute mode somewhere in the project settings.

    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
    ruffrecords
    New Member
    • Total Posts : 8
    • Reward points : 0
    • Joined: 2009/10/23 14:08:24
    • Location: UK
    • Status: offline
    Re: setting a watch on a variable 2016/02/01 06:40:10 (permalink)
    0
    Thanks Ric, I will give that a try.  How would I define variables then in linking mode?
     
    Cheers
     
    Ian
    #3
    1and0
    Access is Denied
    • Total Posts : 8740
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: setting a watch on a variable 2016/02/01 06:57:39 (permalink)
    +1 (1)
    ruffrecords
    How would I define variables then in linking mode?

    With the various UDATA and RES directives.
    #4
    1and0
    Access is Denied
    • Total Posts : 8740
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: setting a watch on a variable 2016/02/01 07:00:02 (permalink)
    +2 (2)
    ric
    ... otherwise it assumes linking mode (which doesn't recognise CBLOCK as variable definitions).

    Would be nice if MPASM generates an assembly error when CBLOCK or ORG directive is used in relocatable mode, just like UDATA and CODE directives would generate the "directive only allowed when generating an object file" error when used in absolute mode.
    #5
    ruffrecords
    New Member
    • Total Posts : 8
    • Reward points : 0
    • Joined: 2009/10/23 14:08:24
    • Location: UK
    • Status: offline
    Re: setting a watch on a variable 2016/02/01 08:04:58 (permalink)
    0
    I tried setting 'build in absolute mode' in the mpasm settings of the project. However, when I do a clean build I get an error:
     
    mv: cannot stat ‘/home/ian/MPLABXProjects/testasmproject.X/newpic_8b_general.O’: No such file or directory
     
    Cheers
     
    Ian
    #6
    vloki
    Jo, alla!
    • Total Posts : 6796
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: setting a watch on a variable 2016/02/01 08:31:15 (permalink)
    +1 (1)
    Try the attached one.
    It contains the (modified) object template 16F1827TMPO.asm
    found in installation folder .../MPLABX/v3.20/mpasmx/templates/Object
     
    Also view Code_vs_Object_Readme.txt in the mpasmx/templates/ folder
     
    <edit>just try out if get access denied...
    post edited by vloki - 2016/02/03 00:37:16

    Attachment(s)

    Attachments are not available: Download requirements not met

    Uffbasse !
    #7
    ruffrecords
    New Member
    • Total Posts : 8
    • Reward points : 0
    • Joined: 2009/10/23 14:08:24
    • Location: UK
    • Status: offline
    Re: setting a watch on a variable 2016/02/02 04:16:35 (permalink)
    0
    OK, I have a partial fix for this but a new problem. Using udata I can declare variables. However, my globals were based from 0x70 upwards as this memory is unbanked. However if I:
     
    myglobals udata 0x70
    etc
     
    I get an error: "section 'myglobals' can not fit the absolute section. Section 'myglobals' start=0x00000070, length=0x0000000d"
     
    Cheers
     
    Ian
    #8
    1and0
    Access is Denied
    • Total Posts : 8740
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: setting a watch on a variable 2016/02/02 05:23:21 (permalink)
    +1 (1)
    Try
    myglobals udata_shr

    #9
    vloki
    Jo, alla!
    • Total Posts : 6796
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: setting a watch on a variable 2016/02/02 23:58:57 (permalink)
    0
    Hmm strange, either there is a typo in the template
    or they want to fill the memory top-down...
    ; Example of using Shared Uninitialized Data Section
    INT_VAR UDATA_SHR 0x7D
     
    SAMPLE1        RES       1     ; Sample user registers
    SAMPLE2        RES       1     ;
    SAMPLE3        RES       1     ;

     
    <edit>just try out if get access denied...
    post edited by vloki - 2016/02/03 00:32:27

    Uffbasse !
    #10
    1and0
    Access is Denied
    • Total Posts : 8740
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: setting a watch on a variable 2016/02/03 00:15:23 (permalink)
    +2 (2)
    vloki
    Hmm strange, either there is a typo in the template
    or they want to fill the memory top-down...
    ; Example of using Shared Uninitialized Data Section
    INT_VAR UDATA_SHR 0x7D
    SAMPLE1        RES       1     ; Sample user registers
    SAMPLE2        RES       1     ;
    SAMPLE3        RES       1     ;


    LOL... that looks like absolute code in relocatable mode. mr green: mr green
     
    #11
    1and0
    Access is Denied
    • Total Posts : 8740
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: setting a watch on a variable 2016/02/03 00:17:34 (permalink)
    0
    ... and this
    ; Example of using GPR Uninitialized Data
    GPR_VAR UDATA 0x20
    MYVAR1 RES 1 ; User variables placed by linker
    MYVAR2 RES 1 ;
    MYVAR3 RES 1 ;

     
    P.S.  Cannot edit previous post without Access Denied message.
    #12
    vloki
    Jo, alla!
    • Total Posts : 6796
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: setting a watch on a variable 2016/02/03 00:31:34 (permalink)
    0
    1and0
    LOL... that looks like absolute code in relocatable mode. mr green: mr green

    Yes, probably a carelessness when creating the first 16F9xx object template
    by modifying the absolute one and then copy and paste it to all the 16F9xx, 16F1xxx

    Uffbasse !
    #13
    vloki
    Jo, alla!
    • Total Posts : 6796
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: setting a watch on a variable 2016/02/03 00:39:08 (permalink)
    +1 (1)
    1and0
    P.S.  Cannot edit previous post without Access Denied message.

    Seems that I can edit all my messages but not the latest?


     
     
    <edit> sadfsadf
    post edited by vloki - 2016/02/03 06:26:49

    Uffbasse !
    #14
    ruffrecords
    New Member
    • Total Posts : 8
    • Reward points : 0
    • Joined: 2009/10/23 14:08:24
    • Location: UK
    • Status: offline
    Re: setting a watch on a variable 2016/02/03 00:47:13 (permalink)
    0
    Many thanks 1and0, that works fine and also makes sense.
     
    Cheers
     
    ian
    #15
    ric
    Super Member
    • Total Posts : 22101
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: setting a watch on a variable 2016/02/03 05:01:56 (permalink)
    +2 (2)
    1and0
    ...
    P.S.  Cannot edit previous post without Access Denied message.

    It's the Mr Green emoticon in that post, triggering some obscure firewall protection.
    Delete the emoticon (and re-insert it if you want) and the edit will probably work.

    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!
    #16
    DarioG
    Allmächtig.
    • Total Posts : 54081
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: Oesterreich
    • Status: offline
    Re: setting a watch on a variable 2016/02/03 05:21:58 (permalink)
    0
    yeah,
    but strangely Vloki could reply and quote an emoticon.
     
    for the records, earlier this morning no reply was working in FF. Now it's back

    GENOVA :D :D ! GODO
    #17
    vloki
    Jo, alla!
    • Total Posts : 6796
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: setting a watch on a variable 2016/02/03 06:20:29 (permalink)
    0
    DarioG
    yeah,
    but strangely Vloki could reply and quote an emoticon.
    But not edit ;-)




    Uffbasse !
    #18
    DarioG
    Allmächtig.
    • Total Posts : 54081
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: Oesterreich
    • Status: offline
    Re: setting a watch on a variable 2016/02/03 06:46:35 (permalink)
    0
    Yes I know. To me, usually, even quoting could not be done.

    GENOVA :D :D ! GODO
    #19
    1and0
    Access is Denied
    • Total Posts : 8740
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: setting a watch on a variable 2016/02/03 06:49:01 (permalink)
    +1 (1)
    For the longer time I cannot quote any post with emoticon. Now I can't even edit my own post with emoticon. What a joke!
     
    @Microchip: If it ain't broke, don't fix it. If you attempt to fix it, make sure it still fixed. Must be Head's high school son maintaining this forum. ;)
    #20
    Jump to:
    © 2019 APG vNext Commercial Version 4.5