how to allocate large arrays in CCS

I have not been able to find information in the documentation for this question...

How can I allocate an array of 512 bytes (for instance) using the CCS C compiler on a PIC18LF2525 component?

Is it simply:

char array[512];

?

Thanks.

Dave

Reply to
Dave
Loading thread data ...

I don't think so. If I'm reading the manual correct that is too large for a single entity.

From the online help: A subscript to a RAM array must be at least 1 and not more than 128 elements. Note that large arrays might not fit in a bank. ROM arrays may not occupy more than 256 locations.

I read that as a big NO for your char array[512]

Jim

Reply to
James Beck

Thanks, Jim.

I guess I'll break it down into multiple smaller arrays.

Dave

Reply to
Dave

I never really noticed the limitation before, so I leaned something too. I think the largest array I ever used in a PIC project was a 128 byte serial buffer. So, I never bumped into it.

Jim

Reply to
James Beck

I'm trying to construct a buffer to hold the contents of a Compact Flash read. The buffer is 512 bytes long. I'm using a PIC18LF2525, which in itself has plenty of data space (3986 bytes) but I didn't remember to consider page boundaries, etc.

I saw a FAQ in the databook concerning how to allocate table arrays up to

256 bytes but I couldn't find the reference to the limitation on RAM arrays. Where did you dind that reference? I didn't run across it in the online help, either.

...I'm just getting old and blind...

Thanks

Dave

Reply to
Dave

Using the CCS help that's in/available from the compiler, I did a search for "array". The best place to find it is in the error message listing. They have several array error messages and one of them has the text I posted.

Jim

Reply to
James Beck

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.