1996 Microchip Technology Inc. DS30154F-page 1
OVERVIEW
Serialization is a method of programming PIC16/17
microcontrollers whereby each chip is programmed
with a slightly different code. Typically, all locations are
programmed with the same basic code except for a few
contiguous bytes which are programmed with a differ-
ent number (referred to as ‘key’ or ‘ID number or ‘serial
number’) in each member. Typical applications of such
programming are remote transmitters for car alarms or
garage door openers where each unit must have a dif-
ferent access code.
Microchip offers a flexible SQTP program, whereby a
customer can simply specify the nature of serialization.
The ‘serial number generation and programming will
be taken care of by the factory.
1.0 SERIALIZATION SCHEME
SUPPORTED
1.1 Locations:
The serial number must reside in contiguous locations
with up to sixteen locations used. Furthermore these
locations must be coded as RETLW NN, where NN=
8-bit random code, in the finished product. For details
on how the
RETLW
instruction is typically used for seri-
alization purposes, please see Appendix A. The cus-
tomer code must be supplied without the serial code in
these locations. These locations must be blank or the
assembled value of a
RETLW H’FF’
instruction. in the
customer code provided to Microchip. Microchip will
insert the serial code at these locations during pro-
gramming. Hex files must be in Intel hex 8-bit merged
format. See Appendix B for details.
1.2 Numbering Schemes:
Random: Truly random numbers are generated. How-
ever, there is no guarantee that the numbers will be
non-repeating although the probability of such an
occurrence will be infinitesimally small for a reasonably
large field.
Pseudo-Random: Pseudo-random sequences of
requested length (e.g. 32-bit long if four locations are
used) starting with a 'seed value' selected by the fac-
tory. The customer may optionally specify the starting
value. Pseudo-random sequences, by definition are
non-repeating until all possible values are used.
Sequential: Sequential numbers are generated. User
specifies the “starting number” and an increment value.
In sequential numbering, the least significant digit is in
the lowest memory location. The increment value must
be between 1 and 255.
Numbers are always in hex and not in BCD or any other
format.
SQTP
SM
Specification
for PIC16/17
Serialized Quick Turn Programming Specification for PIC16/17
This document was created with FrameMaker404
SQTP Specification for PIC16/17
DS30154F-page 2
1996 Microchip Technology Inc.
2.0 PROGRAMMING SEQUENCE
The factory will program the “basic code” first, then pro-
gram the serial number and finally program the code-
protection fuse. Program memory will be verified at
each stage except after code protection. Optionally , the
factory may choose to program the “basic code” and
the “serial number” at the same time. The customer
may specify an ID number (four hex digits) to be pro-
grammed in the ID locations or elect to leave them
unprogrammed.
3.0 SAMPLES
Three (3) verification samples will be provided. These
will be programmed with factory selected random or
sequential codes in the serialization locations. The
three parts will be programmed with three different
serial codes. If order entry has been completed, then
the samples will reflect the first three codes. If code
protection is requested, then one of the three samples
will be code protected.
4.0 THE FOLLOWING LIMITATIONS
APPLY T O THE SQTP
PROGRAM
1. During shipment of serialized parts, no particu-
lar sequence can be guaranteed.
2. In sequential or pseudo-random numbering
scheme, there may be missing serial numbers
(e.g. due to QC sampling).
3. A list of serial numbers programmed can not be
provided, nor will such a list be generated or
maintained by Microchip.
4. For sequential and pseudo-random numbering
schemes, Microchip will maintain last number
used in last shipment and use the next number
as the starting number for the next shipment.
The customer should be prepared to provide a
“new starting number” in the event the flow is
disrupted due to unforeseen events.
1996 Microchip Technology Inc. DS30154F-page 3
SQTP Specification for PIC16/17
APPENDIX A:
Implementing a table in the program memory of
PIC16C5X and PIC16C5XA:
The PIC16C5X and the PIC16C5XA family uses Har-
vard architecture, in which the program memory is sep-
arate from data memory. All instructions operate on
data that is fetched from the register file or data mem-
ory . Since there are no instructions to read from or write
to the program memory, simply storing data words in
program memory is of no use. There is, however , a sim-
ple and elegant way to implement constant tables in the
program memory by using the
RETLW
instruction. This
instruction returns from a subroutine as well as loads
an 8-bit constant into the W register. The following
example shows how to get a byte of “serial information”
from the table stored at location 000h in PIC16C54:
ORG 0 ;store serial numbers
RETLW 0FFh
RETLW 0FFh
RETLW 0FFh
RETLW 0FFh
RETLW 0FFh
RETLW 0FFh
RETLW 0FFh
RETLW 0FFh ;end of serial
;numbers
main_prog ORG XYZ ;This is main program
MOVLW byte_num ;byte_num = 0 for 1st
;byte
CALL get_1byte;
get_1byte MOVWF PC ;write W to program
;counter
;W = offset = 0 for
;1st byte
;end of get_1byte sub
;routine
END
The next example shows how a serial number may
reside at location other than 000h.
main_prog ORG XYZ ;This is main program
MOVLW byte_num ;byte_num = 0 for 1st
;byte
CALL get_1byte;
get_1byte ADDWFPC ;W = offset
RETLW 0ffh ;
RETLW 0ffh ;
RETLW 0ffh ;
RETLW 0ffh ;
RETLW 0ffh ;
RETLW 0ffh ;
RETLW 0ffh ;
RETLW 0ffh ;end of serial
;numbers
END
APPENDIX B:
Standard hex file format for serial programming:
The hex file containing the ‘serial numbers’ will be in
Intel hex 8-bit format. Since the PIC16C5X and the
PIC16C5XA have 12-bit data words, all addresses are
doubled in this hex format. Each line of the hex file will
be for a new part. Each line can contain only up to 16
bytes (i.e. eight PIC16C5X, PIC16C5XA instruction
words). The format is as follows:
:
NNAAAATTHHHHHH......HHCC
where:
NN = byte count on current line (max 10h allowed)
AAAA = address in four hex digits
TT = record type, always 00 except 01 for EOF
HH = Two digit hex data byte
CC = Two digit hex checksum
Information cont ai ned in this publication regardi ng device appl icat i ons and the like is i ntended for sugge st i on only and may be s upers eded by updates. No repr ese nta tion or warranty is given and n o liability is as sumed
by Microchip Technology Incor porated with res pect to the accurac y or use of such inform ation, or inf ringement of pat ents or other int ellectua l property rights aris ing from such use or otherwise. Use of Microchip’ s products
as critical c om ponents in life s upport systems i s not authorize d exc ept with expres s written appro val by M i crochip. No licenses are conveyed, impli citly or otherw ise, under any intellectual pro perty rights. The M icrochip
logo and name are registered tradema rks of Microchip Technology Inc. in the U. S.A. and ot her countries. Al l rig hts reserved. All other trademarks mentioned herein are the property of thei r respective companies.
1999 Microchip Technology Inc.
All rights reserved. © 1999 Microchip Technology Incorporated. Printed in the USA. 11/99 Printed on recycled paper.
AMERICAS
Corporate Office
Microchip Technology Inc.
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-786-7200 Fax: 480-786-7277
Technical Support: 480-786-7627
Web Address: http://www.microchip.com
Atlanta
Microchip Technology Inc.
500 Sugar Mill Road, Suite 200B
Atlanta, GA 30350
Tel: 770-640-0034 Fax: 770-640-0307
Boston
Microchip Technology Inc.
5 Mount Royal Avenue
Marlborough, MA 01752
Tel: 508-480-9990 Fax: 508-480-8575
Chicago
Microchip Technology Inc.
333 Pierce Road, Suite 180
Itasca, IL 60143
Tel: 630-285-0071 Fax: 630-285-0075
Dallas
Microchip Technology Inc.
4570 Westgrove Drive, Suite 160
Addison, TX 75248
Tel: 972-818-7423 Fax: 972-818-2924
Dayton
Microchip Technology Inc.
Two Prestige Place, Suite 150
Miamisburg, OH 45342
Tel: 937-291-1654 Fax: 937-291-9175
Detroit
Microchip Technology Inc.
Tri-Atria Office Building
32255 Northwestern Highway, Suite 190
Farmington Hills, MI 48334
Tel: 248-538-2250 Fax: 248-538-2260
Los Angeles
Microchip Technology Inc.
18201 Von Karman, Suite 1090
Irvine, CA 92612
Tel: 949-263-1888 Fax: 949-263-1338
New York
Microchip Technology Inc.
150 Motor Parkway, Suite 202
Hauppauge, NY 11788
Tel: 631-273-5305 Fax: 631-273-5335
San Jose
Microchip Technology Inc.
2107 North First Street, Suite 590
San Jose, CA 95131
Tel: 408-436-7950 Fax: 408-436-7955
AMERICAS (continued)
Toronto
Microchip Technology Inc.
5925 Airport Road, Suite 200
Mississauga, Ontario L4V 1W1, Canada
Tel: 905-405-6279 Fax: 905-405-6253
ASIA/PACIFIC
Hong Kong
Microchip Asia Pacific
Unit 2101, Tower 2
Metroplaza
223 Hing Fong Road
Kwai Fong, N.T., Hong Kong
Tel: 852-2-401-1200 Fax: 852-2-401-3431
Beijing
Microchip Technology, Beijing
Unit 915, 6 Chaoyangmen Bei Dajie
Dong Erhuan Road, Dongcheng District
New China Hong Kong Manhattan Building
Beijing 100027 PRC
Tel: 86-10-85282100 Fax: 86-10-85282104
India
Microchip Technology Inc.
India Liaison Office
No. 6, Legacy, Convent Road
Bangalore 560 025, India
Tel: 91-80-229-0061 Fax: 91-80-229-0062
Japan
Microchip Technology Intl. Inc.
Benex S-1 6F
3-18-20, Shinyokohama
Kohoku-Ku, Yokohama-shi
Kanagawa 222-0033 Japan
Tel: 81-45-471- 6166 Fax: 81-45-471-6122
Korea
Microchip Technology Korea
168-1, Youngbo Bldg. 3 Floor
Samsung-Dong, Kangnam-Ku
Seoul, Korea
Tel: 82-2-554-7200 Fax: 82-2-558-5934
Shanghai
Microchip Technology
RM 406 Shanghai Golden Bridge Bldg.
2077 Yan’an Road West, Hong Qiao District
Shanghai, PRC 200335
Tel: 86-21-6275-5700 Fax: 86 21-6275-5060
ASIA/PACIFIC (continued)
Singapore
Microchip Technology Singapore Pte Ltd.
200 Middle Road
#07-02 Prime Centre
Singapore 188980
Tel: 65-334-8870 Fax: 65-334-8850
Taiwan, R.O.C
Microchip Technology Taiwan
10F-1C 207
Tung Hua North Road
Taip e i, Ta i w a n, RO C
Tel: 886-2-2717-7175 Fax: 886-2-2545-0139
EUROPE
United Kingdom
Arizona Microchip Technology Ltd.
505 Eskdale Road
Winnersh Triangle
Wokingham
Berkshire, England RG41 5TU
Tel: 44 118 921 5858 Fax: 44-118 921-5835
Denmark
Microchip Technology Denmark ApS
Regus Business Centre
Lautrup hoj 1-3
Ballerup DK-2750 Denmark
Tel: 45 4420 9895 Fax: 45 4420 9910
France
Arizona Microchip Technology SARL
Parc d’Activite du Moulin de Massy
43 Rue du Saule Trapu
Batiment A - ler Etage
91300 Massy, France
Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79
Germany
Arizona Microchip Technology GmbH
Gustav-Heinemann-Ring 125
D-81739 München, Germany
Tel: 49-89-627-144 0 Fax: 49-89-627-144-44
Italy
Arizona Microchip Technology SRL
Centro Direzionale Colleoni
Palazzo Taurus 1 V. Le Colleoni 1
20041 Agrate Brianza
Milan, Italy
Tel: 39-039-65791-1 Fax: 39-039-6899883
11/15/99
WORLDWIDE SALES AND SERVICE
Microchip received QS-9000 quality system
certification for its worldwide headquarters,
design and wafer fabrication facilities in
Chandler and Tempe, Arizona in July 1999. The
Company’s quality system processes and
procedures are QS-9000 compliant for its
PICmicro® 8-bit MCUs, KEELOQ® code hopping
devices, Serial EEPROMs and microperipheral
products. In addition, Microchips quality
system for the design and manufacture of
development systems is ISO 9001 certified.