View previous topic :: View next topic |
Author |
Message |
AK
Joined: 20 Apr 2004 Posts: 33
|
Large Array |
Posted: Fri Mar 31, 2006 12:10 pm |
|
|
Hello,
I'm developing an instrument that logs user input in 2 seperate arrays that will be two-dimensional char arrays (appromite size [650][8]). Can this be done without using external memory? What would be the best way to do this? Is there any PIC DIP chips that I can use to do this?
Thanks,
AK |
|
|
mpfj
Joined: 09 Sep 2003 Posts: 95 Location: UK
|
|
Posted: Fri Mar 31, 2006 12:20 pm |
|
|
Basically, no.
You need 2 x 650 x 8 = 10,400 bytes.
The biggest RAM size in any currently available PIC is 3968 bytes.
You will have to use some external storage. If speed isn't too high, I would suggest Ramtron's FRAM devices. |
|
|
AK
Joined: 20 Apr 2004 Posts: 33
|
|
Posted: Fri Mar 31, 2006 12:49 pm |
|
|
Thanks for the input. Is there any sample PIC code to interface an FRAM chip?
AK |
|
|
mpfj
Joined: 09 Sep 2003 Posts: 95 Location: UK
|
|
Posted: Fri Mar 31, 2006 1:00 pm |
|
|
It just uses standard I2C or SPI as per most serial eeprom devices.
See the EX_EXTEE.C example. |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE: |
Posted: Sat Apr 01, 2006 10:18 pm |
|
|
Hi,
You could also use an EEPROM, Microchip has several of them, both I2C and spi..eg.- 24LC256 , 24LC512 etc.
thanks
arunb |
|
|
mpfj
Joined: 09 Sep 2003 Posts: 95 Location: UK
|
Re: RE: |
Posted: Sun Apr 02, 2006 12:20 pm |
|
|
arunb wrote: | You could also use an EEPROM |
I'd be wary about using EEPROM technology for RAM replacement.
The endurance for e.g. Microchip's devices is only 1,000,000 E/W cycles ... if you wrote your data once per second (which would be quite slow for RAM), the device would begin to fail after about 11.5 days !!
The FRAM technology has an "unlimited" lifetime ... their mathematical model reckons about 1E16 write cycles. At this rate, writing your data once per second, the device would last about 317 million years !! (Even if it only last 1 millionth of that, who cares !?!)
Furthermore, EEPROMs require an erase cycle before writing your data, FRAM does not, so FRAM is also *much* faster. |
|
|
AK
Joined: 20 Apr 2004 Posts: 33
|
|
Posted: Thu Apr 06, 2006 11:00 am |
|
|
Is there a specific FRAM chip that you would recommend for my application? |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Thu Apr 06, 2006 11:42 am |
|
|
I've been playing with a ramtron FM24C64 for the past couple of weeks. If you've ever used a serial EEPROM, this thing is a drop-in replacement. It works well, and it's very nice not having to worry about the very slow write cycle common with ordinary eeproms.
As for recommendations, the simple answer is to get one large enough for your application. If you need a DIP package for prototyping/playing it seems that ramtron no longer makes most of their serial FRAMs in DIP packages - but Newark still had plenty in stock. |
|
|
mpfj
Joined: 09 Sep 2003 Posts: 95 Location: UK
|
|
Posted: Thu Apr 06, 2006 12:29 pm |
|
|
AK wrote: | Is there a specific FRAM chip that you would recommend for my application? |
Check the Ramtron specs carefully against your requirements as I've been caught out before.
Some parts are 5volt only, some also have 3volt versions.
They have both SPI and I2C devices, although not all memory sizes are available on both formats. |
|
|
AK
Joined: 20 Apr 2004 Posts: 33
|
|
Posted: Thu Apr 06, 2006 12:37 pm |
|
|
Will I be able to use a single chip? Sorry, I don't have much experience with external memory. Thanks |
|
|
mpfj
Joined: 09 Sep 2003 Posts: 95 Location: UK
|
|
Posted: Thu Apr 06, 2006 12:57 pm |
|
|
Almost certainly, yes.
Any PIC device containing an MSSP module can support either SPI or I2C.
The difference between SPI and I2C comes down to number of pins required to communicate, speed and power requirements.
I2C
2 wire system (clock and data)
1MHz max bus speed
current ~ 1mA
SPI
3 or 4 wire system (clock, data in, data out, chip select (only in multi-chip setups .. i.e. 2 or more SPI memory devices))
25MHz max bus speed
current ~ 3 to 10mA
Since SPI has seperate data lines, it is bi-directional, which is why is can run faster.
So your choice of device rests on your requirements, i.e. How often is your instrument having to log user input ? How much power can you spare ? Which PIC device are you using ? ... etc ...
Check the Ramtron datasheets, and then get some samples (via the Ramtron website). |
|
|
AK
Joined: 20 Apr 2004 Posts: 33
|
|
Posted: Thu Apr 06, 2006 1:00 pm |
|
|
Thanks for the help. After looking at the parts on the website, I believe the FM24C256 will work for my specs (see first post). Do you see any problems with this? |
|
|
mpfj
Joined: 09 Sep 2003 Posts: 95 Location: UK
|
|
Posted: Thu Apr 06, 2006 1:24 pm |
|
|
Should give you plenty of room for expansion.
Just note that the FM24C256 has *no* 3volt alternative, unlike the SPI version |
|
|
AK
Joined: 20 Apr 2004 Posts: 33
|
|
Posted: Fri Apr 07, 2006 5:10 am |
|
|
Thanks for the help |
|
|
Guest
|
|
Posted: Thu Apr 13, 2006 6:50 am |
|
|
How will the FM24C256 have enough memory for this application? It has only 256 kbit.. I think he picked the wrong chip.
Bill |
|
|
|