dsPIC30F3013 freeze problem

General discussion on mikroPascal for dsPIC30/33 and PIC24.
Post Reply
Author
Message
gozi
Posts: 29
Joined: 14 Aug 2006 12:04

dsPIC30F3013 freeze problem

#1 Post by gozi » 29 May 2007 21:04

Hi,
I have the following problem:
This code not working on dsPIC30F3013. After reset the dsPIC not respond.
I use EasyDSPIC3 board, Mikropascal for dsPIC 5.0.0.0 and 30F3013 at 80Mhz. (This code work fine on 30F6014.)

Code: Select all

program test;
const os: array[10] of array[4] of word =  ((10, 10, 10, 10),
                                            (10, 20, 30, 40),
                                            (10, 20, 10, 20),
                                            (10, 20, 10, 30),
                                            (20, 30, 30, 10),
                                            (10, 20, 20, 30),
                                            (20, 10, 10, 20),
                                            (40, 20, 30, 20),
                                            (10, 30, 20, 10),
                                            (30, 10, 30, 10));


var i: word;
    v1,v2,v3,v4,v5,v6: array[96] of word;
begin
ADPCFG := $FFFF;
TRISB := 0;
for i:=0 to 94 do
v1[i]:=0;
for i:=0 to 94 do
v2[i]:=0;
for i:=0 to 94 do
v3[i]:=0;
for i:=0 to 94 do
v4[i]:=0;
for i:=0 to 94 do
v5[i]:=0;
for i:=0 to 94 do
v6[i]:=0;
 while TRUE do
    begin
      LATB := $0000;
      Delay_ms(1000);
      LATB := $FFFF;
      Delay_ms(1000);
    end;
end.
Thanks for advance.

User avatar
milan
mikroElektronika team
Posts: 1013
Joined: 04 May 2006 16:36
Contact:

#2 Post by milan » 31 May 2007 08:58

Hi,

We tested your code and we got the same behavior.
The problem is that your globals are using a lot of RAM and the compiler is not reporting that (we will fix this). You should get "Not Enough RAM" message.

If you go to EditProject menu you can increase the RAM space reserved for the Static variables, move the slider to the left (your code works for 40-60). Of course this will reduce the RAM space reserved for the dynamic variables.

jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

#3 Post by jpc » 31 May 2007 10:51

would it perhaps be possible to have the compiler report the memory-needs for both static and dynamic in some future version ? It is more or less blind adjusting right now.

gozi
Posts: 29
Joined: 14 Aug 2006 12:04

#4 Post by gozi » 31 May 2007 22:57

Thanks for answer, Milan. That works.

Post Reply

Return to “mikroPascal for dsPIC30/33 and PIC24 General”