PDA

View Full Version : external Memory



jerryf
- 25th November 2008, 14:11
I need a large amount of nonvolital memory to store data, how would I address a external Flash Memory Board (from futerlec) in picbasic.
What is the best and approach to expanding nonvolital memory flash,eeprom,sd card.
Thanks Jerry

Hans Dampf
- 26th November 2008, 17:45
Hi Jerry

Have you checked using F-RAM Memory from RAMTRON? They have non-volatile memory that can be written much faster than EEPROM. Their devices range to 2 Mbit an can be interfaced by SPI with clock speeds up to 40 MHz. See here (scroll down to SPI Interface):
http://www.ramtron.com/products/nonvolatile-memory/serial.aspx

You can buy it at resonable prices from here:
http://www.farnell.com/

Regards,
Hans

jerryf
- 27th November 2008, 00:54
Hanks,
I have searched this forum for SPI Interface and found nothing. I note from threads I read that there is real I2C, that is is a all bit banging. I saw you note to use SPI. How would I read and write from this device with picbasic.
It appears the address line sets the memory address to read and the data is presented on the output lines. how is this acomplished in PICBASIC PRO.
Thanks Jerry

jerryf
- 27th November 2008, 00:55
The above should read NO real I2C
Jerry

mackrackit
- 27th November 2008, 01:45
http://www.picbasic.co.uk/forum/showthread.php?t=437
???

Hans Dampf
- 29th November 2008, 00:47
Hello Jerry

The reason I suggested using an F-RAM with SPI instead of I2C is because the SPI parts offer more memory space (2 Mb as opposed to 512 Kb) and faster communication (up to 40 MHz opposed to 1 MHz). This may be advantageous when handling large amounts of data.

Note that unlike serial EEPROMs, the F-RAMs can perform sequential writes at bus speed without pause between pages. So the overall write data rate is proportional to bus speed.

Larger PICs have a built-in master synchronous serial port (MSSP) hardware block which could be employed to take advantage of the faster SPI F-RAMs. To my knowledge, the MSSP is not directly supported in PBP, unfortunately. So you would have to look in the PIC's datasheet how to deal with the MSSP related registers and write some dedicated code yourself.

Lukily, as I see from the datasheet of the RAMTRON FM25640 F-RAM, the serial interface is only half-duplex (see timing diagrams of the read commands). Data flow is either on the serial input (SI), or on serial output (SO), but not on both lines at the same time. Thus you can use the PBP commands SHIFTOUT and SHIFTIN to handle the F-RAM.

I am about to include the F-RAM device mentioned above in my next PIC project. If desired I will post some related code here once it is done, but you will have to wait until end of this year.

Regards,
Hans

rmteo
- 29th November 2008, 02:06
Depending on your application requirements, an alternative may be a 2MBit Atmel serial SPI dataflash such as the AT45DB021D-SH-B here:
http://www.mouser.com/Search/ProductDetail.aspx?qs=sbcp%2f4gpy0%252bdOyoGW76NxQ %3d%3d

Cost is about 1/30th. (less than $1) that of the F-RAM equivalent.