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

For C and ASSEMBLY users to post questions and code snippets for programming in C and ASSEMBLY. And for any other C or ASM course related questions.

Moderators: Benj, Mods

Post Reply
Carmen Garcia
Posts: 59
Joined: Thu Aug 23, 2012 10:37 am
Has thanked: 14 times
Been thanked: 3 times

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

Post 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
Carmen Garcia

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

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

Post 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.
http://www.matrixmultimedia.com/mmforum ... ays#p39852

Carmen Garcia
Posts: 59
Joined: Thu Aug 23, 2012 10:37 am
Has thanked: 14 times
Been thanked: 3 times

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

Post 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
Carmen Garcia

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

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

Post 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!

Carmen Garcia
Posts: 59
Joined: Thu Aug 23, 2012 10:37 am
Has thanked: 14 times
Been thanked: 3 times

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

Post by Carmen Garcia »

:? I need to sleep....

Thanks you very much¡

Regards
Carmen Garcia

Carmen Garcia
Posts: 59
Joined: Thu Aug 23, 2012 10:37 am
Has thanked: 14 times
Been thanked: 3 times

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

Post 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
Last edited by Carmen Garcia on Thu Apr 11, 2013 7:07 pm, edited 1 time in total.
Carmen Garcia

Carmen Garcia
Posts: 59
Joined: Thu Aug 23, 2012 10:37 am
Has thanked: 14 times
Been thanked: 3 times

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

Post 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
Carmen Garcia

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times

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

Post 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
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times

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

Post by dazz »

hi Carmen
Heres a link to the sim mentioned above post by enamul http://www.matrixmultimedia.com/mmforum ... tin#p38159
Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

Carmen Garcia
Posts: 59
Joined: Thu Aug 23, 2012 10:37 am
Has thanked: 14 times
Been thanked: 3 times

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

Post 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.
Carmen Garcia

Post Reply