Rev. 1.10
40
October 23, 2020
Rev. 1.10
41
October 23, 2020
BC66F5652
2.4GHz RF Transceiver A/D Flash MCU
BC66F5652
2.4GHz RF Transceiver A/D Flash MCU
Flash Memory Write Procedure
After the Flash memory erase/write function has been successfully enabled as the CFWEN bit is set
high, the data to be written into the flash memory can be loaded into the write buffer. The selected
flash memory page data should be erased by properly configuring the IAP control registers before
the data write procedure is executed.
The write buffer size is 32 words, known as a page, whose address is mapped to a specific flash
memory page specified by the memory address bits, FA12~FA5. It is important to ensure that
the page where the write buffer data is located is the same one which the memory address bits,
FA12~FA5, specify.
Flash Memory Consecutive Write Description
The maximum amount of write data is 32 words for each write operation. The write buffer address
will be automatically incremented by one when consecutive write operations are executed. The start
address of a specific page should first be written into the FARL and FARH registers. Then the data
word should first be written into the FD0L register and then the FD0H register. At the same time the
write buffer address will be incremented by one and then the next data word can be written into the
FD0L and FD0H registers for the next address without modifying the address register pair, FARH
and FARL. When the write buffer address reaches the page boundary the address will not be further
incremented but will stop at the last address of the page.
1. Activate the “Flash Memory Erase/Write function enable procedure”. Check the CFWEN bit
value and then execute the erase/write operations if the CFWEN bit is set high. Refer to the “Flash
Memory Erase/Write function enable procedure” for more details.
2. Set the FMOD field to “001” to select the erase operation and set the CLWB bit high to clear the
write buffer. Set the FWT bit high to erase the desired page which is specified by the FARH and
FARL registers and has been tagged address. Wait until the FWT bit goes low.
3. Execute a Blank Check operation using the table read instruction to ensure that the erase operation
has successfully completed.
Go to step 2 if the erase operation is not successful.
Go to step 4 if the erase operation is successful.
4. Set the FMOD field to “000” to select the write operation.
5. Setup the desired start address in the FARH and FARL registers. Write the desired data words
consecutively into the FD0L and FD0H registers within a page as specified by their consecutive
addresses. The maximum written data number is 32 words.
6. Set the FWT bit high to write the data words from the write buffer to the flash memory. Wait until
the FWT bit goes low.
7. Verify the data using the table read instruction to ensure that the write operation has successfully
completed.
If the write operation has not successfully completed, set the CLWB bit high to clear the write
buffer and then
go to step 5.
Go to step 8 if the write operation is successful.
8. Clear the CFWEN bit low to disable the Flash memory erase/write function.