View previous topic :: View next topic |
Author |
Message |
Guest
|
storing massive amount of data |
Posted: Wed Nov 23, 2005 11:00 am |
|
|
hi,
my code needs to access big size arrays, say one of them has nearly 700 elements, which are used to plot some graphics on LCD. I am finding trouble storing them coz' I am defining these arrays as constant which means they are stored in flash memory ( I am using 18f) but at the mean time I am running out of rom!
I am considering taking these big arrays out of rom and store them somewhere else. I considered eeprom but speed is demanding for the code which means refleshing the LCD with different bit maps in a high speed. Storing in eeprom would mean loading from eeprom which reduces the speed.
Any good thoughts at all? |
|
|
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
|
|
Posted: Wed Nov 23, 2005 11:37 am |
|
|
How many bytes do you need to store? How large is your code without the Arrays? What chip are you using?
Log into the forum. |
|
|
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Wed Nov 23, 2005 6:05 pm |
|
|
If you have exhausted the choice of 18F PICs (such as those with 256K program memory) you might want to look at MMC/SD. This gives you access to several GB per card. Because you do not need PC compatibility (do not need FAT file system), reading and writing is straight forward and at high speed. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
ye
Joined: 11 May 2005 Posts: 57 Location: london
|
|
Posted: Thu Nov 24, 2005 3:49 am |
|
|
Sorry neutone, now I log on.
I am using 18f8722 and so far I've used 60% of rom. I've roughly estimated that without all the constant arrays, there will be a reduction of nearly 20% - 25% of the entire rom space.
asmallri, I did think about MMC and actually I have some modules of code implementing MMC in hand. However the problem is not about the size of external memory, it's about the speed of loading and saving instead.
As I stressed all these templates are used as bit maps on LCD which means the speed is pretty critical.
I don't know in which way I could store these big arrays while keeping a good speed......
Cheers |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Thu Nov 24, 2005 9:33 am |
|
|
ye wrote: |
asmallri, I did think about MMC and actually I have some modules of code implementing MMC in hand. However the problem is not about the size of external memory, it's about the speed of loading and saving instead.
As I stressed all these templates are used as bit maps on LCD which means the speed is pretty critical.
I don't know in which way I could store these big arrays while keeping a good speed......
Cheers |
A typical SD will run with a SPI bus speed of 25MHz, a typical MMC will run with a 20MHz SPI bus. Current generation SD and MMC cards are 10 to 50 times faster than the original cards, however, even at the speed of the original product you will not notice the affect of access speed as the LCD refresh rate will be slower than the rate you can access data. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
ye
Joined: 11 May 2005 Posts: 57 Location: london
|
|
Posted: Thu Nov 24, 2005 9:51 am |
|
|
what about storing them in internal rom using #rom or external eeprom, considering the speed again? |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Thu Nov 24, 2005 3:10 pm |
|
|
Retrieval is much faster than storage for all these technologies.
internal rom and internal EEPROM are the fastest and are effectively equal in speed.
Other methods are slower because of the media access mechanisms and bus access speeds. For example, if you are using an external EEPROM with 1 400K I2C bus then your access speed is limited principly by the bus. A 24LCxx at 1M I2C bus will be ten times slower than a 25LCxx with a 10M SPI bus.
For an equal bus speed, an EEPROM will be faster than a SD Card. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Thu Nov 24, 2005 10:48 pm |
|
|
ye wrote: | what about storing them in internal rom using #rom or external eeprom, considering the speed again? |
I thought you said you were storing them in rom now. |
|
|
ye
Joined: 11 May 2005 Posts: 57 Location: london
|
|
Posted: Fri Nov 25, 2005 4:41 am |
|
|
Thank you guys, I think I have got the answers to this problem which has been haunting me for long.
All the best |
|
|
|