
NUC970 Technical Reference Manual
Publication Release Date: Dec. 15, 2015
- 250 -
Revision V1.30
NUC97
0
T
E
CHNIC
A
L
RE
F
E
RE
N
CE
MA
NUA
L
5.6.6 Software Programming Flow
Enable MTP
Enable MTP IP clock (in CLK_APB)
Write 0x59, 0x16, 0x88 to
MTP_REGLCTL, check REGLCTL(MTP_REGLCTL[0])
show 0x1.
Write 0x1 to
MTP_KEYEN
to enable MTP function.
Read
MTP_STATUS ,
check until
MTPEN
(
MTP_STATUS[0]
)
is set
If
NONPRG
(
MTP_STATUS[2]
) is set, it means MTP enabled and there
’s no any
key programmed. (
PRGCNT
is 0)
If
KEYVALID
(
MTP_STATUS[1]
) is set, it means the latest key programmed to
MTP is enabled. (
PRGCNT
is not 0)
Program MTP
Enable MTP (refer to the Enable MTP flow)
Write 0x2 to
MTP_CTL.
Write 0x60AE to
MTP_PCYCLE (
if PCLK=75Mhz, MTP_PCYCLE=24750
)
Write the 256 bits key to
MTP_KEY0 ~ MTP_KEY7
Write 8 bits user defined data to
MTP_USERDATA.
Write 0x1 to
PSTART (MTP_PSTART[0]).
Check until
PSTART
goes back to 0.
If
PRGFAIL
(
MTP_STATUS[4]
) is set, program operation failed. Otherwise,
program operation successes.
Lock MTP
Enable MTP (refer to the Enable MTP flow)
Write 0x3 to
MTP_CTL
.
Write 0x60AE to
MTP_PCYCLE (
if PCLK=75Mhz, MTP_PCYCLE=24750
).
Write 0x1 to
PSTART (MTP_PSTART[0]).
Check until
PSTART
goes back to 0
Enable MTP (refer to the Enable MTP flow).
If
MTPEN
(
MTP_STATUS[0]
),
KEYVALID
(
MTP_STATUS[1]
), and
LOCKED
(
MTP_STATUS[3]
) are all set, LOCK operation successes. Otherwise, LOCK
operation failed.