SNIU028D February 2016 – September 2020 UCD3138 , UCD3138064 , UCD3138064A , UCD3138128 , UCD3138A , UCD3138A64
Data flash should be written to in 4 byte words. Writing to Data Flash is very simple. Write the key to FLASHILOCK and then just write to the location. It is then necessary to monitor the BUSY bit in order to determine when the write is done. If the RDONLY bit in MFBALR2 is set, it will be necessary to clear it before the write.
On many flashes, it is possible to write multiple times to the same location without an erase, so long as more bits are being cleared. On the Data Flash on the UCD3138 family this is not the case. There is additional correction logic and additional flash bits to permit correction of a single bit error in Data Flash. Trying multiple writes to the same location without an erase in between will have unpredictable results because of this.