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

Large Array
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
AK



Joined: 20 Apr 2004
Posts: 33

View user's profile Send private message

Large Array
PostPosted: Fri Mar 31, 2006 12:10 pm     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Mar 31, 2006 12:20 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 31, 2006 12:49 pm     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Mar 31, 2006 1:00 pm     Reply with quote

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

View user's profile Send private message Send e-mail

RE:
PostPosted: Sat Apr 01, 2006 10:18 pm     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

Re: RE:
PostPosted: Sun Apr 02, 2006 12:20 pm     Reply with quote

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 !! Shocked

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 !! Very Happy (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

View user's profile Send private message

PostPosted: Thu Apr 06, 2006 11:00 am     Reply with quote

Is there a specific FRAM chip that you would recommend for my application?
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Thu Apr 06, 2006 11:42 am     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Apr 06, 2006 12:29 pm     Reply with quote

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. Embarassed

Some parts are 5volt only, some also have 3volt versions. Confused

They have both SPI and I2C devices, although not all memory sizes are available on both formats. Confused
AK



Joined: 20 Apr 2004
Posts: 33

View user's profile Send private message

PostPosted: Thu Apr 06, 2006 12:37 pm     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Apr 06, 2006 12:57 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Apr 06, 2006 1:00 pm     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Apr 06, 2006 1:24 pm     Reply with quote

Should give you plenty of room for expansion.

Just note that the FM24C256 has *no* 3volt alternative, unlike the SPI version Confused
AK



Joined: 20 Apr 2004
Posts: 33

View user's profile Send private message

PostPosted: Fri Apr 07, 2006 5:10 am     Reply with quote

Thanks for the help
Guest








PostPosted: Thu Apr 13, 2006 6:50 am     Reply with quote

How will the FM24C256 have enough memory for this application? It has only 256 kbit.. I think he picked the wrong chip.

Bill
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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