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.

[PIC] PIC starts assigning random values to variables when program is lengthy

Status
Not open for further replies.

burrow

Full Member level 2
Full Member level 2
Joined
Dec 15, 2014
Messages
147
Helped
3
Reputation
6
Reaction score
3
Trophy points
18
Visit site
Activity points
1,148
Hey iam working on a project with PIC18F4520. and iam using mikroc to write the program.
The program is really lengthy and it uses around 44% of the ROM. and now i am in a problem, When The rom crosses around 43 or 44% then the pic starts assigning random values to certain variables.

Ya i checked if the problem is with any newly added block of code, but its not.
 

When The rom crosses around 43 or 44% then the pic starts assigning random values to certain variables.
It's surely not the PIC doing wrong, it's either the compiler or your own code.

Are you using any kind of code-size limited compiler demo version?
 

It's surely not the PIC doing wrong, it's either the compiler or your own code.

Are you using any kind of code-size limited compiler demo version?

Iam using full version of mikroc 6.4
 

Are you saying that:

Code:
unsigned char x;
x=0x00;

will make x some random value or are you trying to rely on the compiler to set all your variables to 0x00 and some are and some are random?

Good programming practice would be to set the variables to a value in code rather than hoping the compiler does it for you.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top