# Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

### Protego

# PIC24FJ32MC10X -- Family Data Sheet

- 1
- 2
…
- 58
- 59
- 60
- 61
- 62
…
- 349
- 350

PIC24FJ16MC101/102 AND PIC24FJ32MC101/102/104
DS39997C-page 60 Preliminary © 2011-2012 Microchip Technology Inc.
5.2 RTSP Operation
The PIC24FJ16MC101/102 and PIC24FJ32MC101/
102/104 Flash program memory array is organized into
rows of 64 instructions or 192 bytes. RTSP allows the
user application to erase a page of memory, which con-
sists of eight rows (512 instructions); and to program
one word. Table 26-12 shows typical erase and pro-
gramming times. The 8-row erase pages are edge-
aligned from the beginning of program memory, on
boundaries of 1536 bytes.
5.3 Programming Operations
A complete programming sequence is necessary for
programming or erasing the internal Flash in RTSP
mode. The processor stalls (waits) until the operation is
finished.
The programming time depends on the FRC accuracy
(see Table 26-18) and the value of the FRC Oscillator
Tuning register (see Register 8-3). Use the following
formula to calculate the minimum and maximum values
for the Word Write Time and Page Erase Time (see
Table 26-12).
EQUATION 5-1: PROGRAMMING TIME
For example, if the device is operating at +125°C, the
FRC accuracy will be ±2%. If the TUN<5:0> bits (see
Register 8-3) are set to ‘b000000, the minimum row
write time is equal to Equation 5-2.
EQUATION 5-2: MINIMUM ROW WRITE
TIME
The maximum row write time is equal to Equation 5-3.
EQUATION 5-3: MAXIMUM ROW WRITE
TIME
Setting the WR bit (NVMCON<15>) starts the opera-
tion, and the WR bit is automatically cleared when the
operation is finished.
5.3.1 PROGRAMMING ALGORITHM FOR
FLASH PROGRAM MEMORY
Programmers can program one word (24 bits) of
program Flash memory at a time. To do this, it is
necessary to erase the 8-row erase page that contains
the desired address of the location the user wants to
change.
For protection against accidental operations, the write
initiate sequence for NVMKEY must be used to allow
any erase or program operation to proceed. After the
programming command has been executed, the user
application must wait for the programming time until
programming is complete. The two instructions
following the start of the programming sequence
should be NOPs.
Refer to Section 4. “Program Memory” (DS39715) in
the “PIC24F Family Reference Manual” for details and
codes examples on programming using RTSP.
5.4 Control Registers
Two SFRs are used to read and write the program
Flash memory: NVMCON and NVMKEY.
The NVMCON register (Register 5-1) controls which
blocks are to be erased, which memory type is to be
programmed, and the start of the programming cycle.
NVMKEY is a write-only register that is used for write
protection. To start a programming or erase sequence,
the user application must consecutively write 0x55 and
0xAA to the NVMKEY register. Refer to Section 5.3
“Programming Operations” for further details.
T
7.37 MHz FRC Accuracy( )% FRC Tuning( )%××
--------------------------------------------------------------------------------------------------------------------------
T
RW
355 Cycles
7.37 MHz 1 0.02+( ) 1 0.00375–( )××
----------------------------------------------------------------------------------------------
47.4 μ s==
T
RW
355 Cycles
7.37 MHz 1 0.02–( ) 1 0.00375–( )××
----------------------------------------------------------------------------------------------
49.3 μ s==
Note: Performing a page erase operation on the
last page of program memory will clear the
Flash Configuration words, thereby
enabling code protection as a result.
Therefore, users should avoid performing
page erase operations on the last page of
program memory.

- 1
- 2
…
- 58
- 59
- 60
- 61
- 62
…
- 349
- 350