Pages: [1]   Go Down
Author Topic: SPI Sram with pointers?  (Read 1078 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I recently received some 23LC1024 chips. They are 5V 1Mbit spi sram chips that I am using with an Arduino 328p. I found a library online that is pretty good http://code.google.com/p/arms22/downloads/detail?name=SPISRAM-001.zip (which I modified for 24 bit addressing). This library is nice in that it lets you address the memory as if it were an array, like myarray[address]=#, however, I was wondering is there another programming technique that I could use to work with the sram as a pointer? Could I overload operators in the library to simulate a pointer type interface? I have read that other Atmel chips have the ability to address external memory as if it were internal, but it doesn't look like this is an option with the 328p. Am I wrong, is it possible to use the XYZ registers to address the memory like a pointer?  

Thanks,

-diesel
« Last Edit: February 18, 2013, 07:31:17 pm by diesel » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Pointers and arrays are nearly interchangeable. Perhaps instead of explaining how you want to do something (using pointers), you should explain what the problem is that you are trying to solve.

You should also fix your original post and properly post the link so that it actually works.

Theuseofthespacekey(andthereturnkey)isimportant.
Logged

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2066
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Addressmod Capability To Create User Defined Address Spaces In Any Kind Of Memory Device

Part of the IEEE Embedded C standard (ISO/IEC TR 18037), addressmod allows you to create custom qualifiers to create variables in any kind of memory device. The identifier can be used with any data types, including structures, unions, arrays, and pointers. Review the following example, which uses addressmod to create variables that are located in external memory:
From CCS compiler page. It works (bug in latest versions). Would be great to have this feature with arduino as well. . smiley-wink
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Paul,

I am trying to use the sram with the uip network stack, which uses an a pointer to an internal sram array to compose and parse packets. I would like to use external sram instead.

Pito,

Thanks for the info, sounds interesting, the examples are what I am looking for, but I am not sure how to implement that. Yes, I agree, that would be great to have in the Arduino environment.

Thanks,

-diesel
Logged

Pages: [1]   Go Up
Jump to: