|
|
View previous topic :: View next topic |
Author |
Message |
martint88
Joined: 11 Feb 2011 Posts: 5
|
Memory not available at requested location |
Posted: Mon Jun 13, 2011 2:26 pm |
|
|
Hello,
I'm trying to use the program memory to save the my system configuration. For the factory defaults, I use the following code:
Code: |
#rom int8 0x1FC00={0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
|
When compiling, I receive the "Memory not available at requested location" warning, but in the disassembly, I get the memory correctly initialized.
I'm using PIC18F47J13, and CCS Version 4.110
I also get this warning in the following lines:
Code: |
union Bits_Sueltos
{
int8 Palabra;
int1 Flags[8];
};
typedef union Bits_Sueltos tipo_Bits;
|
Is this the correct way to tell the linker not to use this memory for code?
What is this warning?
Thankyou
regards,
Martin |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jun 13, 2011 2:39 pm |
|
|
Quote: |
When compiling, I receive the "Memory not available at requested location" warning.
|
I made a test program and I don't get any warning like that in either
Debug or Release configuration:
Code: |
Executing: "C:\Program Files\PICC\Ccsc.exe" +FH "PCH_Test.c" +DF +LY -T -A +M -Z +Y=9 +EA #__18F47J13=TRUE
>>> Warning 203 "PCH_Test.c" Line 12(1,1): Condition always TRUE
Memory usage: ROM=0% RAM=0% - 0%
0 Errors, 1 Warnings.
Loaded C:\Program Files\PICC\Projects\PCH_Test\PCH_Test.cof.
BUILD SUCCEEDED: Mon Jun 13 13:34:03 2011
------------
List file:
CCS PCH C Compiler, Version 4.110, xxxxx 13-Jun-11 13:34
Filename: C:\Program Files\PICC\Projects\PCH_Test\PCH_Test.lst
ROM used: 48 bytes (0%)
Largest free fragment is 65496
RAM used: 4 (0%) at main() level
4 (0%) worst case
Stack: 0 locations
|
Here is the test program:
Code: |
#include <18F47J13.h>
#fuses HS,NOWDT
#use delay(clock=4000000)
#rom int8 0x1FC00={0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
//=====================
void main()
{
while(1);
} |
You should do your typedef like this:
Code: |
typedef union
{
int8 Palabra;
int1 Flags[8];
}Bits_Sueltos;
Bits_Sueltos tipo_Bits; |
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Mon Jun 13, 2011 2:54 pm |
|
|
The warning on the union, is probably because 'arrays of bits are not permitted'.....
Best Wishes |
|
|
martint88
Joined: 11 Feb 2011 Posts: 5
|
|
Posted: Tue Jun 14, 2011 5:49 am |
|
|
I could solve the problem on the warning, but:
is it true I can´t use arrays of bits? I think I Can in version 4.110...
What i found it doesn´t work is to asign a bit from an array to another bit, as follows:
Code: |
int1 flag;
int1 flag2[10];
int8 i;
for (i = 0; i < 10; i++)
{
flag = flag2[i]; // this seems not working.
}
|
That´s why, i had to replace all bit arrays I used by another code.
Thank you for your help
regards,
Martin |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Tue Jun 14, 2011 5:58 am |
|
|
From the manual on page 43:
Quote: | SHORT is a special type used to generate very efficient code for bit
operations and I/O. Arrays of bits (INT1 ) in RAM are now supported.
Pointers to bits are not permitted. |
_________________ Google and Forum Search are some of your best tools!!!! |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|