Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to define rom static unsigned char type array in mplabx using xc8 compiler

Status
Not open for further replies.

dhakeparag81

Full Member level 2
Full Member level 2
Joined
Jun 6, 2012
Messages
142
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Location
INDIA
Visit site
Activity points
2,469
I use mcc18 compiler from long time, to compile my project for PIC MCU.
Now i am shifting to xc8 because i have license of it, so i am trying to convert all my projects according to xc8.
But one of them which is on Pic4520 having very long code size and in which i can able to define rom static unsigned char str1[10] while same giving problem in xc8.
Why?
Is there another method to define it.
 

I think you should probably use "const" not "static" if you want it in ROM and fixed.

If you get an error it would be useful to know what the error message is!

Also, the use of "static" and "const" is no different between XC8 and other versions of the PIC compiler.

Keith
 

thanx buddy..

and sorry to late reply.
used of const it saves the data in program memory.
Now array is fit without any error but in some array which are greater in length gives an error like cannot fit in section.
Last time i saw the linker where certain partition are made i think by changing these we can fit the long size array.
As the size is exceeded it can not fit in same page which was define in linker script (Well thats my understanding, please correct me if i am wrong).

Now i want to know is circular left shift and right shift is possible in mccc18/XC8 ?
I mean using single instruction.
What is the syntax?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top