![Maxim Integrated MAX32660 Скачать руководство пользователя страница 53](http://html1.mh-extra.com/html/maxim-integrated/max32660/max32660_user-manual_1744484053.webp)
MAX32660 User Guide
Maxim Integrated
Page 53 of 195
5.3.4
Flash Write
Perform the following steps to write to the internal flash memory:
1.
If desired, enable Flash Controller interrupts by setting the
.access_fail_ie
and
.done_ie
bits.
2.
Set the write field,
width
3.
Set the
register to a valid target address. Reference
4.
Set the data register or registers.
5.
For 32-bit write width, set
6.
For 128-bit write width, set
, and
is the most significant word and
is the least significant word.
7.
Set
.unlock
to 0x2 to unlock the internal flash.
8.
Read the
.busy
bit until it returns 0.
9.
Start the flash write, set
.write
to 1 and this field is automatically cleared by the Flash Controller when
the write operation is finished.
10.
.done
is set by hardware when the write completes and if an error occurred, the
.access_fail
flag
is set. These bits generate a flash IRQ if the interrupt enable bits are set.
5.3.5
Page Erase
Perform the following to erase a page of internal flash memory:
1.
If desired, enable Flash Controller interrupts by setting the
.access_fail_ie
and
.done_ie
bits.
2.
Set the
register to a page address to erase.
[12:0] are ignored by the Flash Controller to
ensure the address is page aligned. Refer to Table 5-3 for the valid page aligned addresses for the internal flash
memory.
3.
Set
.unlock
to 0x2 to unlock the internal flash.
4.
Read the
.busy
bit until it returns 0.
5.
Set
.erase_code
to 0x55 for page erase.
6.
Set
.page_erase
to 1 to start the page erase operation.
7.
.busy
bit is set by the Flash Controller while the page erase is in progress and the
.page_erase
.busy
are cleared by the Flash Controller when the page erase is complete.
8.
.done
is set by hardware when the page erase completes and if an error occurred, the
.access_fail
flag is set. These bits generate a flash IRQ if the interrupt enable bits are set.
Table 5-3: Page Boundary Address Range for Page Erase Operations
FLC_ADDR[31:0]
Bit Number 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Page Aligned
Address
0 0 0 0 0 0 0 0 0 0 0 0 0 0 x x x x x 0 0 0 0 0 0 0 0 0 0 0 0 0
Содержание MAX32660
Страница 4: ...MAX32660 User Guide Maxim Integrated Page 4 of 195 8 UART 84 9 Real Time Clock RTC 96 10 Timers 105...
Страница 7: ...MAX32660 User Guide Maxim Integrated Page 7 of 195 15 Trademarks 195 16 Revision History 195...
Страница 14: ...MAX32660 User Guide Maxim Integrated Page 14 of 195 Figure 2 1 MAX32660 High Level Block Diagram...