Electronic Components Datasheet Search
  English  ▼

X  

PIC16F15213 Datasheet(PDF) 116 Page - Microchip Technology

Part # PIC16F15213
Description  PIC16F15213/14/23/24/43/44 Low Pin Count Microcontrollers
PDF  439 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC16F15213 Datasheet(HTML) 116 Page - Microchip Technology

Back Button PIC16F15213 Datasheet HTML 112Page - Microchip Technology PIC16F15213 Datasheet HTML 113Page - Microchip Technology PIC16F15213 Datasheet HTML 114Page - Microchip Technology PIC16F15213 Datasheet HTML 115Page - Microchip Technology PIC16F15213 Datasheet HTML 116Page - Microchip Technology PIC16F15213 Datasheet HTML 117Page - Microchip Technology PIC16F15213 Datasheet HTML 118Page - Microchip Technology PIC16F15213 Datasheet HTML 119Page - Microchip Technology PIC16F15213 Datasheet HTML 120Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 116 / 439 page
background image
Note: 
1.
See the NVM Unlock Sequence section.
Example 15-4. Writing to Program Flash Memory
INTCONbits.GIE = 0;
// Disable interrupts
// PFM row must be erased before writes can occur
NVMCON1bits.NVMREGS = 0;
// Point to PFM
NVMADR = PFMStartAddress;
// Must start at beginning of PFM row
NVMCON1bits.FREE = 1;
// Specify an erase operation
NVMCON1bits.WREN = 1;
// Allow erase cycle
// Required unlock sequence
NVMCON2 = 0x55;
NVMCON2 = 0xAA;
NVMCON1bits.WR = 1;
NVMCON1bits.LWLO = 1;
// Load write latches
// Write to the data latches
for (i = 0; i < PFM_ROW_SIZE; i++)
{
NVMADR = PFMStartAddress;
// Load starting address
NVMDAT = PFM_WRITE_DATA;
// Load data
// Required unlock sequence
NVMCON2 = 0x55;
NVMCON2 = 0xAA;
NVMCON1bits.WR = 1;
PFMStartAddress++;
// Increment address
if(i = (PFM_ROW_SIZE - 1))
// All latches loaded?
{
NVMCON1bits.LWLO = 0;
// Start PFM write
}
}
NVMCON1bits.WREN = 0;
// Disable writes
INTCONbits.GIE = 1;
// Enable interrupts
15.1.2.5 Modifying Flash Program Memory
When modifying existing data in a program memory, data within the memory row must be read and saved in a RAM
image. Program memory is modified using the following steps:
1.
Load the starting address of the row to be modified.
2.
Read the existing data from the row into a RAM image.
3.
Modify the RAM image to contain the new data to be written into program memory.
4.
Load the starting address of the row to be rewritten.
5.
Erase the program memory row.
6.
Load the write latches with data from the RAM image.
7.
Initiate a programming operation.
PIC16F15213/14/23/24/43/44
NVM - Nonvolatile Memory Control
© 2020-2022 Microchip Technology Inc.
and its subsidiaries
Data Sheet
DS40002195E-page 116



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com