CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

#locating to external RAM

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
s.jaglowski



Joined: 14 Nov 2005
Posts: 14

View user's profile Send private message

#locating to external RAM
PostPosted: Thu Sep 21, 2006 8:02 am     Reply with quote

Hello.

I have an application running on an 18F8720 in extended u-controller mode, that uses a large array. I wish to locate that array in external memory available on the board.

There is a temporary problem in that I can't get the external memory interface hardware to work. But I have written custom read/write routines that access it correctly.

I will be demonstrating the system next week.

My questions are
1/ assuming I get the in-built external memory interface to work in time, can I use '#locate' to position the array in external RAM and can the elements be read/written in the normal way of accessing an array?

2/ assuming I don't get the in-built external memory interface to work in time, is there anyway of patching in my custom I/O routines to allow the array to be defined?

The objective of the last question (and to some extent the first) is to minimize the amount of code re-writing/dis-carding needed once the problem is solved.

Regards,

Steve Jaglowski
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Sep 21, 2006 1:00 pm     Reply with quote

1. I think you have to post a test program (very small -- 15 lines)
that uses #locate in the way you've suggested, and then we'll
look at the .LST file to confirm if it's working.


2. I'm not sure what you're asking for. We have no knowledge
of your custom i/o routines. Are you asking if you can temporarily
substitute a fast external eeprom (such as FRAM from Ramtron)
and then use 'typemod' to have it mimic a ram array ?
s.jaglowski



Joined: 14 Nov 2005
Posts: 14

View user's profile Send private message

PostPosted: Sun Sep 24, 2006 8:07 am     Reply with quote

Sorry. Please excuse my ignorance.

My back-ground is hardware and whilst I can very competently programme the hardware I design, there are things I don't understand about the way compilers work and behave.

I suppose my I'm trying to understand how CCS has implemented its' code.

I know I can use #locate and arrays to place a particular array in internal RAM on a PIC.

I also know I can read and write to external memory using the appropriate setup_external_memory(), read_external_memory() and write_external_memory() instructions. So I know the compiler generates internal code to facilitate this.

But I don't know if the CCS compiler allows me to place an array in external memory and access that array using standard array access methods. Normally I would've written the code and tried it, but I can't yet get the external memory interface working.

I'm currently creating custom routines to acheive all this but if it can be done using standard methods, I need to go back at some point and re-write things. This may influence the way I create my 'temporary' code, to save me time on the re-write.

If on the other hand locating arrays in external RAM can't be done then I won't have to go back anyway, because I don't really have a problem. The only re-writes I have is to substitue my current external read/write routines with the standard ones.

Hope I've made myself a little clearer.

Regards,

Steve Jag
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Sep 24, 2006 2:36 pm     Reply with quote

The reason I asked for a test program is because I'm not familiar with
the external memory mode of this PIC. I don't have the time to spend,
to do all the work of researching and fixing this problem. It might take
an hour, and I just don't have the time. I could do a few minutes, but
not all of it.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group