• AVR Freaks

Hot!Which version to download?

Page: < 123 > Showing page 2 of 3
Author
dan1138
Super Member
  • Total Posts : 3713
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Which version to download? 2020/06/05 14:50:34 (permalink)
+1 (1)
Ok, I can feel your pain.

For Windows OS I installed XC8 v2.20 on this path: C:\Apps\PIC_dev\MPLABXC\xc8\v2.20\

Your installation path may be different.

Here is how Microchip, in their infinite and near God like wisdom implements this:

The statement #include <xc.inc> includes this file: C:\Apps\PIC_dev\MPLABXC\xc8\v2.20\pic\include\xc.inc

xc.inc                  in turn includes this file: C:\Apps\PIC_dev\MPLABXC\xc8\v2.20\pic\include\pic18.inc
 
pic18.inc               in turn includes this file: C:\Apps\PIC_dev\MPLABXC\xc8\v2.20\pic\include\pic18_chip_select.inc
 
pic18_chip_select.inc   in turn includes this file: C:\Apps\PIC_dev\MPLABXC\xc8\v2.20\pic\include\proc\pic18f2321.inc


These various include files have definitions that are helpful with developing assembly language projects. With your current level of experience that may be more of a distraction than a help but your can safely ignore how complex Microchip made this now that you know where to find the device specific register definitions.
post edited by dan1138 - 2020/06/05 16:06:41
#21
atferrari
Super Member
  • Total Posts : 1444
  • Reward points : 0
  • Joined: 2004/07/08 13:09:24
  • Location: Buenos Aires - Argentina
  • Status: offline
Re: Which version to download? 2020/06/05 16:51:57 (permalink)
0
dan1138
These various include file have definitions that are helpful with developing assembly language projects. With your current level of experience that may be more of a distraction than a help but your can safely ignore how complex Microchip made this now that you know where to find the device specific register definitions.

  
Thanks Dan.  Excellent.Smile: Smile
 
/EDIT
Posting as an edit because the site does not allow any follow up from my side
 
Hola Dan
 
After so many hours spent in vain trying to build it with the XC8 option, I realized that I should choose pic-as as a tool chain! I was getting strange errors, even with your template!! My bad.
 
In your code, even in one in a previous thread, I realized that:
 
a) you do not follow the format described in the manual for binary numbers; you use this: 0b11010011. Compiler does not complain.
 
b) You use this more than once
 
#ifndef LCD_INC
#define LCD_INC
 
Care to elaborate?
 
c) Prior testing the flag's of a timer interrupt you check if it was enabled? Why? You do not trust in what you programmed before?
 
Thanks for your time
 
/EDIT
post edited by atferrari - 2020/06/07 14:24:16

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/
#22
atferrari
Super Member
  • Total Posts : 1444
  • Reward points : 0
  • Joined: 2004/07/08 13:09:24
  • Location: Buenos Aires - Argentina
  • Status: offline
Re: Which version to download? 2020/06/09 01:21:37 (permalink)
0
@dan1138
Hi Dan
Could you reply my post above?

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/
#23
ric
Super Member
  • Total Posts : 27966
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: Which version to download? 2020/06/09 02:11:58 (permalink)
+4 (4)
atferrari
a) you do not follow the format described in the manual for binary numbers; you use this: 0b11010011. Compiler does not complain.

That's the standard C format. Plainly it accepts that as well.
 

b) You use this more than once
 
#ifndef LCD_INC
#define LCD_INC
Care to elaborate?

They are "code guards", to make sure a header file doesn't get included more than once.
Google it.
 

c) Prior testing the flag's of a timer interrupt you check if it was enabled? Why? You do not trust in what you programmed before?

That is standard practice on a PIC which only has a single interrupt vector, and potentially multiple sources that can trigger interrupts.
Without it, you cannot suppress an interrupt source by clearing the IE bit, as any OTHER interrupt can also cause the ISR to run, which will continue to run the disabled service if you don't have that test.
 

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!
#24
atferrari
Super Member
  • Total Posts : 1444
  • Reward points : 0
  • Joined: 2004/07/08 13:09:24
  • Location: Buenos Aires - Argentina
  • Status: offline
Re: Which version to download? 2020/06/09 05:18:35 (permalink)
0
Quite clear Ric. 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/
#25
dan1138
Super Member
  • Total Posts : 3713
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Which version to download? 2020/06/09 09:33:35 (permalink)
+1 (1)
I agree with the comments ric (who is always right) has made.
 
Though I would like to respond to one part of your post:
atferrari
a) you do not follow the format described in the manual for binary numbers; you use this: 0b11010011. Compiler does not complain.

There is more that one "manual" from Microchip that describes the MPASM assembler.
 
In over 40 years of usage MPASM has accumulated a lot of "technical debt". Not the the least of which is three (3) different ways to compose decimal and hexadecimal literal constants for expressions.
 
The pic-as(v2.20) assembler supports only conventional C language expressions. The pic-as(v2.20) manual is the one that Microchip seems to be getting on with.
#26
atferrari
Super Member
  • Total Posts : 1444
  • Reward points : 0
  • Joined: 2004/07/08 13:09:24
  • Location: Buenos Aires - Argentina
  • Status: offline
