View previous topic :: View next topic |
Author |
Message |
horkesley
Joined: 20 Feb 2007 Posts: 48 Location: Essex UK
|
External RAM |
Posted: Thu Dec 27, 2007 5:44 am |
|
|
Hi,
Is there a way of adding external RAM to a PIC that appears as an extension to the internal RAM to the PIC and compiler.
Effectively, so the PIC appears to have a larger RAM.
Regards,
Horkesley _________________ Horkesley Electronics Limited |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Thu Dec 27, 2007 9:19 am |
|
|
Check the manual for the custom qualifier Addressmod, this is the replacement for the Typemod qualifier of the v3 compiler. With this qualifier you can define a memory range in a 24-bit wide memory space and specify the read and write functions to be used. You can add a mixture of external memory types (ROM, RAM, EEPROM, FRAM, etc) and depending on the address the compiler will automatically call your defined read and write functions. Variables in these external memories are accessed like normal variables, i.e. no special C syntax is required.
For an example see the manual chapter 'Non-RAM Data Definitions', page 41.
The addressmod qualifier is new and not many people have used it yet so you might stumble upon some 'unspecified' behaviour...
Note that the typemod qualifier had the limitation of a 24-bit address and 16-bit range, most likely this also applies to the addressmod qualifier. See also http://www.ccsinfo.com/forum/viewtopic.php?t=26157. |
|
|
guest345 Guest
|
|
Posted: Sun Oct 11, 2009 5:13 am |
|
|
Addressmod or type mod are not working properly with arrays at version 4.093.
I'm creating a char array on fram, and I'm trying to change one element of this array but compiler changing 2 bytes from array. Only 16 bit variables writing normal. 32 or 8 bit array variables are sux. Reading working good for all. And any 8bit variables or 16bits are working good. But arrays are problematic. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Sun Oct 11, 2009 4:19 pm |
|
|
I've been trying to use addressmod and found it to be quirky.
And I'm just using it to assign blocks of ram so I can place stuff where I want it in memory.
Otherwise, there isn't a way to add RAM and make it look like normal PIC RAM without something like addressmod and have it be "transparent" to the compiler.
Cheers,
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
|