Differences Between Address Roll-Over Schemes in F-RAM and nvSRAM Devices Under Write-Protect Settings - KBA88168 | Cypress Semiconductor
Support & Community
Differences Between Address Roll-Over Schemes in F-RAM and nvSRAM Devices Under Write-Protect Settings - KBA88168
Will a roll-over happen when data is written to the last address of an F-RAM? How is it different from an nvSRAM? What happens when the F-RAM has a write-protected block?
When a bulk write is initiated on an F-RAM device, its internal address counter automatically increments to the next memory location after every successful byte write. When the internal address counter reaches the last memory address on the F-RAM device, further auto-increment causes the address counter to roll over to its start address. Thus, further writes overwrite any previously written data.
Consider a 64-Kbit device, which has 8192 locations and requires a 13-bit address to access its 64-Kbit locations. When you start a write operation, and continue writing even after the last memory location (address 0x1FFF), the internal address counter rolls over to the device’s start address (0x0000) and continues to increment from that location. For example, if you start to write from the address 0x1FFC and write eight bytes sequentially, you would write at addresses 0x1FFC, 0x1FFD, 0x1FFE, 0x1FFF, 0x0000, 0x0001, 0x0002, and 0x0003.
However, there exists a difference between nvSRAM and F-RAM devices when a memory block is write-protected (with the block- protect bits BP0 and BP1 setting in the status register).
In an nvSRAM, the address counter continues to increment when the write pointer enters the protected block; however no actual writes happen. Writes resume when the address counter reaches the unprotected block region. Consider an nvSRAM with the upper one-fourth block (addresses 0x1800 to 0x1FFF) write-protected. If a bulk write is initiated at the address 0x1700 and continued into the protected block, data will get written in addresses 0x1700 to 0x17FF, but data written into 0x1800 to 0x1FFF will be lost and further data will be actually written from the address 0x0000 onwards. In other words, the controller should take into account the protected blocks and perform bulk writes only on to unprotected blocks.
On the other hand, in an F-RAM device, when the write pointer increments from the last memory location of an unprotected block, the address increment stops, and consequently, data write stops in the protected memory block. Consider an F-RAM with the upper one-fourth block (addresses 0x1800 to 0x1FFF) write-protected. If a bulk write is initiated at the address 0x1700 and continued into the protected block, data will get written in addresses 0x1700 to 0x17FF. The next data byte will not get written in the address 0x1800. In addition, the address increment stops at the address 0x1800. All the subsequent writes will be lost.