Re: Which version to download? 2020/06/15 15:32:28 (permalink)
0
dan1138
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.
 
There must be a better way, I'm just not smart enough to find it.




Hi Dan
I explored  the debugging with MPLABX / pic-as 2.20, by porting a simple application that I got partly working before, with MPASM.
 
The procedure for debugging using the .elf file seems clear to me.
 
My question: had you the chance to have the name of your variables recognized and visible in the debugger console? That makes for the a huge difference.
 
I couldn't get a single one in the list in spite they were dutifully declared as global in their respective psect. Otherwise I am looking for numbers instead of names. Clunky.
 

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/
#27
dan1138
Super Member
  • Total Posts : 3713
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Which version to download? 2020/06/17 09:04:59 (permalink)
+1 (1)
When importing the ELF fine into a new MPLABX v5.40 project, all my symbolic information is available in the debug view.
 
From what you posted I cannot tell if you are following what I got to work, or if my instructions are wrong. But they are working for me.
#28
atferrari
Super Member
  • Total Posts : 1444
  • Reward points : 0
  • Joined: 2004/07/08 13:09:24
  • Location: Buenos Aires - Argentina
  • Status: offline
Re: Which version to download? 2020/06/18 00:06:36 (permalink)
0
I believe I am doing it all right but who knows what part I am actually not.
Last night one single symbol, GPR, showed up by itself in the window but just at the start. Later it vanished.

I was even able to type the name of other two (they were accepted with its own diamond in the list) but once I I selected another window and later retrieved that one, they had vanished.
I've checked that my variables are all in the symbol table in .lst file.

Tired of so many pirouettes I managed to debug the application using an LCD, in three hours.
Could you Dan give a concrete list of details to check so I get my symbols showing up?

I locate the new prebuilt in an ad hoc folder. Is it that ok?

Just in case, once you start the "prebuilt" by importing the .elf file, do you repeat the make and then program, prior to launch the debugger?
post edited by atferrari - 2020/06/18 00:08:48

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/
#29
dan1138
Super Member
  • Total Posts : 3713
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Which version to download? 2020/06/18 01:49:44 (permalink)
+1 (1)
I have ported another assembly language project but debug for this project fails.
 
I do not think what I am suggesting as a workaround is stable.
 
I'm going to keep trying but don't hold your breath.
 
This pic-as(v2.20) tool chain is not ready for prime time.
#30
atferrari
Super Member
  • Total Posts : 1444
  • Reward points : 0
  • Joined: 2004/07/08 13:09:24
  • Location: Buenos Aires - Argentina
  • Status: offline
Re: Which version to download? 2020/06/18 02:10:57 (permalink)
0
OK Dan I will try being even more methodic to see if I get something consistent.
I will stop posting in this thread.

Thanks for replying.

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/
#31
dan1138
Super Member
  • Total Posts : 3713
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Which version to download? 2020/06/18 10:25:29 (permalink)
0
The workaround I came up with is twitchy.
 
I get the most consistent behavior when I explicitly terminate the debug session, select the "normal" project, modify the source code, explicitly build for debug, then select the "prebuilt" project, then start a debug session.
 
I have no project selected as the "main" project.
 
I do not know how much of what I do is required, but this was the simplest method I could find.
#32
atferrari
Super Member
  • Total Posts : 1444
  • Reward points : 0
  • Joined: 2004/07/08 13:09:24
  • Location: Buenos Aires - Argentina
  • Status: offline
Re: Which version to download? 2020/06/18 14:15:34 (permalink)
0
Thanks for coming back, Dan. I understand your procedure.
 
My sole problem seems to be the variables' name (GPRs) not being recognized, not even a list of them shown.
 
My questions:
 
a) Variables (and labels) in my "normal" project do show up in the symbol table at the end of the xxxx.lst file.
May I asume that that confirms I declared them correctly, right?
 
b) The xxxx.elf is all I nedd to make and program before debugging the "prebuilt", right?
 
c) "Scope" for variables in Assembly makes any sense to consider?
 
d) For the "prebuilt" project do you create a separate folder?

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/
#33
dan1138
Super Member
  • Total Posts : 3713
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Which version to download? 2020/06/18 14:46:46 (permalink)
0
The pic-as(v2.20) assembler does not have any syntax to define the scope of variables that I can find documentation for.
 
This means only objects that explicitly appear in a 'global' directive will be visible in a debug session.
 
The good news is the address of source code statement seem to be known to the debug session so the step into toolbar button works as expected.
 
The twitchiness seems seem to come from getting the update/build/debug process performed with the correct steps for each iteration.
 
I can get it to work but it's far from ideal and easy to get it going sideways.
post edited by dan1138 - 2020/06/18 18:11:49
#34
dan1138
Super Member
  • Total Posts : 3713
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Which version to download? 2020/06/18 16:05:33 (permalink)
+1 (1)
atferrari
My questions:
 
a) Variables (and labels) in my "normal" project do show up in the symbol table at the end of the xxxx.lst file.
May I asume that that confirms I declared them correctly, right?

