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.

[AVR] problem with call function in Mikroc

Status
Not open for further replies.

engallam

Junior Member level 1
Joined
May 26, 2014
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
313
Hi everyone
I have big problem in my project
Microcontroller : Atmega8A
Crystal : 16 M
IDE : MikroC for AVR

Problem:
I have a function and I want call it about 150 time in main function continuously
That make my code not work but when call it less then 30 time it work will
Note : No problem in compiling :/

 

Didn't you really notice anything odd ? You haven't posted the flawed code, but instead of this, you had just attached a picture of the working compilation log.
 

Didn't you really notice anything odd ? You haven't posted the flawed code, but instead of this, you had just attached a picture of the working compilation log.

This my code


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//speed_ctrl ();
     delay_ms(1);
    }
  }
 }
}
 
 
void main() 
{
 int x = 5;
 DDRB = 0xFF;           // Set direction to be output            ..
 DDRD = 0b00000011;
 
while(1)
{
 
 
view(427,430,x);
view(431,436,x);
view(437,439,x);
view(440,447,x);        
view(448,449,x);
view(350,354,x);
view(355,358,x);
view(359,362,x);
view(363,366,x);
view(450,455,x);
view(456,461,x);
view(462,465,x);
view(466,471,x);
view(472,473,x);
 
view(0,1,x);
view(2,3,x);
view(4,5,x);
view(6,9,x);
view(10,13,x);
view(14,17,x);
view(18,21,x);
view(22,25,x);
view(26,29,x);
view(30,36,x);
view(37,43,x);
view(44,47,x);
view(48,51,x);
view(52,55,x);
view(56,59,x);
view(60,63,x);
view(64,67,x);
view(68,71,x);
view(157,162,x);
view(163,168,x);
view(72,77,x);
view(78,81,x);
view(82,86,x);
view(87,94,x);
view(95,110,x);
view(111,115,x);
view(116,119,x);
view(120,121,x);
view(122,125,x);
view(126,127,x);
view(128,131,x);
view(185,200,x);
view(201,216,x);
view(217,218,x);
view(219,250,x);
view(251,254,x);
view(255,258,x);
view(259,266,x);
view(14,17,x);
view(18,21,x);
view(22,25,x);
view(26,29,x);
view(30,36,x);
view(267,269,x);
view(270,280,x);
view(330,333,x);
view(334,337,x);
view(338,341,x);
view(342,345,x);
view(346,349,x);
view(350,354,x);
view(355,358,x);
view(359,362,x);
view(363,366,x);
view(367,370,x);
view(371,374,x);
view(375,376,x);
view(377,382,x);
view(383,388,x);
view(281,281,x);
view(37,43,x);
view(44,47,x);
view(48,51,x);
view(282,303,x);
view(304,312,x);
view(313,317,x);
view(318,320,x);
view(321,324,x);
view(325,329,x);
view(389,391,x);
view(392,394,x);
view(395,398,x);
view(399,402,x);
view(403,408,x);
view(132,141,x);
view(142,145,x);
view(146,149,x);
view(150,156,x);
view(157,162,x);
view(163,168,x);
view(169,176,x);
view(177,184,x);
view(409,412,x);
view(413,416,x);
view(417,420,x);
view(421,426,x);
 
 
        
 
}
 
}

 
Last edited by a moderator:

Still lacks information.
You neither mentioned which function is causing the problem, and what error has been reported by compiler.
 

Stack overflow. Please check the status of the stack. Are you nesting calls?
 

Still lacks information.
You neither mentioned which function is causing the problem, and what error has been reported by compiler.

You notice I 've calls the sub function more than a hundred times , and this makes the program does not work in the circle
When I call it less than 30 time without changing anything else in the code the program works well

The compiler not make error
 

Stack overflow. Please check the status of the stack. Are you nesting calls?

I can't understand you :/
How can I check the status of the stack?
What meaning of "nesting calls" ?
:bang: :bang: :bang:
 

I'm guessing that this error could be due to the argument of the function perhaps out of bounds. To check this possibility, you could remove the calls from where the error is occurring, and replace them by the same values of the first 30 calls

Is thie problem happening on simulation, or on target board ?
 
You do not put 150 calls in one while loop; you divide them in 5 groups of 30 calls. It will work happily...
 

I'm guessing that this error could be due to the argument of the function perhaps out of bounds. To check this possibility, you could remove the calls from where the error is occurring, and replace them by the same values of the first 30 calls

Is thie problem happening on simulation, or on target board ?

The code work with any group of function
And problems happened with on simulation and target board "on both"
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top