10.07.2015 Views

pic24fj128ga010 family - Microchip

pic24fj128ga010 family - Microchip

pic24fj128ga010 family - Microchip

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PIC24FJ128GA010 FAMILY4.2 RTSP OperationThe PIC24F Flash program memory array is organizedinto rows of 64 instructions or 192 bytes. RTSP allowsthe user to erase blocks of eight rows (512 instructions)at a time and to program one row at a time. It is alsopossible to program single words.The 8-row erase blocks and single row write blocks areedge-aligned, from the beginning of program memory,on boundaries of 1536 bytes and 192 bytes,respectively.When data is written to program memory using TBLWTinstructions, the data is not written directly to memory.Instead, data written using table writes is stored inholding latches until the programming sequence isexecuted.Any number of TBLWT instructions can be executedand a write will be successfully performed. However, 64TBLWT instructions are required to write the full row ofmemory.To ensure that no data is corrupted during a write, anyunused addresses should be programmed withFFFFFFh. This is because the holding latches reset toan unknown state, so if the addresses are left in theReset state, they may overwrite the locations on rowswhich were not rewritten.The basic sequence for RTSP programming is to set upa Table Pointer, then do a series of TBLWT instructionsto load the buffers. Programming is performed bysetting the control bits in the NVMCON register.Data can be loaded in any order and the holding registerscan be written to multiple times before performinga write operation. Subsequent writes, however, willwipe out any previous writes.Note:Writing to a location multiple times withouterasing is not recommended.All of the table write operations are single-word writes(2 instruction cycles), because only the buffers arewritten. A programming cycle is required forprogramming each row4.4 Enhanced In-Circuit SerialProgrammingEnhanced In-Circuit Serial Programming uses an onboardbootloader, known as the program executive, tomanage the programming process. Using an SPI dataframe format, the program executive can erase,program and verify program memory. See the deviceprogramming specification for more information onEnhanced ICSP4.5 Control RegistersThere are two SFRs used to read and write theprogram Flash memory: NVMCON and NVMKEY.The NVMCON register (Register 4-1) controls whichblocks are to be erased, which memory type is to beprogrammed and the start of the programming cycle.NVMKEY is a write-only register that is used for writeprotection. To start a programming or erase sequence,the user must consecutively write 55h and AAh to theNVMKEY register. Refer to Section 4.6 “ProgrammingOperations” for further details.4.6 Programming OperationsA complete programming sequence is necessary forprogramming or erasing the internal Flash in RTSPmode. During a programming or an erase operation,the processor stalls (waits) until the operation isfinished. Setting the WR bit (NVMCON) starts theoperation, and the WR bit is automatically clearedwhen the operation is finished.Configuration Word values are stored in the last twolocations of program memory. Performing a page eraseoperation on the last page of program memory clearsthese values and enables code protection. As a result,avoid performing page erase operations on the lastpage of program memory.4.3 JTAG OperationThe PIC24F <strong>family</strong> supports JTAG programming andboundary scan. Boundary scan can improve the manufacturingprocess by verifying pin to PCB connectivity.Programming can be performed with industry standardJTAG programmers supporting Serial Vector Format(SVF).DS39747E-page 48© 2009 <strong>Microchip</strong> Technology Inc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!