PIC16F57-E/SP Microchip Technology, PIC16F57-E/SP Datasheet - Page 12

IC MCU FLASH 2KX12 28-DIP

PIC16F57-E/SP

Manufacturer Part Number
PIC16F57-E/SP
Description
IC MCU FLASH 2KX12 28-DIP
Manufacturer
Microchip Technology
Series
PIC® 16Fr
Datasheets

Specifications of PIC16F57-E/SP

Core Processor
PIC
Core Size
8-Bit
Speed
20MHz
Peripherals
POR, WDT
Number Of I /o
20
Program Memory Size
3KB (2K x 12)
Program Memory Type
FLASH
Ram Size
72 x 8
Voltage - Supply (vcc/vdd)
2 V ~ 5.5 V
Oscillator Type
External
Operating Temperature
-40°C ~ 125°C
Package / Case
28-DIP (0.300", 7.62mm)
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
Data Converters
-
Connectivity
-
PIC16F57
4.0
For the PIC16F57, once code protection is enabled, all
program memory locations above 0x3F read all ‘0’s.
Program memory locations 0x00-0x3F are always
unprotected. The ID locations and the Configuration
Word read out in an unprotected fashion. It is possible
to program the ID locations and the Configuration Word
once CP is enabled.
4.1
It is recommended that the following procedure be
performed before any other programming is attempted.
It is also possible to turn code protection off (CP = 1)
using this procedure. However, all data within the
program memory will be erased when this
procedure is executed, and thus, the security of the
code is not compromised.
To disable code-protect:
a)
b)
c)
4.2
TABLE 4-1:
DS41208C-page 12
PIC16F57
Legend: CFGW = Configuration Word
Note 1:
To allow portability of code, the programmer is
required to read the Configuration Word and ID
locations from the hex file when loading the hex file.
If Configuration Word information was not present in
the hex file, then a simple warning message may be
issued. Similarly, while saving a hex file, Configura-
tion Word and ID information must be included. An
option to not include this information may be
provided.
Microchip Technology Incorporated feels strongly
that this feature is important for the benefit of the end
customer.
Device
Enter Programming mode
Execute Bulk Erase Program Memory (001001)
Wait T
CODE PROTECTION
Disabling Code Protection
Embedding Configuration Word
and ID Information in the Hex File
ERA
SUM[a:b] = [Sum of locations a to b inclusive]
SUM_ID = ID locations masked by 0xF then made into a 16-bit value with ID0 as the Most Significant
nibble.
For example, ID0 = 0x1, ID1 = 0x2, ID2 = 0x3, ID3 = 0x4, then SUM_ID = 0x1234.
*Checksum = [Sum of all the individual expressions] modulo [0xFFFF]
+ = Addition
& = Bitwise AND
Checksum shown assumes that SUM_ID contains the unprotected checksum.
Protect
CHECKSUM COMPUTATIONS
Code
OFF
ON
SUM[0x000:0x7FF] + CFGW & 0x00F + 0xFF0
SUM[0x000:0x3F] + CFGW & 0x00F + 0xFF0 + SUM_ID
Preliminary
(1)
Checksum*
4.3
4.3.1
Checksum is calculated by reading the contents of the
PIC16F57 memory locations and adding up the
opcodes up to the maximum user addressable location,
(e.g., 0x7FF for the PIC16F57). Any carry bits exceed-
ing 16 bits are neglected. Finally, the Configuration
Word (appropriately masked) is added to the check-
sum. Checksum computation for the PIC16F57 is
shown in Table 4-1.
The checksum is calculated by summing the following:
• The contents of all program memory locations
• The Configuration Word, appropriately masked
• Masked ID locations (when applicable)
The Least Significant 16 bits of this sum is the
checksum.
The following table describes how to calculate the
checksum for each device.
Note:
Checksum Computation
CHECKSUM
The
depending on the code-protect setting.
The Configuration Word and ID locations
can always be read regardless of the
code-protect setting.
checksum
© 2007 Microchip Technology Inc.
0x07FF
0x17B6
Blank
Value
calculation
0x723 at 0
and Max
Address
0xFD22
0xF647
differs

Related parts for PIC16F57-E/SP