1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Assembly on the MPLAB-X IDE, how???

Discussion in 'Microcontrollers' started by Rich D., Oct 17, 2017.

  1. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,251
    Likes:
    911
    Location:
    Rochdale UK
    Sorry Burt...I missed that!!
     
  2. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,084
    Likes:
    326
    Location:
    Brisbane Australia
    If you install an older version of MPLAB then it will install ASM30 in the same dir as MPLAB.X and you can add it as per Ian's instructions earlier.

    Mike.
     
  3. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,829
    Likes:
    138
    Location:
    morristown,tn
    Here a copy it said you could copy it
    Well i would post it it said I can't
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    5,985
    Likes:
    511
    Location:
    Cleveland, OH, USA
    ONLINE

    My ASM30 folder is 14.4 MBytes when zipped. Better to download from Microchip.
     
  6. Rich D.

    Rich D. Member

    Joined:
    Feb 3, 2014
    Messages:
    243
    Likes:
    20
    Location:
    West Chester, PA
    I loaded the v8 IDE. Looks and feels like the old IDE I use, but it won't work for me because it doesn't seem to have the PIC24FJ chips I need to work with, the -GA204, -GA406, and the GA702.
    So that is a dead-end road for these newer chips. Looks like I must get the MPLAB-X to work.
     
  7. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,251
    Likes:
    911
    Location:
    Rochdale UK
    If that be the case then ASM30 may not be any use either!! You will have to read up on XC16 asm...

    You will also need to add the toolchain as its not there by default.. If I get chance I'll do a few screen shots of how to get up and running!!
     
  8. Les Jones

    Les Jones Well-Known Member

    Joined:
    May 15, 2015
    Messages:
    1,452
    Likes:
    189
    Location:
    Lancashire UK
    I have Mplabx installed but I just use MPASMX to assemble source files (.asm extension). On my computer the path to it is C:\Program Files (x86)\Microchip\MPLABX\mpasmx.exe. I do find that it does not work if the source file is more than 2 or 3 levels down in the directory structure. I just use a text editor (Programmers foile editior) to create and edit the source fil.

    Les.
     
  9. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,829
    Likes:
    138
    Location:
    morristown,tn
    I posted the user guide looks doable
    you can set it up here
    Screenshot from 2017-10-24 20-41-15.png
     
    Last edited: Oct 24, 2017
  10. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,084
    Likes:
    326
    Location:
    Brisbane Australia
    I've got mplab v8.92 and have just selected the 24FJ128GA204 and asm32 without any problem. Screen shot attached.

    Mike.
    screen.png
     
  11. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    5,985
    Likes:
    511
    Location:
    Cleveland, OH, USA
    ONLINE
    Version might just be the problem. It is not in MPASMX that came with MPLABX 4.01 installed recently, which only goes to the 18F series.

    Nor is it in my version of ASM30 that was installed in February 2015 with files therein dated 12/15/2011 .
    upload_2017-10-25_5-23-55.png

    So, I downloaded ASM30 v.3.31 but it is a .tar.gz and I cannot get it to unpack. Aside from that glitch the rest of setting up a project in MPLAB 8.92 for the 24FJ128GA204 went without a glitch.

    John
     
  12. Rich D.

    Rich D. Member

    Joined:
    Feb 3, 2014
    Messages:
    243
    Likes:
    20
    Location:
    West Chester, PA
    I installed MPLAB 8.92 OK, got a project going for the '204 chip. I found the .inc and .gld files as well as a .h file for the '204.

    Thinking I'm now good, I start a Make/build and get this wonderful message:
    " Unknown processor 24FJ128GA204."
    And just to rub it in a bit, they added in bold red letters: "BUILD FAILED"

    I should have listened to my mom and become a rock-n-roll star instead.

    Yes, the .s file has the lines:
    .equ __p24FJ128GA204.inc, 1 ;put your processor here
    .include "p24FJ128GA204.inc" ;put yor include file here

    The Microchip-supplied .inc file has this:
    ; PIC24FJ128GA204 Standard Assembly Include File
    ;
    ; (c) Copyright 2017 Microchip Technology, All rights reserved
    ; Part support version 1.32.B(15-Aug-2017)

    And the linker script .gld file (also supplied by Microchip) has this:
    /*
    * Linker script for PIC24FJ128GA204
    * (c) Copyright 2013 Microchip Technology, Inc
    * Part support version 1.32.B(15-Aug-2017)

    Yes, I set the project to use this very same '204 chip.
     
    Last edited: Oct 25, 2017
  13. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,829
    Likes:
    138
    Location:
    morristown,tn
    Maybe sound dumb but you maybe over doing something like including the same files more then once.
     
  14. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,084
    Likes:
    326
    Location:
    Brisbane Australia
    Looks like Asm30 doesn't support the newer chips so you'll have to use XC16. In post #18 I managed to single step through assembly (.s file) without any problem.

    Mike.
     
  15. Rich D.

    Rich D. Member

    Joined:
    Feb 3, 2014
    Messages:
    243
    Likes:
    20
    Location:
    West Chester, PA
    It baffles me why Microchump would provide the .inc, .gld, and .hdr files -AND- provide a selection for a processor that they don't support. Their indicators show they have some level of support with the yellow dots:
    ProcessorAssignment.jpg

    Pommie, I tried #18 but somehow it still doesn't compile for me. Instead I get this wonderful set of messages:

    "
    "C:\Program Files (x86)\Microchip\xc16\v1.32\bin\xc16-gcc.exe" newmainXC16.c -o build/default/production/newmainXC16.o -c -mcpu=24FJ128GA204 -MMD -MF "build/default/production/newmainXC16.o.d" -mno-eds-warn -g -omf=elf -DXPRJ_default=default -legacy-libc -O0 -msmart-io=1 -Wall -msfr-warn=off
    nbproject/Makefile-default.mk:106: recipe for target 'build/default/production/newmainXC16.o' failed
    make[2]: Leaving directory 'C:/Users/rdeangelis/MPLABXProjects/PIC24FJ128GA204curiosity.X'
    nbproject/Makefile-default.mk:90: recipe for target '.build-conf' failed
    make[1]: Leaving directory 'C:/Users/rdeangelis/MPLABXProjects/PIC24FJ128GA204curiosity.X'
    nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
    newmainXC16.c:58:6: warning: return type of 'main' is not 'int'

    newmainXC16.c: In function 'main':
    newmainXC16.c:59:5: warning: 'return' with a value, in function returning void
    newmainXC16.c: At top level:
    newmainXC16.c:64:6: warning: return type of 'main' is not 'int'
    newmainXC16.c:64:6: error: redefinition of 'main'
    newmainXC16.c:58:6: note: previous definition of 'main' was here

    make[2]: *** [build/default/production/newmainXC16.o] Error 255
    make[1]: *** [.build-conf] Error 2
    make: *** [.build-impl] Error 2

    BUILD FAILED (exit value 2, total time: 1s)

    "...the colors and underlines are theirs, not mine.

    The only part of that I understand, "warning: return type of 'main' is not 'int'", makes little sense to me because when I start a new project the "int main()" is generated automatically by Microchump.
    The rest of it...well...???
     
  16. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,294
    Likes:
    647
    Location:
    Derbyshire, UK
    ONLINE
    Why are you still using the C compiler?, and not the assembler?.

    C:\Program Files (x86)\Microchip\xc16\v1.32\bin\xc16-gcc.exe (c compiler)

    newmainXC16.c (c source file)
     
  17. Rich D.

    Rich D. Member

    Joined:
    Feb 3, 2014
    Messages:
    243
    Likes:
    20
    Location:
    West Chester, PA
    Honestly at this point I made so many projects and tried so many files and things I have no idea what I am doing anymore.
    I have been trying to get MPLAB 8.xx to work.

    I am going to have to punt...I have sent requests to some software guys/companies to help jump-start this project for me.
    My only response so far puts the estimate at about $4000.
    If that's what I need to spend (of the company's money) I will.
     
  18. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,251
    Likes:
    911
    Location:
    Rochdale UK
    You are compiling... You should be assembling... Burt has shown how to use the assembler.

    Here is what I did..

    new project....
    select pic24fj128ga204
    select XC16 toolsuite
    ADD NO FILES..
    Select source code in project window and create a file "AnAsmFile.s"
    Write your asm stuff...

    Build

    Here is a screen shot!!
    upload_2017-10-26_18-11-29.png

    Done... It took 2 mins....
     
    • Thanks Thanks x 1
  19. Rich D.

    Rich D. Member

    Joined:
    Feb 3, 2014
    Messages:
    243
    Likes:
    20
    Location:
    West Chester, PA
    Wow! This all looked familiar, maybe I haven't done it in these steps. So I tried it step-by-step. Very carefully.
    Clicked Build.

    My Screenshot:
    MyScreenShot.jpg

    WTF?!
    So I took a closer look at the actual errors: something familiar!!!
    I didn't have the # signs in the operands. Quick fix.

    IT WORKED! THANKS IAN ROGERS!! You are a most helpful member!

    Now I'll see if it is really doing what I expect and want...If I could just figure out where they hid the simulator!!!
     
  20. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,829
    Likes:
    138
    Location:
    morristown,tn
    Hit debug then at the top where the tab that said window click it and midway down is a lot of good stuff
    You may need to add some tools using the tool tab plugin tab.
     
  21. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,251
    Likes:
    911
    Location:
    Rochdale UK
    Right click the project and hit properties..

    upload_2017-10-26_21-12-40.png
    That should give you the sim
     

Share This Page