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.

Problem mikro c with callig too much subroutines

Status
Not open for further replies.

vicvicvar

Newbie level 1
Joined
Aug 5, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
15
Hey guys Im working on this code

void subroutine1()
{
//something goes here ( a lot of code )
}
void subroutine2()
{
//something goes here ( also a lot of code)
}
void subroutine()
{
//something goes here too with a lot of code
}

void main()
{
//Configuration bits here etc etc

while(1)
{
if(condition1)
{

if(condition2)
....................{
......................subroutine1();
......................subroutine2();

................................if(condition4)
................................{
................................subroutine3();
................................subroutine1();
................................}

...................}

...................if(condition1)
..................{
...................subroutine1()
...................subroutine3()
..................}

.......}


}

}


Im using the easy pic 7 to download the code to the 18f45k22 . The easy pic do download the code but is not working but if I remove some subroutines it will work with just a few. I dont know if the program counter gets overflowed when calling many subroutines with a lot of code in them and having all this inside IF conditional statement.

Do you know whats happening ? thanks !
 

Check th stack memory available on your uC. I guss the stack over flow occurs because of too many function calls... And make sure you are not calling any other function calls inside the subroutines...
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top