Suggestions for mC - UPDATED!

Beta Testing discussion on mikroC PRO for AVR.
Post Reply
Author
Message
sadavis80
Posts: 114
Joined: 15 Nov 2008 19:27

Suggestions for mC - UPDATED!

#1 Post by sadavis80 » 20 Nov 2008 16:46

1). How about adding a 'tool' that will allow zipping of ALL files related to a project into a file - output file name/path to be entered at execution time (or possibly automatically set to 'Project Name + date'). Sort of a poor man's version control system. I use this method for routinely backing up 'pictures' of my projects at various milestone points. I can ALMOST do this with the existing tool structure, but it would be nice ...

If you can't add that internally, maybe you could add another option to the TOOL Macro drop down box that would include all project file names ???
--->> AND we need a way to see the output of the tool so that we'll know the complete line that will actually be executed before we hit the shortcut. (just a text box below the shortcut to show it should do) - OH, OH - we also need a way to call it from a menu - so we don't have to remember the shortcut key for seldom used ones :).
--> I also just noted that if you don't have ANY parameters, it fails because '%1' is appended after the filename - which it doesn't recognize if the program doesn't allow parameters...


2). I don't see a way to execute the assembler/linker portion of the compiler by itself. I can see a time when I might want to 'tweak' the asm output a bit here and there and then assemble it. Seems it should be easy to do and possibly QUITE helpful to some.

3). Can you provide a brief explanation (if possible) of the differences in the 6 possible OPTIMIZATION levels available?

4). Can you provide a brief explanation of the compiler (success) messages below?
Used RX (bytes): 14 (44%) Free RX (bytes): 18 (56%) Used RX (bytes): 14 (44%) Free RX (bytes): 18 (56%)

Static RAM (bytes): 2 Dynamic RAM (bytes): 8190 Static RAM (bytes): 2 Dynamic RAM (bytes): 8190

Used ROM (bytes): 516 (0%) Free ROM (bytes): 122363 (100%) Used ROM (bytes): 516 (0%) Free ROM (bytes): 122363 (100%)

I'm not sure what 'RX' represents - oops - OK, I see that it is register space. I presume that this message means that I've used 14 registers and that there are still 18 more unused. (I have optimization turned OFF for debugging).
RAM info isn't clear whether it's USED bytes, or FREE bytes and why is it repeated twice? I think it's supposed to be USED/FREE, but it doesn't read that way.
ROM seems fine, except it's repeated twice. Possibly first from compiler and second from assembler?

Steve
PS. When using the math library, debugger seems to run INCREDIBLY SLOW. It takes some 20 minutes to run a loop like the one below

CONST PI 3.14159

for (i=0; i< (256+64); i++) { // probably don't need to go beyond 256
f = 2 * PI * i/256;
f = (1 + sin(f)) * 128; // float value from 0 to 2 & nomalize to 256
k = floor(f); // get integer value
if (k > 255) k = 255; // don't allow 256
DacVolts = k;
if ((f - k) > 0.5) // round up if necessary
if (DacVolts < 255) // as long as it isn't already at max
DacVolts += 1;
}

This is the one I had so much trouble trying to read parameter values at intermediate points within the loop. I finally had to let the loop run its course and break after it completed the full loop - only THEN could I look at the (final) values to see what happened. I solved my issue by adding several global arrays (already removed here) to hold intermediate values so I could study them after the fact. (and I took LONG breaks while letting the debugger run <G>).

User avatar
rajkovic
mikroElektronika team
Posts: 694
Joined: 16 Aug 2004 12:40

Re: Suggestions for mC - UPDATED!

#2 Post by rajkovic » 21 Nov 2008 08:24

sadavis80 wrote: 2). I don't see a way to execute the assembler/linker portion of the compiler by itself. I can see a time when I might want to 'tweak' the asm output a bit here and there and then assemble it. Seems it should be easy to do and possibly QUITE helpful to some.
-if you want just to link mcl files simply pass just mcl files to compiler not c files.
(in project manager mcl files should be added under binaries)
Assembly is only allowed as part of C file you can read help about how to do that. If you want just to change a part of assembly generated just copy it from lst file and use it instead c line for which is generated
sadavis80 wrote: 3). Can you provide a brief explanation (if possible) of the differences in the 6 possible OPTIMIZATION levels available?
it is pass count for all optimization routines (see help for details)
sadavis80 wrote: 4). Can you provide a brief explanation of the compiler (success) messages below?
Used RX (bytes): 14 (44%) Free RX (bytes): 18 (56%) Used RX (bytes): 14 (44%) Free RX (bytes): 18 (56%)

Static RAM (bytes): 2 Dynamic RAM (bytes): 8190 Static RAM (bytes): 2 Dynamic RAM (bytes): 8190

Used ROM (bytes): 516 (0%) Free ROM (bytes): 122363 (100%) Used ROM (bytes): 516 (0%) Free ROM (bytes): 122363 (100%)

I'm not sure what 'RX' represents - oops - OK, I see that it is register space. I presume that this message means that I've used 14 registers and that there are still 18 more unused. (I have optimization turned OFF for debugging).
RAM info isn't clear whether it's USED bytes, or FREE bytes and why is it repeated twice? I think it's supposed to be USED/FREE, but it doesn't read that way.
ROM seems fine, except it's repeated twice. Possibly first from compiler and second from assembler?

RX space that is reported as free is left for user. You can place variabes in RX space and get more speed and less code where it is important to you.

RAM is separated in static and dynamic link spaces.
Static is portion used by global variables and static local vars.
Dynamic is space that is left over for parameters and locals (auto variables) located on function frame it can but may not be used.
Steve
PS. When using the math library, debugger seems to run INCREDIBLY SLOW. It takes some 20 minutes to run a loop like the one below

CONST PI 3.14159

for (i=0; i< (256+64); i++) { // probably don't need to go beyond 256
f = 2 * PI * i/256;
f = (1 + sin(f)) * 128; // float value from 0 to 2 & nomalize to 256
k = floor(f); // get integer value
if (k > 255) k = 255; // don't allow 256
DacVolts = k;
if ((f - k) > 0.5) // round up if necessary
if (DacVolts < 255) // as long as it isn't already at max
DacVolts += 1;
}


we have tested this code and simulation run for about 2 minutes
could you please close all windows except Watch Values and editors and try how much it will take. It may be that code explorer is slowing down simulation.
or something like that.

sadavis80
Posts: 114
Joined: 15 Nov 2008 19:27

Re: Suggestions for mC - UPDATED!

#3 Post by sadavis80 » 21 Nov 2008 14:44

rajkovic wrote: RX space that is reported as free is left for user. You can place variabes in RX space and get more speed and less code where it is important to you.
Are you saying that *I* can control that? With compiler directives or something? How? ... never mind... I see it in the help :oops:
rajkovic wrote: it is pass count for all optimization routines (see help for details)
I have looked at the help and it talks about the optimizations available, but no relation to the 'level' selection. So I understand from your reply that ALL optimizations are "looked for" on every pass - just that the "look" will change from pass to pass and I can select more or less passes.

Thanks for the other replies - I'll look again at the loop issue when I have more time. Right now, I just comment it out when I don't need it for other parts of the program.
Steve

Post Reply

Return to “mikroC PRO for AVR Beta Testing”