-
Notifications
You must be signed in to change notification settings - Fork 2
SRAMBytes
Arnd edited this page Dec 3, 2016
·
3 revisions
The public SRAMBytes variable is an unsigned 16-bit number that is filled at class instantiation and should not be changed outside of the class.
During class instantiation the actual size of the memory is determined by exploiting the memory wrap-around functionality when writing past the physical end of memory. The value set in SRAMBytes is as follows for the specific models:
Memory Type | Storage Bits | SRAMBytes |
23x640 | 64 kbit | 8192 Bytes |
23x256 | 256 kbit | 32768 Bytes |
23x512 23LCV512 |
512 kbit | 65536 Bytes |
23x1024 23LCV1024 |
1024 kbit | 131072 Bytes |
###Example
const uint8_t CS_PIN = 8; // define the CS/SS Pin used for SPI
MicrochipSRAM sram(CS_PIN); // Instantiate the class
uint16_t availableMemory = sram.SRAMBytes;
Serial.print("Available memory is ");
Serial.print(availableMemory/1024);
Serial.println(" Kb.");