I'm new Arduino user and I'm trying out a SPI protocol to interface a SRAM, specifically, the 23LCV512.
I have found the instructables steps to interface a SRAM using the SPI bus on an Arduino UNO very helpful (http://www.instructables.com/id/Interface-an-SRAM-bus-to-your-arduino/), but there is one point that i would like some explanation for:
In the mem_demo.ino and other various SPI.h code, I have seen variations of the following, however I do not understand why you would have to do this? I think here that we are communicating the right shifting of an input address 16 places along with 8 bits of '1'.
SPI.transfer((uint8_t)(address >> 16) & 0xff);
SPI.transfer((uint8_t)(address >> 8) & 0xff);
SPI.transfer((uint8_t)address);
Commenting these lines out for the write did not effect the writing to the SRAM, but reading caused it to return mostly 0's.
I really appreciate any help iIget, I do not have a lot of experience with memory addresses and electronics, thank you.