• AVR Freaks

Hot!Which version to download?

Page: 123 > Showing page 1 of 3
Author
atferrari
Super Member
  • Total Posts : 1450
  • Reward points : 0
  • Joined: 2004/07/08 13:09:24
  • Location: Buenos Aires - Argentina
  • Status: offline
2020/06/02 09:06:13 (permalink)
0

Which version to download?

Trying to debug some code with MPLABX 5.25 and PICkit 4, found that I was unable to watch my variables. For the lack of knowledge on this, in the hope of that being solved, I uninstalled v5.25 and downloaded v5.40 with the surprise of MPASM being gone.
 
I could bite the bullet to move now to PIC Assembler if I could be sure that I would be watching the variables in RAM with the names I assigned to them.
 
My questions:
 
Has anyone verified that variables in RAM do show up in a watch window with PIC Assembler and XC8 v2.20?
 
If not, what MPLABX version should I download to still get MPASM bundled with it?
 
My intention right now is to minimize the waste of time and move on.  It is not rant time.
 
Thanks for any help.

Agustín Tomás

In theory, there is no difference between theory and practice. In practice, however, there is.

http://cablemodem.fibertel.com.ar/atferrari/
#1

40 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 18908
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Which version to download? 2020/06/02 11:12:33 (permalink)
    +2 (2)
    It is reported the V5.35 is less Buggy than V5.40 and still has MPASM
    There are a Few Threads on the Loss of MPASM and what others are doing.
    You do not need to uninstall older versions of MPLabX.  They do not bother each other.
    #2
    atferrari
    Super Member
    • Total Posts : 1450
    • Reward points : 0
    • Joined: 2004/07/08 13:09:24
    • Location: Buenos Aires - Argentina
    • Status: offline
    Re: Which version to download? 2020/06/02 11:18:30 (permalink)
    0
    NKurzman
    It is reported the V5.35 is less Buggy than V5.40 and still has MPASM
    There are a Few Threads on the Loss of MPASM and what others are doing.
    You do not need to uninstall older versions of MPLabX.  They do not bother each other.

     
    Thanks for replying.
    Do you know if I have the chance to watch my variables during debugging in v5.40?
     

    Agustín Tomás

    In theory, there is no difference between theory and practice. In practice, however, there is.

    http://cablemodem.fibertel.com.ar/atferrari/
    #3
    Mark Yampolsky
    Super Member
    • Total Posts : 122
    • Reward points : 0
    • Joined: 2009/04/03 18:50:36
    • Location: Russia Fryazino Moskow reg
    • Status: offline
    Re: Which version to download? 2020/06/02 11:28:28 (permalink)
    0
    I venture to suggest that you previously used MPLAB 8, and variables in MPASM were declared as constants (EQU / CBLOCK).
    In MPLAB X, for the visibility of variables, they must be declared correctly through the UDATA directive.
    Well, you need to return to the IDE versions including MPASM - up to 5.35 inclusive.
     
    #4
    atferrari
    Super Member
    • Total Posts : 1450
    • Reward points : 0
    • Joined: 2004/07/08 13:09:24
    • Location: Buenos Aires - Argentina
    • Status: offline
    Re: Which version to download? 2020/06/02 11:43:01 (permalink)
    0
    Mark Yampolsky
    I venture to suggest that you previously used MPLAB 8, and variables in MPASM were declared as constants (EQU / CBLOCK).
    In MPLAB X, for the visibility of variables, they must be declared correctly through the UDATA directive.

     
    Thanks Mark. Off for a coffee and will start with 5.40 in minutes.
     

    Agustín Tomás

    In theory, there is no difference between theory and practice. In practice, however, there is.

    http://cablemodem.fibertel.com.ar/atferrari/
    #5
    ric
    Super Member
    • Total Posts : 28375
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Which version to download? 2020/06/02 13:06:31 (permalink)
    0
    Mark Yampolsky
    I venture to suggest that you previously used MPLAB 8, and variables in MPASM were declared as constants (EQU / CBLOCK).
    In MPLAB X, for the visibility of variables, they must be declared correctly through the UDATA directive.
    Well, you need to return to the IDE versions including MPASM - up to 5.35 inclusive.

    Or change the assembler mode from "Relocateable" to "Absolute".
    It defaults to "Absolute" in MPLAB8, but "Relocateable" in MPLABX.
     

    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!
    #6
    atferrari
    Super Member
    • Total Posts : 1450
    • Reward points : 0
    • Joined: 2004/07/08 13:09:24
    • Location: Buenos Aires - Argentina
    • Status: offline
    Re: Which version to download? 2020/06/02 13:25:00 (permalink)
    0
    ric
    Mark Yampolsky
    I venture to suggest that you previously used MPLAB 8, and variables in MPASM were declared as constants (EQU / CBLOCK).
    In MPLAB X, for the visibility of variables, they must be declared correctly through the UDATA directive.
    Well, you need to return to the IDE versions including MPASM - up to 5.35 inclusive.

    Or change the assembler mode from "Relocateable" to "Absolute".
    It defaults to "Absolute" in MPLAB8, but "Relocateable" in MPLABX.



    Hola Ric
    PIC Assembler in XC8, according to all I've read in the last two days, allows to make a psect absolute by adding the "abs" flag; otherwise it is all relocatable. Do you agree?

    Agustín Tomás

    In theory, there is no difference between theory and practice. In practice, however, there is.

    http://cablemodem.fibertel.com.ar/atferrari/
    #7
    ric
    Super Member
    • Total Posts : 28375
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Which version to download? 2020/06/02 13:29:59 (permalink)
    +1 (1)
    No idea, I haven't tried that assembler yet.
    My comment is in relation to MPASM in the versions of MPLABX that still support it.
     

    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!
    #8
    dan1138
    Super Member
    • Total Posts : 3843
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: Which version to download? 2020/06/02 14:10:30 (permalink)
    +4 (4)
    atferrari
    Do you know if I have the chance to watch my variables during debugging in v5.40?

    The short answer is that no, your variables are not visible using the In-Circuit-Debug tool. 
     
    With MPLABX v5.40 the pic-as(v2.20) tool chain the access to symbolic debug information is broken for assembly language projects.
     
    There may be a work around but it's a hack at best and not all that convenient. It may be an option of no other fix is available.
     
    Be warned that the pic-as(v2.20) tool chain does not support the "MPASM absolute mode" CBLOCK/ENDC directive.
     
    It may be possible to create a single section at an absolute address with the pic-as(v2.20) tool chain and mimic how CBLOCK/ENDC directive works, but you would be a better programmer to learn how to actually code in a modular way for a relocatable assembler and learn how to work with how the linker fits it all together.
     
    By the way, I am very disappointed with the pic-as(v2.20) tool chain integration in the MPLABX v5.40 IDE.
     
    I just hope it's me that's being dumb and not Microchip releasing something that seems this stupid.
    #9
    atferrari
    Super Member
    • Total Posts : 1450
    • Reward points : 0
    • Joined: 2004/07/08 13:09:24
    • Location: Buenos Aires - Argentina
    • Status: offline
    Re: Which version to download? 2020/06/03 08:50:40 (permalink)
    +1 (1)
    @ric  @Mark Yampolsky @dan1138
     
    Thanks for replying. Family 18F and PICkit 4 at work. I decided to go ahead with PIC Assembler in XC8 + MPLAB X 5.40.
     
    While basic, the two details I am certainly interested to solve now, are: watching my variables while debugging and getting two or maybe three independent blocks of GPRs with their components properly arranged in sequence, whether in the access bank or in bankXX. 
     
    Thanks.

    Agustín Tomás

    In theory, there is no difference between theory and practice. In practice, however, there is.

    http://cablemodem.fibertel.com.ar/atferrari/
    #10
    dan1138
    Super Member
    • Total Posts : 3843
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: Which version to download? 2020/06/03 10:58:48 (permalink)
    +1 (1)
    atferrari
    ...  I decided to go ahead with PIC Assembler in XC8 + MPLAB X 5.40.
     
    While basic, the two details I am certainly interested to solve now, are:
     
    watching my variables while debugging and
    getting two or maybe three independent blocks of GPRs
    with their components properly arranged in sequence, whether in the access bank or in bankXX.

    I have worked out a method to get MPLABX v5.40 to start a debug session using the ELF file output from the pic-as(v2.20) tool chain. And it's kind of ugly.
     
    What I got to work is to first create a "normal" project to develop the code with.
     
    Do all the work to get a clean build ready for debug and then build it explicitly for debug, without starting a debug session.
     
    This step needs to be done only once:
    Create another project using the "File->Import->Hex/ELF...(Prebuilt) File" menu to import the ELF file from the "nornal" project. We can call it the (Prebuilt) project.
     
     
    At this point close the "normal" project as the debug session will complain the the source file are opened in two projects if you do not.
     
    Now start a debug session with the (Prebuilt) project.
     
    All the source level debug seems to work.
     
    Note:
    Make sure that you have selected the same "Hardware Tool" for program/debug in both projects.
     
    I did a port from MPASM to pic-as(v2.20) of a real project using a PIC16F887 and this debug method worked for me.
     
    The sample is in github here.
     
     
    There must be a better way, I'm just not smart enough to find it.
    post edited by dan1138 - 2020/06/04 14:10:48
    #11
    atferrari
    Super Member
    • Total Posts : 1450
    • Reward points : 0
    • Joined: 2004/07/08 13:09:24
    • Location: Buenos Aires - Argentina
    • Status: offline
    Re: Which version to download? 2020/06/04 13:50:51 (permalink)
    +1 (1)
     Why am I being rejected when I intend to post a follow up to @dan1138 's post?
     
    Is a matter of forbidden words of some kind? I am almost not using expletives lately and never call names anyone. I am supposed to be a good guy. 
     
     
     
    post edited by atferrari - 2020/06/04 14:22:42

    Agustín Tomás

    In theory, there is no difference between theory and practice. In practice, however, there is.

    http://cablemodem.fibertel.com.ar/atferrari/
    #12
    ric
    Super Member
    • Total Posts : 28375
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Which version to download? 2020/06/04 14:27:07 (permalink)
    0
    There's no intelligence behind the rejections.
    It's just a dumb firewall someone added to the web server years ago, and no-one knows how to maintain now.
     

    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!
    #13
    dan1138
    Super Member
    • Total Posts : 3843
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: Which version to download? 2020/06/04 14:30:05 (permalink)
    0 (2)
    atferrari
     Why am I being rejected when I intend to post a follow up to @dan1138 's post?
     
    Is a matter of forbidden words of some kind? I am almost not using expletives lately and never call names anyone. I am supposed to be a good guy.



    No, it is because there is a link embedded in my post.
     
    So do not quote my posts or remove the link.
    #14
    atferrari
    Super Member
    • Total Posts : 1450
    • Reward points : 0
    • Joined: 2004/07/08 13:09:24
    • Location: Buenos Aires - Argentina
    • Status: offline
    Re: Which version to download? 2020/06/04 14:30:57 (permalink)
    0
    @dan1138
    I will post in steps to see what is the cause of the rejection.
     
    Thanks for your reply. Yours obviously compiled with no hiccups.
     
    Started to port my code (18F2321). To change two CONFIG lines still with MPASM settings, rejected by XC8, tried to get 18F2321.inc. No chance.
     
    First time I installed XC8, it was somewhere but forgot to note where. It was built this year and was notoriously different from the one coming with MPASM. Any idea how could I?
     
    /EDIT
    OK. No more links then.
    EDIT/

    Agustín Tomás

    In theory, there is no difference between theory and practice. In practice, however, there is.

    http://cablemodem.fibertel.com.ar/atferrari/
    #15
    ric
    Super Member
    • Total Posts : 28375
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Which version to download? 2020/06/04 14:34:56 (permalink)
    0
    atferrari
    Started to port my code (18F2321). To change two CONFIG lines still with MPASM settings, rejected by XC8, tried to get 18F2321.inc. No chance.
     

    Use the CONFIG editor built into MPLABX.
    The easy way to set CONFIG bits in your source using MPLABX (on Microchip Wiki)

    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
    dan1138
    Super Member
    • Total Posts : 3843
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: Which version to download? 2020/06/04 14:50:40 (permalink)
    0
    ric
    atferrari
    Started to port my code (18F2321). To change two CONFIG lines still with MPASM settings, rejected by XC8, tried to get 18F2321.inc. No chance.
     

    Use the CONFIG editor built into MPLABX.
    The easy way to set CONFIG bits in your source using MPLABX (on Microchip Wiki)

    This may not be working in the pic-as(v2.20) tool chain.
    #17
    ric
    Super Member
    • Total Posts : 28375
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Which version to download? 2020/06/04 15:02:03 (permalink)
    0
    Ah good point. Left hand and right hand are often strangers in MC headquarters...
     

    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!
    #18
    dan1138
    Super Member
    • Total Posts : 3843
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: Which version to download? 2020/06/05 13:02:14 (permalink)
    0
    atferrari
    First time I installed XC8, it was somewhere but forgot to note where. It was built this year and was notoriously different from the one coming with MPASM. Any idea how could I?

    What you have said here does not seem to make sense to me.
     
    The help I can offer is an assembly language code template for the PIC 18F2321:
    ;
    ; File:     main.S
    ; Date:     2020-06-05
    ; Target:   PIC18F2321
    ; Author:   dan1138
    ; Compuler: pic-as(v2.20)
    ;
    ; Description:
    ;
    ;   This is a template for a pic-as(v2.20) assembly language application.
    ;
    ;   No effort that been made to show you how to effectivly construct
    ;   an assenbly langugage project with multiple source files, modularity
    ;   and compartmentialization of the symbolic name space.
    ;
    ;   If you do not understand these concepts your project is going to suck.
    ;
    ;                           PIC18F2321
    ;                 +------------:_:------------+
    ;       VPP ->  1 : RE3/MCLR/VPP      PGD/RB7 : 28 <>
    ;           ->  2 : RA0/AN0           PGC/RB6 : 27 <>
    ;           <>  3 : RA1/AN1           PGM/RB5 : 26 <>
    ;           <>  4 : RA2/AN2          AN11/RB4 : 25 <>
    ;           <>  5 : RA3/AN3           AN9/RB3 : 24 <>
    ;           <>  6 : RA4/C1OUT         AN8/RB2 : 23 <>
    ;           <>  7 : RA5/AN4          AN10/RB1 : 22 <>
    ;       GND <>  8 : VSS              AN12/RB0 : 21 <>
    ;           <>  9 : RA7/OSC1              VDD : 20 <- 5v0
    ;           <> 10 : RA6/OSC2              VSS : 19 <- GND
    ;           <> 11 : RC0/SOSCO       RX/DT/RC7 : 18 <>
    ;           <> 12 : RC1/SOSCI       TX/CK/RC6 : 17 <>
    ;           <> 13 : RC2/CCP1     SPI_MOSI/RC5 : 16 <>
    ;           <> 14 : RC3/SPI_CLK  SPI_MISO/RC4 : 15 <>
    ;                 +---------------------------:
    ;                            DIP-28
    ;
     CONFIG OSC = INTIO2     ; Oscillator (Internal oscillator block, port function on RA6 and RA7)
     CONFIG FCMEN = OFF      ; Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor disabled)
     CONFIG IESO = OFF       ; Internal/External Oscillator Switchover bit (Oscillator Switchover mode disabled)
     CONFIG PWRT = OFF       ; Power-up Timer Enable bit (PWRT disabled)
     CONFIG BOR = OFF        ; Brown-out Reset Enable bits (Brown-out Reset disabled in hardware and software)
     CONFIG BORV = 3         ; Brown-out Reset Voltage bits (Minimum Setting)
     CONFIG WDT = OFF        ; Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit))
     CONFIG WDTPS = 32768    ; Watchdog Timer Postscale Select bits (1:32768)
     CONFIG CCP2MX = RC1     ; CCP2 MUX bit (CCP2 input/output is multiplexed with RC1)
     CONFIG PBADEN = ANA     ; PORTB A/D Enable bit (PORTB<4:0> pins are configured as analog input channels on Reset)
     CONFIG LPT1OSC = OFF    ; Low-Power Timer1 Oscillator Enable bit (Timer1 configured for higher power operation)
     CONFIG MCLRE = ON       ; MCLR Pin Enable bit (MCLR pin enabled; RE3 input pin disabled)
     CONFIG STVREN = ON      ; Stack Full/Underflow Reset Enable bit (Stack full/underflow will cause Reset)
     CONFIG LVP = OFF        ; Single-Supply ICSP Enable bit (Single-Supply ICSP disabled)
     CONFIG BBSIZ = BB256    ; Boot Block Size Select bits ( 256 Word)
     CONFIG XINST = OFF      ; Extended Instruction Set Enable bit (Instruction set extension and Indexed Addressing mode disabled (Legacy mode))
     CONFIG CP0 = OFF        ; Code Protection bit (Block 0 not code-protected)
     CONFIG CP1 = OFF        ; Code Protection bit (Block 1 not code-protected)
     CONFIG CPB = OFF        ; Boot Block Code Protection bitProtect Boot (Boot block not code-protected)
     CONFIG CPD = OFF        ; Data EEPROM Code Protection bit (Data EEPROM not code-protected)
     CONFIG WRT0 = OFF       ; Write Protection bit (Block 0 not write-protected)
     CONFIG WRT1 = OFF       ; Write Protection bit (Block 1 not write-protected)
     CONFIG WRTC = OFF       ; Configuration Register Write Protection bit (Configuration registers (300000-3000FFh) not write-protected)
     CONFIG WRTB = OFF       ; Boot Block Write Protection bit (Boot block not write-protected)
     CONFIG WRTD = OFF       ; Data EEPROM Write Protection bit (Data EEPROM not write-protected)
     CONFIG EBTR0 = OFF      ; Table Read Protection bit (Block 0 not protected from table reads executed in other blocks)
     CONFIG EBTR1 = OFF      ; Table Read Protection bit (Block 1 not protected from table reads executed in other blocks)
     CONFIG EBTRB = OFF      ; Boot Block Table Read Protection bit (Boot block not protected from table reads executed in other blocks)
    ;
    #include <xc.inc>
    ;
    ; Interrupt context save in area common to all banks
    ;
        psect   IsrLowData_shr,global,class=COMRAM,space=1,delta=1,noexec

    WREG_SAVE:   ds     1
    STATUS_SAVE: ds     1
    BSR_SAVE:    ds     1
    ;
    ; Power on reset vector
    ;
        psect   AbsSection,abs,global,reloc=2,class=CODE,delta=1
        org     0x0000
        global  POReset
    POReset:
        GOTO    Init                ; go to beginning of program
    ;
    ; Interrupt Service Routines
    ;
    ;
    ; The intention of the high priority interrupt
    ; hander is to use a far branch to the code that
    ; hanleds the interrupt.
    ;
        org     0x0008              ; High priority vector
        GOTO    IsrHigh             ; "far" absolute branch
    ;
    ; The intention of the low priority interrupt hander
    ; is for the code that hanleds the interrupt to be
    ; located in "low" memory just after the fixed address
    ; of the low interrupt vector.
    ;
        org     0x0018              ; Low priority vector
        global  Isrlow
    Isrlow:
        movff   WREG,WREG_SAVE      ; save context of
        movff   STATUS,STATUS_SAVE  ; interrupted code
        movff   BSR,BSR_SAVE        ;
    ;

    ;
    IsrLowExit:
        movff   BSR_SAVE,BSR        ; restore context of
        movff   WREG_SAVE,WREG      ; interrupted code
        movff   STATUS_SAVE,STATUS  ;
        retfie  0

    ;
    ; Handler for high priority interrupts
    ;
        psect   IsrHighCode,global,class=CODE,reloc=2,delta=1
        global  IsrHigh
    IsrHigh:
        retfie  1                   ; Fast return
    ;
    ; Initialize the PIC hardware
    ;
        psect   InitCode,global,class=CODE,reloc=2,delta=1
    Init:
        clrf    INTCON,C            ; Disable all interrupt sources
        clrf    PIE1,C
        clrf    PIE2,C
        goto    main                ; "far" absolute branch
    ;
    ; Main data
    ;
        psect   MainData,global,class=RAM,space=1,delta=1,noexec
    Count: ds   1
    ;
    ; Main application code
    ;
        psect   MainCode,global,class=CODE,reloc=2,delta=1
    ;
    ; Main application initialization
    ;
    main:
        banksel Count
    ;
    ; Application loop
    ;
    AppLoop:
    ;
        incf    Count,F,B           ; Update a "banked" register location

        bra     AppLoop             ; "short" relative branch

    ;
    ; Tell linker where to start
    ;
        END     POReset

    post edited by dan1138 - 2020/06/05 13:08:00
    #19
    atferrari
    Super Member
    • Total Posts : 1450
    • Reward points : 0
    • Joined: 2004/07/08 13:09:24
    • Location: Buenos Aires - Argentina
    • Status: offline
    Re: Which version to download? 2020/06/05 14:05:19 (permalink)
    +1 (1)
    dan1138
    atferrari
    First time I installed XC8, it was somewhere but forgot to note where. It was built this year and was notoriously different from the one coming with MPASM. Any idea how could I?

    What you have said here does not seem to make sense to me.

     
    Sorry Dan, for being sloppy when posting here. Until five days ago I was a happy user of MPASM and MPLABx 5.25 ignoring everything about PIC Assembler or XC8. Psect you say? What is that? For me, the linker was just the Olin's preferred tool.
     
    After erasing 5.25 (!!) I installed 5.40 and 2.20 many times because my confusion on the subject.
     
    Since in the past I used always the respective .inc file for every micro as a guide in the configuration, in one of those install/uninstall, I looked and found (do not ask me where) the PIC Assembler's 18F2321 equivalent to  the MPASM's .inc file. That file (not even sure if the extension was actually .inc) was in a big archive with obviously the same type of files for a bunch of 18F micros). 
     
    Now that I wanted to retrieve it, the Win 10 search function got nothing, no matter what.
     
    Thanks for your template and the time you spent in preparing it. Awesome help.

    Agustín Tomás

    In theory, there is no difference between theory and practice. In practice, however, there is.

    http://cablemodem.fibertel.com.ar/atferrari/
    #20
    Page: 123 > Showing page 1 of 3
    Jump to:
    © 2020 APG vNext Commercial Version 4.5