9.5.6.2.1 Write SRAM Using Direct Writes
This SRAM write method can be used if it is required to store a different device configuration to EEPROM without disrupting the current operational state of the device. This method requires the SRAM/EEPROM map data to be already generated, which can be done by the TICS Pro software. The SRAM can be directly written without modifying the active configuration registers through the following sequence:
- Write the most significant 5 bits of the SRAM address to R169 (MEMADR byte 1) and write the least significant 8 bits of the SRAM address to R170 (MEMADR byte 0).
- Write the SRAM data byte to R172 (RAMDAT byte) for the SRAM address specified in the previous step in the same register transaction.
- Any additional write transfers in same transaction will cause the SRAM address pointer to be auto-incremented and a subsequent write will take place at the next SRAM address.
- Byte or Block write transfers to R172 can be used to write the entire SRAM map sequentially from Byte 0 to 508 (509 bytes total).
- Alternatively, it is valid to write R169 and R170 before each write to R172 to set the memory address explicitly (that is, bypass the memory pointer auto-increment).
- Access to the SRAM will terminate at the end of current write transaction. Note that reading the RAMDAT register will also auto-increment the memory address pointer.