Continue to Site

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.

  • 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.

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

Status
Not open for further replies.
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.
 
Here a copy it said you could copy it
Well i would post it it said I can't
 
My ASM30 folder is 14.4 MBytes when zipped. Better to download from Microchip.
 
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.
 
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!!
 
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.
 
I posted the user guide looks doable
The MPLAB XC16 Assembler translates user assembly source files into relocatable
object files. These object files can then be put into an archive (MPLAB XC16 Object
Archiver/Librarian) or linked with other relocatable object files and archives to create an
executable file (MPLAB XC16 Object Linker). See the “MPLAB XC16 C Compiler
User’s Guide” (DS50002071) for an overview of the tools process flow.
Typically the command-line driver, xc16-gcc, is used to invoke the assembler as it can
be passed assembler source files as input; however, the options for the assembler are
supplied here for instances where the assembler is being called directly, or when
options need to be set in the assembler tab of the Build Options dialog (MPLAB IDE
v8) or assembler category of the Project Properties window (MPLAB X IDE).
The assembler command line may contain options and file names. For details on
command line option syntax, see Section 2.2 “Command-Line Syntax”.
Note that the assembler will not produce any messages unless there are errors or
warnings – there are no “assembly completed” messages.
you can set it up here
Screenshot from 2017-10-24 20-41-15.png
 
Last edited:
I've got mplab v8.92 and have just selected the 24FJ128GA204 and asm32 without any problem. Screen shot attached.

Mike.
screen.png
 
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
 
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:
Maybe sound dumb but you maybe over doing something like including the same files more then once.
 
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.
 
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...???
 
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)
 
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.
 
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....
 
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!!!
 
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.
 
Status
Not open for further replies.

Latest threads

Back
Top