Page 1 of 1

How do I size my arrays with Boost C 7.04 version?

Posted: Tue Apr 09, 2013 10:33 pm
by Carmen Garcia
Hello everybody:

It is possible to make arrays with Boot C 7.04 for PIC, but I don't know what does this sentence exactly "The only constrains is that an array must fit into a single RAM bank" mean??

In PIC guide I had found this for Data Memory (RAM memory) "Each bank extendes up to 7Fh, 128 bytes"

Does this mean that a array's size couldn't exceed the 128 bytes?? But Does the array's size be smaller than 128 bytes??

Thanks in advanced

Regards

Re: How do I size my arrays with Boost C 7.04 version?

Posted: Wed Apr 10, 2013 10:47 am
by Benj
Hello,

8-bit PICs have a restricted RAM page size of 256 bytes so this is your limitation. Arrays smaller then or equal to 256 bytes should work fine.

There is a way to allow larger arrays using the idx2 parameter as described here.
viewtopic.php?f=29&t=11262&p=42493&hilit=large+arrays#p39852

Re: How do I size my arrays with Boost C 7.04 version?

Posted: Wed Apr 10, 2013 12:36 pm
by Carmen Garcia
Hi Benj:

But in my PIC's guide appears "Each bank extendes up to 7Fh, 128 bytes"...

Please, another question:
I created this C code in a C FlowCode v5 Macro:

MX_UINT8 Array[20][17];
Array[1][1]=0xff;

FCV_Valor= Array[1][1]=0xff;


And the "Valor" variable doesn't set to 0xff.


Thanks you very much Benj.

Regards

Re: How do I size my arrays with Boost C 7.04 version?

Posted: Wed Apr 10, 2013 5:08 pm
by Benj
Hello,

Flash banks are 128 bytes, RAM banks are 256 bytes.

What about this instead.

Code: Select all

MX_UINT8 Array[5][5];
Array[1][1]=0xff;
FCV_VALOR = Array[1][1];


20 x 17 = 340 bytes which is over then 256 page limit!

Re: How do I size my arrays with Boost C 7.04 version?

Posted: Thu Apr 11, 2013 7:36 am
by Carmen Garcia
:? I need to sleep....

Thanks you very much¡

Regards

Re: How do I size my arrays with Boost C 7.04 version?

Posted: Thu Apr 11, 2013 6:40 pm
by Carmen Garcia
Hello Benj:

I have set right the array's size for the appropiate use of RAM:

MX_UINT8 n=10;
MX_UINT8 Id=17;
MX_UINT8 Neighbor_Table[n][Id];

Neighbor_Table[1][1]=0xff;

FCV_VALOR = Neighbor_Table[1][1];


I suspect the type of variables doesn't match because I am using the portions of C Code I seen in the Main Code (putting in C View...)

I don't found a explicit guide for to create C code in C FlowCode Macro¡¡

Thanks you very much

Regards

Re: How do I size my arrays with Boost C 7.04 version?

Posted: Thu Apr 11, 2013 6:42 pm
by Carmen Garcia
I know what happens...The C Code doesn't simulate in FlowCode.

Really does not exist a way for simulate the C code?

I was lookin for a Boost C simulator in the FlowCode Program Drectory (...\Flowcode\Tools\boostc\) but I didn't see anything.
Now I download a simulator from the official site, SourceBoost.

Any incovenience? Other alternatives?

Thanks¡

Regards

Re: How do I size my arrays with Boost C 7.04 version?

Posted: Thu Apr 11, 2013 8:36 pm
by dazz
HI Carmen
I think Martin uses a program called pic simulator do a search on this forum as martin has linked to it quite a few times, i think you compile to hex then load the hex into the sim and away you go

Regards
Dazz

Re: How do I size my arrays with Boost C 7.04 version?

Posted: Thu Apr 11, 2013 8:51 pm
by dazz
hi Carmen
Heres a link to the sim mentioned above post by enamul viewtopic.php?f=7&t=11092&p=38159&hilit=pic+simulator+martin#p38159
Regards
Dazz

Re: How do I size my arrays with Boost C 7.04 version?

Posted: Wed Apr 17, 2013 11:01 am
by Carmen Garcia
Thanks very much Dazz, but I not got much time and this simulator requires very much for learn...Finally I have opted for NO 2 dimensions arrays.

Thanks very much everybody.

Regards.