I have code written in C but I need to see the Assembly file so I can optimize the code and figure out how long certain functions will take. Does anyone know of a quick way to pull up the Assembly code?
Sid MuthalSid Muthal
4 Answers
Browser when clicking the blue help button in MPLAB X IDE dashboard, as indicated in the screenshot. If you are building for 8-bit PIC targets and you are using the new driver, the MPLAB® XC8 C Compiler User's Guide for PIC® MCU contains information on the new-format compiler options and C99 features that are applicable to this architecture.
You basically just have to not compile it all the way through, there are flags available so that you can see your code in various states, including assembly.
Take a .c file and compile it with gcc -S test.c
EDIT: I didn't think MPLAB was important to your question until I googled it, but I guess it's safe to assume that you're running this code in the non-OS form?
EDIT: A few MPLAB answers http://www.microchip.com/forums/m537589.aspx
JoeManiaciJoeManiaci
I also had the same problem as you. Here is what worked for me.
Debug the main program, when finished, choose
Then you would see the corresponding assembly code.
Hope it could help you out.
kirti2,79744 gold badges2121 silver badges4646 bronze badges
RockyRocky
For anyone looking for this in the future, I stumbled on the same problem and a better solution.
In MPLAB X, right click the toolbar and select customize (also under View/Toolbars). Now in the menu of things you can drag to the toolbar find the 'Window' tree and under that 'Disassembly Listing File'. Drag that to somewhere on a toolbar (choose one you have set to always be there).
Now when you build something in debug mode you can click the button to open a (nicely formatted) assembly window. If you keep it open it will auto-refresh after each build.
SpaceDogSpaceDog3,09411 gold badge1212 silver badges2424 bronze badges
Look in the folder dist/default/production/ and you may find a '.lst'-file there, which contains an annotated assembly representation of your program.
At least that works on my machine, MPLAB v3.45 and XC8 compiler v1.38.
avl_swedenavl_sweden
Not the answer you're looking for? Browse other questions tagged cassemblymplab or ask your own question.
I'm trying to programm my PIC 16F628A with PICKIT3 in MPlabX, but I get the following error:
***************************************************** Connection Failed.
When I enable the 'Power Target Circuit From Tool', I get another error:
The target circuit may require more power than the debug tool can provide. An external power supply might be necessary. Connection Failed.
So a provided an external power supply of 5V and my PIC 16F628A is draining 10mA, despite nothing is connected, only the PICKIT3 to the MCLR, ICSPDATA and ICSPCLK pins of PIC.
I'm using Ubuntu 16.04, MPlabX IPE V4.05., and
PS: Yes, I know how to read a datasheet.
PS: Circuit and PICKIT3 works properlyt if I connect to PICKIT3 Programmer running on Windows 7.
Luís Felipe KunzlerLuís Felipe Kunzler
1 Answer
The first issue can sometimes be resolved by shutting down MPLABX, disconnecting the PicKit from your computer and reconnecting everything. Seems the firmware and/or driver sometimes gets in a weird state and needs a good boot to get going again. I sometimes have to reboot my computer just to program my main board (Major PITA).
The second issue is not necessarily caused by an over current despite the message. I always got this error when my PicKit was plugged into an unpowered USB hub. It seems the lower USB bus voltage confuses the PicKit into thinking that the device is the cause for the voltage drop instead of the host simply not supplying the normal voltage. Try plugging it into a powered USB hub or directly into your computer.
Mathieu L.Mathieu L.