PDA

View Full Version : Have I exceeded the capability or limitations of the compiler or MPLAB?



tjkelly
- 18th November 2011, 14:16
Everything was going great until I got the following error using MPLAB V8.80 free version, PBP 2.60c, Long version of compiler.

ERROR: Unable to execute mpasmwin.Error[126] C:\PBP\PBPPI18L.LIB 733 : Argument out of range (16780 not between 0 and 16383)
Error[126] C:\PBP\PBPPI18L.LIB 804 : Argument out of range (16780 not between 0 and 16383)

I thought I had a code error but it seems to be related to possibly code size, number of lines of code??
Here is the assembler error.


6127


I checked this by eliminating code and by copying/pasting/renaming some subroutines that are compiling without error.
At some point as I add code I will get the error above.

mackrackit
- 18th November 2011, 14:39
From your description it sounds like you have filled your chip. You need a chip with more memory or optimize your code.

Post the code and chip, maybe there will be some help.

tjkelly
- 18th November 2011, 15:09
How can I determine the actual size of the code?
The last working version that I have is a 35K Hex file but I don't know the actual binary code size.


From your description it sounds like you have filled your chip. You need a chip with more memory or optimize your code.

Post the code and chip, maybe there will be some help.

mackrackit
- 18th November 2011, 15:36
Goto your project directory and look for a *.LST file.
Near the bottom of the file it will tell how much program memory is used/free.

tjkelly
- 18th November 2011, 16:22
I believe you are correct in your assumption.
Here is the LST file info:
All other memory blocks unused.
Program Memory Bytes Used: 16376
Program Memory Bytes Free: 8

Errors : 2
Warnings : 0 reported, 4 suppressed
Messages : 0 reported, 17 suppressed

The 18F2423 has 16KB Flash Program Memory.
Is there a switch in the compiler or assembler for optimization and are there any reasons why I might not want to do that?
I could switch to the 18F2523 at this point if I hacve to.


Goto your project directory and look for a *.LST file.
Near the bottom of the file it will tell how much program memory is used/free.

mackrackit
- 18th November 2011, 18:08
Is there a switch in the compiler or assembler for optimization
No, the optimization is done by the person behind the keyboard.

Again, if you post your code someone may be able to help.

BrianT
- 20th November 2011, 22:59
I had a similar error recently. It was caused by a DEBUG statement that was missing a comma.
I had intended the line to be
DEBUG 13, 10, "text here", 13, 10 but it got entered as
DEBUG 13, 10, "text here", 1310

The compiler was expecting a byte value but it got a word instead.

You may have a similar problem.

http://www.picbasic.co.uk/forum/images/icons/icon1.png Re: Argument out of range - how to find what is causing it? There is a simpler way.
All the necessary information is in the .LST file. You need to search for "Argument out of range" and then scroll up many pages until you find the PBP statement that caused the problem.

02247 ; C:\PWEE2011\10OCT2011\SEQUENCER VER BM 26 OCTOBER 2011_BU\SEQUENCER VER BM 26 OCTOBER 2011_111102_1512
00.PBP 00733 debug 13, 10, "598", 1310 The text in red is the offending PBP statement at line 733 in the MCSPX file.

HTH
BrianT