I think that is necessary but not sufficient, they must be explicit declared global too.
atferrari
b) The xxxx.elf is all I need to make and program before debugging the "prebuilt", right?

It needs to be the .ELF file from a "Build for debug" build.
atferrari
c) "Scope" for variables in Assembly makes any sense to consider?

For assembly projects there seems to be only a global name space.
atferrari
d) For the "prebuilt" project do you create a separate folder?

Yes, for me it's convenient for it to be at the same level at the "normal" project.
 
 

Attachment(s)

Attachments are not available: Download requirements not met
#35
atferrari
Super Member
  • Total Posts : 1444
  • Reward points : 0
  • Joined: 2004/07/08 13:09:24
  • Location: Buenos Aires - Argentina
  • Status: offline
Re: Which version to download? 2020/06/18 18:09:14 (permalink)
0
Thanks for replying in detail; I appreciate that. Tomorrow I will restart my tests to see where I end.
 

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/
#36
dan1138
Super Member
  • Total Posts : 3713
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Which version to download? 2020/06/18 18:16:55 (permalink)
+2 (2)
I have attached a project this runs using only the MPLABX v5.40 simulator.
 
Give it a try and let me know what you think.
 
You should be able to UNZIP this to any folder and open the "18F2550_isqrt_v540_debug.X" project then start a debug session. Rebuilding it should not be needed.
post edited by dan1138 - 2020/06/18 23:06:32

Attachment(s)

Attachments are not available: Download requirements not met
#37
atferrari
Super Member
  • Total Posts : 1444
  • Reward points : 0
  • Joined: 2004/07/08 13:09:24
  • Location: Buenos Aires - Argentina
  • Status: offline
Re: Which version to download? 2020/06/22 08:43:39 (permalink)
0
Didn't know you posted the above, Dan. Downloaded already
Perhaps tonight I will see what is about. I will try to come back asap.
Gracias.

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/
#38
atferrari
Super Member
  • Total Posts : 1444
  • Reward points : 0
  • Joined: 2004/07/08 13:09:24
  • Location: Buenos Aires - Argentina
  • Status: offline
Re: Which version to download? 2020/06/27 05:43:04 (permalink)
0
Hi Dan @dan1138
Verified your example. You are using a mix of assembly and C (is it MCC who provided part of it?) so I couldn't conclude much. Impressive and neat.
 
Having completed successfully my project (extremely simple) I spent several hours learning how to do debugging.
And I agree that the step to open the .elf is a pain because all the changes I did, on purpose, to a program running perfectly just confused the PC. Had to go to the "normal" and do the changes there. Am I wrong here?
 
Some comments in no specific order:

1) Symbols, they all dutifully show up in the .lst file.
 
2) After revising my global declaration of vars in RAM, now I can see them in the registers list. My most basic concern, honestly.
 
3) Regarding variables in RAM all do show in the window during the debugging (so you choose which one you like) with one incredible exception: the registers defined with the DABS directive (absolute) in access bank (the guide says they are global by definition!!) have their name not displayed in the symbols list. Why? A mistery.
 
3) The labels in the Navigator Window (find them quite useful) they do not appear if the next line in the source is not at least a single line of code. A macro, won't do it.
 
4) I stopped opening a folder for debugging the "prebuilt", via .elf. MPLAB opens the whole thing inside the project's folder. Why to bother then having that defined already?
 
5) Keeping several windows in sight resulted hard for me. Not sure of how to dock (or float?) them avoiding to end with them behind the main screen or nowhere.
 
Just two questions: how do you get the the debugger showing actively the changes on the screen (I forgot how you call it) and how do you get the .gif showing exactly that?
 
Sorry for being wordy and the delay in replying. Gracias for all your time and patience.

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/
#39
dan1138
Super Member
  • Total Posts : 3713
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Which version to download? 2020/06/29 00:42:23 (permalink)
0
atferrari
You are using a mix of assembly and C (is it MCC who provided part of it?)

This project is a pure assembly language project, MCC does not enter into this at all. The comment block with the C code is there to remind me that I got this method from Wikipedia.
 
atferrari
Having completed successfully my project (extremely simple) I spent several hours learning how to do debugging.
And I agree that the step to open the .elf is a pain because all the changes I did, on purpose, to a program running perfectly just confused the PC. Had to go to the "normal" and do the changes there. Am I wrong here?

No, you are correct. The "normal" project is where changes to the source file must be "build for debug". This debug method is too tedious and Microchip needs to make the MPLABX IDE work for assembly language projects.
 
atferrari 
Just two questions: how do you get the the debugger showing actively the changes on the screen (I forgot how you call it)

That view is turned on by using the: Windows->Debugging->Variables menu.
 
atferrari
and how do you get the .gif showing exactly that?

It is a process of taking a screen shot after each step over click then using an animation program to build an animated GIF out of all the screen shots. It is a tedious process but it make for a real small video like image file. The GIF file is under 200K bytes a video screen capture of the same process was about 25 time larger (5M bytes).
post edited by dan1138 - 2020/06/29 01:28:51
#40
Page: < 123 > Showing page 2 of 3
Jump to:
© 2020 APG vNext Commercial Version 4.5