presto_en.pdf - 第37页
Page 37 one device memories (the serial num ber it self directly to the prog ram, the equipment address to the data memory, and the serial number again to ID positio ns in order to be able to read it from a locked device…

Page 36
Fig.22: Mass production
The actual programming can be triggered by clicking the
Program button in the Mass production dialog
window.
The function of this button is identical to the Program all
or Program all except data memory options
depending on the state of the Don't program data
EEPROM checkbox in the Mass production window.
This dialog window also displays a counter of devices
programmed. Depending on the program settings, the
counter can also be displayed in the status bar. For
further information on settings see
Production
Programming Settings
.
The counter displays the number of programmed devices
in both the mass production mode and the standard
mode.
Pressing the Counter reset button zeroes all the mass
production counters. This operation cannot be undone.
The choice "Auto programming" causes that the device is
programmed after it has been connected, the connection
test is done by reading the Device ID.
The programming can be launched by connecting
external power supply (VDD).
When the "Open this form after start" setting is enabled,
the form opens after program start or after project file
open, if it is used.
5.4.3 Serial Numbers
The Serial Numbers function programs the serial number
or another sequence of characters in the selected
memory location.
Fig.23: Serial numbers
Once the serial numbers are activated and their type set
up under Options ➙ Program settings ➙ Serial
numbers, a window with the current serial number opens
offering the possibility to manually write a serial number
in the memory HEX editor, to specify where it should be
written and if the system should proceed to the next
sequential number.
Serial numbers can be:
• Computed
The computed serial numbers must always be written in
the same selected position in the device such as the
code/main memory, data memory or an ID position, for
example. The serial number is always expected to be a
number in decimal or hexadecimal format and may be
coded as a 4-bit combination (one to four characters per
word) or as an ASCII character (one or two ASCII
characters per word). If the code/main memory is used for
Microchip microcontrollers, you can choose RETLW
instructions. Then RETLW instructions are written in the
given address of the code/main memory together with a
parameter corresponding with the serial number.
• TakenfromFile
A single serial number can be distributed in more than

Page 37
one device memories (the serial number itself directly to
the program, the equipment address to the data memory,
and the serial number again to ID positions in order to be
able to read it from a locked device, for example).
Note: A word is understood as one memory position.
Fig.24: Serial number settings
A file for logging the programmed serial numbers can be
selected under Options ➙ Program settings ➙ Serial
numbers.

Page 38
The numbers themselves are logged in case of calculated
serial numbers while their labels are logged in case of
serial numbers taken from a file - see
Format of Files with
Serial Numbers
.
Except for the serial numbers also the date, time and the
result of the programming are writen to the file. For the
devices for which the revision reading is supported, the
revision number is also written to the file.
Format of Files with Serial
Numbers
Files containing definitions of serial numbers are text files
that can easily be created in third-party programs. *.SN or
*.TXT are recommended file extensions.
A serial number record has the following form:
[comment] label: data record, data record, ...,
data record;
Semicolons are obligatory at the end of records.
• Comment is any string containing no colon ':'.
Comments are optional. If a colon cannot be found in
the whole serial number record, the record is ignored
(understood as a comment). It is also possible to write
a comment behind two slashes '//'.
Thisisjustacomment;
//Alsothisisacomment.
• White character is a space, tabulator or end of line
(CR+LF).
• Label is a string identifying the serial number. This
string is compulsory. The label must not contain white
characters, colons or semicolons.
Data Record
A data record consists of an address and data items in a
chain following this address.
Each item can be written in hexadecimal form (e.g. 2100)
or a numeral base in which the number is written in can
be explicitly defined.
For example, b'10101010' means the same as h'AA',
d'170' or just AA. 'A' means d'65' (ASCII character itself).
ExamplerecordforPIC16F628A:
2100 05 55 54 means to save data 05h, 55h, 54h in
addresses 00 to 02 of a data memory.
The code/main memory which stores the serial number
can also be specified by the word “CODE.” or “PROG.” or
just “P.”.
The data memory should be specified by the word
“DATA.” or “EE.” or just “E.”.
“ID” or just “I” is used for the memory of ID positions.
These words are always followed by an address inside the
specified memory.
Example:
EE.00 05 55 54 means to save data 05h, 55h, 54h in
addresses 00 to 02 of a data memory.
Notes
• * There is no specifier for the configuration memory, it
would make no sense.
dsPIC – addresses of 24-bit words are to be written in for
all addresses (i.e. an internal dsPIC address of 24h is 12h
here). For a data (EEPROM) memory addresses of 16-bit
words are to be written in, i.e. as they go one by one
through the microcontroller.
• Autonomous memory chips (I
2
C, SPI) have only the
code memory. If a non-existent memory is specified,
an error is reported.
Example of File with Serial Numbers
Commentatthebeginning;
sn1: 000034455667,
210001020304;serialnumber1