SlideShare a Scribd company logo
1 of 37
Download to read offline
© 2006 Microchip Technology Inc. DS21986A
Passive Keyless Entry (PKE)
Reference Design
User’s Manual
DS21986A-page ii © 2006 Microchip Technology Inc.
Information contained in this publication regarding device
applications and the like is provided only for your convenience
and may be superseded by updates. It is your responsibility to
ensure that your application meets with your specifications.
MICROCHIP MAKES NO REPRESENTATIONS OR WAR-
RANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED,
WRITTEN OR ORAL, STATUTORY OR OTHERWISE,
RELATED TO THE INFORMATION, INCLUDING BUT NOT
LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE,
MERCHANTABILITY OR FITNESS FOR PURPOSE.
Microchip disclaims all liability arising from this information and
its use. Use of Microchip devices in life support and/or safety
applications is entirely at the buyer’s risk, and the buyer agrees
to defend, indemnify and hold harmless Microchip from any and
all damages, claims, suits, or expenses resulting from such
use. No licenses are conveyed, implicitly or otherwise, under
any Microchip intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron,
dsPIC, KEELOQ, microID, MPLAB, PIC, PICmicro, PICSTART,
PRO MATE, PowerSmart, rfPIC and SmartShunt are
registered trademarks of Microchip Technology Incorporated
in the U.S.A. and other countries.
AmpLab, FilterLab, Migratable Memory, MXDEV, MXLAB,
SEEVAL, SmartSensor and The Embedded Control Solutions
Company are registered trademarks of Microchip Technology
Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, dsPICDEM,
dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR,
FanSense, FlexROM, fuzzyLAB, In-Circuit Serial
Programming, ICSP, ICEPIC, Linear Active Thermistor,
MPASM, MPLIB, MPLINK, MPSIM, PICkit, PICDEM,
PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo,
PowerMate, PowerTool, Real ICE, rfLAB, rfPICDEM, Select
Mode, Smart Serial, SmartTel, Total Endurance, UNI/O,
WiperLock and Zena are trademarks of Microchip Technology
Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
© 2006, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
Note the following details of the code protection feature on Microchip devices:
• Microchip products meet the specification contained in their particular Microchip Data Sheet.
• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Microchip received ISO/TS-16949:2002 quality system certification for
its worldwide headquarters, design and wafer fabrication facilities in
Chandler and Tempe, Arizona and Mountain View, California in
October 2003. The Company’s quality system processes and
procedures are for its PICmicro® 8-bit MCUs, KEELOQ® code hopping
devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.
PKE REFERENCE DESIGN
USER’S MANUAL
© 2006 Microchip Technology Inc. DS21986A-page iii
Table of Contents
Preface ........................................................................................................................... 1
Chapter 1. System Overview
1.1 Overview ........................................................................................................ 6
1.2 Operational Overview ..................................................................................... 7
1.3 Features ......................................................................................................... 7
1.3.1 LF Initiator ................................................................................................... 7
1.3.2 Key Fob ....................................................................................................... 7
1.3.3 RF Receiver ................................................................................................ 8
1.4 Reference Documents .................................................................................... 8
Chapter 2. Low-Frequency Initiator Module
2.1 Introduction ................................................................................................... 10
2.2 Hardware ...................................................................................................... 10
2.2.1 Microcontroller ........................................................................................... 10
2.2.2 Configurable Inputs ................................................................................... 10
2.2.3 LF Transmitter ........................................................................................... 10
2.2.4 Network Interfaces .................................................................................... 10
2.2.5 Power ........................................................................................................ 10
2.3 Software ....................................................................................................... 12
Chapter 3. PKE Transmitter-Transponder
3.1 Introduction ................................................................................................... 14
3.2 Hardware ...................................................................................................... 14
3.2.1 Transmitter ................................................................................................ 15
3.3 Software ....................................................................................................... 17
3.3.1 Dual Encoder Operation ............................................................................ 20
3.3.2 Code Hopping Code Word Data Format ................................................... 20
3.3.3 EEPROM Organization ............................................................................. 23
Chapter 4. Remote Keyless Entry Receiver-Decoder Module
4.1 Introduction ................................................................................................... 26
4.2 Hardware ...................................................................................................... 26
4.2.1 UHF Receiver ............................................................................................ 26
4.2.2 Microcontroller ........................................................................................... 26
4.2.3 Network Interface ...................................................................................... 27
4.2.4 Power Supply ............................................................................................ 27
4.2.5 Connectors ................................................................................................ 28
4.3 Software ....................................................................................................... 30
4.3.1 Modules Overview ..................................................................................... 30
Worldwide Sales and Service .................................................................................... 33
PKE Reference Design User’s Manual
DS21986A-page iv © 2006 Microchip Technology Inc.
NOTES:
PKE REFERENCE DESIGN
USER’S MANUAL
© 2006 Microchip Technology Inc. DS21986A-page 1
Preface
INTRODUCTION
This chapter contains general information that will be useful to know before using the
PKE Reference Design. Items discussed in this chapter include:
• Document Layout
• Conventions Used in this Guide
• Recommended Reading
• The Microchip Web Site
• Customer Support
DOCUMENT LAYOUT
This document describes a Passive Keyless Entry (PKE) system upgrade to an existing
Remote Keyless Entry (RKE) application. The manual layout is as follows:
• Chapter 1. “System Overview” – Describes the PKE system upgrade to an
existing Remote Keyless Entry (RKE) application overview.
• Chapter 2. “Low-Frequency Initiator Module” – Describes the Low-Frequency
Magnetic Transmitter.
• Chapter 3. “PKE Transmitter-Transponder” – Describes the Remote Keyless
Entry unit as a solution for Passive and RKE Keyless Entry applications.
• Chapter 4. “Remote Keyless Entry Receiver-Decoder Module” – Describes
the Remote Keyless Entry Receiver-Decoder module as a target board for RKE
and PKE message transmissions.
NOTICE TO CUSTOMERS
All documentation becomes dated, and this manual is no exception. Microchip tools and
documentation are constantly evolving to meet customer needs, so some actual dialogs
and/or tool descriptions may differ from those in this document. Please refer to our web site
(www.microchip.com) to obtain the latest documentation available.
Documents are identified with a “DS” number. This number is located on the bottom of each
page, in front of the page number. The numbering convention for the DS number is
“DSXXXXXA”, where “XXXXX” is the document number and “A” is the revision level of the
document.
For the most up-to-date information on development tools, see the MPLAB® IDE on-line help.
Select the Help menu, and then Topics to open a list of available on-line help files.
Preface
© 2006 Microchip Technology Inc. DS21986A-page 2
CONVENTIONS USED IN THIS GUIDE
This manual uses the following documentation conventions:
DOCUMENTATION CONVENTIONS
RECOMMENDED READING
It is recommended that you become familiar with the documents listed below, prior to
using the PKE Reference Design Kit.
PICkit™ 2 Microcontroller Programmer User’s Guide (DS51553)
Consult this document for instructions on how to use the PICkit 2 Microcontroller
Programmer hardware and software.
AMHRRQ3-433 Telecontrolli Data Sheet (DS.0015-1.pdf)
AMHRR3-433 Telecontrolli Data Sheet (DS.0016-9.pdf)
PIC12F635/PIC16F636/639 Data Sheet (DS41232)
Data sheet for the PIC12F635/PIC16F636/639 8/14-pin Flash-based, 8-bit CMOS
microcontrollers with nanoWatt technology.
PIC16F688 Data Sheet (DS41203)
Data sheet for the PIC16F688 14-pin Flash-based 8-bit CMOS microcontrollers with
nanoWatt technology.
Description Represents Examples
Code (Courier font):
Plain characters Sample code
Filenames and paths
#define START
c:autoexec.bat
Angle brackets: < > Variables <label>, <exp>
Square brackets [ ] Optional arguments MPASMWIN [main.asm]
Curly brackets and pipe
character: { | }
Choice of mutually exclusive argu-
ments; An OR selection
errorlevel {0|1}
Lowercase characters in
quotes
Type of data “filename”
Ellipses... Used to imply (but not show) addi-
tional text that is not relevant to the
example
list
[“list_option...,
“list_option”]
0xnnn A hexadecimal number where n is a
hexadecimal digit
0xFFFF, 0x007A
Italic characters A variable argument; it can be either a
type of data (in lowercase characters)
or a specific example (in uppercase
characters).
char isascii (char,
ch);
Interface (Arial font):
Underlined, italic text
with right arrow
A menu selection from the menu bar File > Save
Bold characters A window or dialog button to click OK, Cancel
Characters in angle
brackets < >
A key on the keyboard <Tab>, <Ctrl-C>
Documents (Arial font):
Italic characters Referenced books MPLAB®
IDE User’s Guide
PKE Reference Design User’s Manual
DS21986A-page 3 © 2006 Microchip Technology Inc.
MCP201 LIN Transceiver with Voltage Regulator Data Sheet (DS21730)
Data sheet for the MCP201 LIN transceiver. Gives an overview of the device including
modes of operation and electrical characteristics.
Modular PICmicro®
Mid-Range MCU Code Hopping Decoder Application Note
AN742 (DS00742)
Application note describes a KEELOQ code hopping decoder implemented on a
Microchip mid-range PICmicro microcontroller.
Using the PIC16F639 MCU for Smart Wireless Applications Application Note
AN959 (DS00959)
Application note describing the PIC16F639 as a suitable microcontroller for
bidirectional communications and low-frequency sensing applications.
HCS365 Data Sheet (DS41109)
Data sheet for the HCS365 KEELOQ code hopping encoder.
Low-Frequency Magnetic Transmitter Design Application Note AN232 (DS00232
Application note covering the basic aspects to consider when designing the transmitter
portion of a LFMC link.
PIC18F2585/2680/4585/4680 Data Sheet (DS39625)
Data sheet for the PIC18F2585/2680/4585/4680 28/40/44-pin enhanced Flash
microcontrollers with ECAN™ technology, 10-bit A/D and nanoWatt technology.
TC4421/TC4422 9A High-Speed MOSFET Drivers Data Sheet (DS21420)
Data sheet for the TC4421/TC4422 9A High-Speed MOSFET Driver. Gives an
overview of the device including electrical characteristics.
Preface
© 2006 Microchip Technology Inc. DS21986A-page 4
THE MICROCHIP WEB SITE
Microchip provides online support via our web site at www.microchip.com. This web
site is used as a means to make files and information easily available to customers.
Accessible by using your favorite Internet browser, the web site contains the following
information:
• Product Support – Data sheets and errata, application notes and sample
programs, design resources, user’s guides and hardware support documents,
latest software releases and archived software
• General Technical Support – Frequently Asked Questions (FAQs), technical
support requests, online discussion groups, Microchip consultant program
member listing
• Business of Microchip – Product Selector Guide, latest Microchip press
releases, listing of seminars and events, listings of Microchip sales offices,
distributors and factory representatives
CUSTOMER SUPPORT
Users of Microchip products can receive assistance through several channels:
• Distributor or Representative
• Local Sales Office
• Field Application Engineer (FAE)
• Technical Support
• Development Systems Information Line
Customers should contact their distributor, representative or field application engineer
(FAE) for support. Local sales offices are also available to help customers. A listing of
sales offices and locations is included in the back of this document.
Technical support is available through the web site at: http://support.microchip.com
PKE Reference Design User’s Manual
DS21986A-page 5 © 2006 Microchip Technology Inc.
NOTES:
PKE REFERENCE DESIGN
USER’S MANUAL
© 2006 Microchip Technology Inc. DS21986A-page 6
Chapter 1. System Overview
1.1 OVERVIEW
This manual describes a Passive Keyless Entry (PKE) system upgrade to an existing
Remote Keyless Entry (RKE) application.
The key fob design contains a PIC16F639 with a integrated three-axis Analog
Front-End (AFE).
The Low-Frequency Initiator is implemented in a PIC18F2680.
This design has been optimized to integrate into an existing model platform without
substantial modification. Operational flexibility is the key to the overall concept with
many scalable features that are end-of-line programmable by customer, dealer or
factory.
FIGURE 1-1: PKE BLOCK DIAGRAM
LF
Initiator
Trigger
KEY
FOB
3-Axis
RF
Transmitter
Encoder
RKE
Receiver
AFE
RF
Receiver
Decoder
Drivers
Buttons
On-Vehicle
LIN Lock
Actuator
125 kHz
434 MHz
PKE Reference Design User’s Manual
DS21986A-page 7 © 2006 Microchip Technology Inc.
1.2 OPERATIONAL OVERVIEW
When the Low-Frequency (LF) Initiator detects a trigger input, a coded 125 kHz
message is transmitted. Any transponder within range of this signal receives this
message and validates the coded data field. If the Initiator is recognized, a RF
(433.92 MHz) KEELOQ
®
encoded message is transmitted. A standard RKE receiver
decodes this packet and, if recognized, the appropriate action is taken.
To reduce current consumption, the LF Initiator does not poll for transponders continuously.
A trigger event wakes the initiator from Sleep or Power-down (see Figure 1-1). The trigger
input can be any type or source such as:
• Commanded over one of the networks
• Infra-red under door handle
• Simple microswitch activated by the door handle mechanism
• Capacitive proximity detector sensing a change in a field by a hand approaching
the handle
The application described herein uses a microswitch input for simplicity. As delivered,
the LF initiator will continuously poll for the transponder. This is to facilitate orientation
and range evaluation.
The transponder key fob can operate as a regular push button RKE fob. When a valid
LF field message is sensed, the microcontroller responds as if a sixth phantom button
were pushed and transmits a unique function code.
The RF Receiver/Decoder combination can include a KEELOQ Security IC. Typical
decoders are the HCS500, HCS512 or HCS515. In the case of this design, a
custom-programmed PICmicro®
mid-range microcontroller was used.
1.3 FEATURES
1.3.1 LF Initiator
Refer to Microchip Application Note AN232, “Low-Frequency Magnetic Transmitter
Design” (DS00232). Features of the LF Initiator are as follows:
• Commanded by various types of inputs
• Simple momentary switch
• Proximity detector
• Serial-numbered challenge
• CAN and LIN network support
1.3.2 Key Fob
Refer to Microchip Application Note AN959, “Using the PIC16F639 MCU for Smart
Wireless Applications” (DS00959). Features of the key fob are as follows:
• Functionally compatible with Microchip’s HCS365 encoder
• Supports up to five push button inputs
• Two LED outputs for valid button and valid low-frequency challenge indication
System Overview
© 2006 Microchip Technology Inc. DS21986A-page 8
1.3.3 RF Receiver
Refer to Microchip Application Note AN742 “Modular PICmicro®
Mid-Range MCU Code
Hopping Decoder” (DS00742). Features of the RF Receiver are as follows:
• Supports two manufacturer’s codes
• Compatible with Microchip’s HCS200, HCS201, HCS300, HCS301, HCS360 and
HCS361 encoders
• Automatic baud rate detection
• Automatic Normal or Secure learn detection
• Six learnable transmitters
1.4 REFERENCE DOCUMENTS
RF Receiver-Decoder
1. “AMHRRQ3-433” Telecontrolli Data Sheet, “DS.0015-1.pdf”
2. “AMHRR3-433” Telecontrolli Data Sheet, “DS.0016-9.pdf”
3. “PIC12F635/PIC16F636/639 Data Sheet” (DS41232), Microchip Technology Inc.
4. “PIC16F688 14-pin Flash-Based 8-Bit Data Sheet” (DS41203), Microchip
Technology Inc.
5. “MCP201 LIN Transceiver with Voltage Regulator Data Sheet” (DS21730),
Microchip Technology Inc.
6. “Modular PICmicro®
Mid-Range MCU Code Hopping Decoder”, Application Note
AN742 (DS00742), Microchip Technology Inc.
RKE/PKE Key Fob
1. “PIC12F635/PIC16F636/639 Data Sheet” (DS41232), Microchip Technology Inc.
2. “Using the PIC16F639 MCU for Smart Wireless Applications”, Application Note
AN959 (DS00959), Microchip Technology Inc.
3. “HCS365 Data Sheet” (DS41109), Microchip Technology Inc.
4. “Low-Frequency Magnetic Transmitter Design”, Application Note AN232
(DS00232), Microchip Technology Inc.
LF Initiator
1. “PIC18F2585/2680/4585/4680 Data Sheet” (DS39625), Microchip Technology
Inc.
2. “TC4421/TC4422 9A High-Speed MOSFET Drivers Data Sheet” (DS21420),
Microchip Technology Inc.
3. “Low-Frequency Magnetic Transmitter Design”, Application Note AN232
(DS00232), Microchip Technology Inc.
PKE Reference Design User’s Manual
DS21986A-page 9 © 2006 Microchip Technology Inc.
NOTES:
PKE REFERENCE DESIGN
USER’S MANUAL
© 2006 Microchip Technology Inc. DS21986A-page 10
Chapter 2. Low-Frequency Initiator Module
2.1 INTRODUCTION
The LF transmitter is derived from the design described in Application Note AN232,
”Low-Frequency Magnetic Transmitter Design” (DS00232).
2.2 HARDWARE
2.2.1 Microcontroller
A PIC18F2680 was selected for the LF controller based on the wide range of peripherals
available on the chip. The PIC18F2680 has both a CAN controller and a LIN-compatible
EAUSART to interface to in-vehicle networks. The Capture/Compare/PWM module
lends itself to generation of the 125 kHz square wave needed as the LF carrier.
2.2.2 Configurable Inputs
Two 12V tolerant inputs are provided for triggers. Both of these PCB circuits can be
reconfigured for a variety of input types. Refer to the schematic in Figure 2-1. For
example, if one of the inputs is a momentary switch to ground:
1. Substitute a 0Ω resistor for R2.
2. Remove R3 and D3.
3. Replace D2 with a 30K resistor.
2.2.3 LF Transmitter
A high-current MOSFET driver (TC4422) is driven by the PWM output of the
microcontroller, and in turn, drives the resonant tank circuit consisting of TX coil (L1) and
C2. This output circuit generates a magnetic field with a voltage of up to 320V
peak-to-peak.
2.2.4 Network Interfaces
Network connectivity is provided by a MCP201 LIN transceiver and a MCP2551 CAN
transceiver.
2.2.5 Power
Power can be supplied through either J1 power jack, J3 CAN plug or J4 LIN connection.
Voltage should be in the range of 8-18 VDC. The automotive-grade voltage regulator is
reverse-battery, transient and load-dump protected.
To reduce power consumption in key-off situations, the power-on LED may be
removed.
PKE Reference Design User’s Manual
DS21986A-page 11 © 2006 Microchip Technology Inc.
FIGURE 2-1: SCHEMATIC – LOW-FREQUENCY INITIATOR
PWM
PWM
V
CC
V
CC
V
CC
V
CC
+12
V
DC
V
CC
V
CC
+12
V
DC
V
CC
+12
V
DC
400V
P3476-ND
R6
15K
R6
15K
R10
120
R10
120
L2
DO5022P
L2
DO5022P
D3
1N5819
D3
1N5819
C7
0.1
uF
C7
0.1
Y1
20.0
MHz
Y1
20.0
R5
1K
R5
1K
D5
1N5819
D5
1N5819
D8
10MQ100N
D8
10MQ100N
D7
10MQ100N
D7
10MQ100N
D2
1N5819
D2
1N5819
CANH
7
GND
2
CANL
6
V
CC
3
TXD
1
RXD
4
REF
5
RS
8
U2
MCP2551
U2
MCP2551
C8
10
nF
C8
10
LED2
YEL
LED2
YEL
D4
1N5819
D4
1N5819
J1
J1
R8
4.7K
R8
4.7K
C4
20
pF
C4
20
C5
1.0
uF
C5
1.0
C9
0.200LS
C9
0.200LS
D6
1N4148
D6
1N4148
1
3
5
2
4
6
J4
CON6A
J4
CON6A
C3
20
pF
C3
20
C10
0.200LS
C10
0.200LS
MCLR
1
V
CC
2
GND
3
RB7
4
RB6
5
RB3
6
J2
RJ11
J2
RJ11
IN
1
OUT
3
GND
2
VR1
LM2937ET-5.0
VR1
LM2937ET-5.0
C6
1.0
uF
C6
1.0
1
TP1
TP1
R7
30K
R7
30K
R2
25K
R2
25K
R1
1K
R1
1K
1
3
5
2
4
6
J3
CON6A
J3
CON6A
MCLR/V
PP
1
OSC1/CLKIN
9
OSC2/CLKOUT
10
RA0/AN0
2
RA1/AN1
3
RA2/AN2/V
REF
-
4
RA3/AN3/V
REF
+
5
RA4/T0CLI
6
RA5/AN4/SS/LVDIN
7
RB0/INT0
21
RB1/INT1
22
RB2/CANTX
23
RB3/CANRX
24
RB4
25
RB5
26
RB6
27
RB7
28
RC0/T1OSO/T1CKI
11
RC1/T1OSI
12
RC2/CCP1
13
RC3/SCK/SCL
14
RC4/SDI/SDA
15
RC5/SDO
16
RC6/TX/CK
17
RC7/RX/DT
18
U1
PIC18F2680
U1
PIC18F2680
C1
10
μF
C1
10
R4
25K
R4
25K
3
V
D
D
6 V
D
D
2
GND
4
GND
5
OUT
IN
1
U4
TC4422
U4
TC4422
D1
10MQ100N
D1
10MQ100N
D9
1N4750
D9
1N4750
L1
10-00189
L1
10-00189
LIN
6
RX
1
TX
4
CS/WAKE
2
GND
5
V
BAT
7
V
D
D
3
FAULT/SLPS
8
MCP201
U3
MCP201
U3
R3
15K
R3
15K
LED1
GRN
LED1
GRN
C2
10
μF
C2
10
R9
1K
R9
1K
High
Voltage
These
two
input
circuits
are
set-up
for
+12-to-GND
signals.
To
input
a
+5-to-0
signal,
remove
R3
or
R6,
replace
R2
or
R4
with
1K,
and
either
put
a
10K
resistor
across
D2-D4
OR
enable
internal
pull-ups
in
the
microcontroller.
Low-Frequency Initiator Module
© 2006 Microchip Technology Inc. DS21986A-page 12
2.3 SOFTWARE
The LF message shown in Figure 2-2 is transmitted when the trigger event is detected.
As shown, the module will wait up to 50 ms after the challenge for a response from the
RF Receiver module. This notification is sent over the LIN data line. If no response is
received, the module will send the same message two more times, and then enter
power-down, awaiting another trigger.
FIGURE 2-2: LF CHALLENGE DATA FORMAT
The LF challenge message consists of a 125 kHz carrier modulated as follows:
1: A 4 ms ON to settle the receiving AGC.
2: 500 μs OFF.
3: 2 ms ON followed by a 2 ms OFF to enable the receiver output filter. This
pattern is dependant on the configuration setting of the receiving AFE.
4: 16 Least Significant bits (LSb) of the module serial number, PWM encoded
(see Figure 2-3).
5: 50 ms OFF, waiting for a valid response from the RF receiver.
The challenge code portion of the message is to ensure that only previously learned
transponders are hailed. All others will remain silent. This challenge code may be
expanded or reduced by changes to the firmware to address individual application
requirements. For this design, 16 bits were deemed sufficient.
FIGURE 2-3: CODE WORD DATA TRANSMISSION FORMAT (PWM)
Transmission Direction LSb First
Challenge Code Portion (16 Bits)
Least Significant bits of Serial Number
(16 Bits)
4 ms
125 kHz Base Frequency
UHF Response Slot Wake-Up 125 kHz Preamble
500
μs
2 ms
2 ms
50 ms
Guard Time
LOGIC ‘0’
LOGIC ‘1’
Bit
Period
PKE Reference Design User’s Manual
DS21986A-page 13 © 2006 Microchip Technology Inc.
NOTES:
PKE REFERENCE DESIGN
USER’S MANUAL
© 2006 Microchip Technology Inc. DS21986A-page 14
Chapter 3. PKE Transmitter-Transponder
3.1 INTRODUCTION
The RKE Key Fob unit is a complete solution for PKE and RKE applications in a key
fob type form factor. The board was designed to accept a PIC16F636 or a PIC16F639
microcontroller. With minor modifications, it will also support a PIC12F635.
Some features of this design are:
• Up to five push button inputs
• One or two LED outputs
• 433.92 MHz transmitter
• 3-axis low-frequency receiver
3.2 HARDWARE
A PIC16F636, installed pin 1 justified at location U1, will support RKE applications.
Since the PIC16F636 shares the same pinout as the PIC16F639 on its upper most
pins, the only function lost is the on-chip low-frequency analog front-end.
For PKE applications, a PIC16F639 and the associated low-frequency receiver coils
are installed.
The four buttons (S1-S4) on the transmitters are connected to the appropriate inputs
on the microcontroller (S1-S4). The user may activate any combination of encoder
inputs transmitting any of the 15 possible function codes. The RFEN output option is
not used by the demonstration transmitter and should be disabled as this function
shares its output with a button input. If RFEN is enabled, the button input will be lost.
See Section 3.3 “Software”.
Button S5 is not directly associated with a specific function code bit, but rather transmits
a user-defined function code stored in EEPROM data memory.
The microcontroller Flash program and EEPROM data memory may be
programmed through J1. This connector is pinout compatible with PICkit™
1 and
PICkit™
2 programmers.
PKE Reference Design User’s Manual
DS21986A-page 15 © 2006 Microchip Technology Inc.
TABLE 3-1: I/O CONNECTIONS
3.2.1 Transmitter
The RF oscillator uses a Surface Acoustic Wave (SAW) resonator that operates at
433.92 MHz.
The Programming Connector (J1) enables In-Circuit Serial Programming™ (ICSP™).
The transmitter can therefore be re-configured or re-programmed without removing the
microcontroller from the board.
FIGURE 3-1: J1 PROGRAMMING CONNECTOR
PORT Pin Function Notes
Inputs
RA0 Switch 5 ICSP™ Data
RA1 LF Data Input ICSP Clock
RA2 Switch 3
RA3 Switch 2 ICSP MCLR
RA4 Switch 1
RA5 Switch 4
Outputs
RC0 RF Active LED
RC4 LF Challenge LED
RC5 RF Data Out
Others
RC1 Internally connected on PIC16F639 not used on PIC16F636
RC2 Internally connected on PIC16F639 not used on PIC16F636
RC3 Internally and externally connected on PIC16F639 not used on PIC16F636
Note: The design and layout of this transmitter is not sufficient to ensure
compliance with EC or FCC regulations.
1
2
3
4
5
6
MCLR
VCC
ICSPDAT
no connection
VSS
ICSPCLK
PKE Transmitter-Transponder
© 2006 Microchip Technology Inc. DS21986A-page 16
FIGURE 3-2: SCHEMATIC – RF RECEIVER/DECODER USING THE PIC16F639
CSn
ICSPCLK
LFDATA
ICSPDAT
LCCOM
LX
LY
PWM
SCLK/ALERT
LZ
V
CC
V
CC
V
CC
V
CC
V
CC
V
BAT
V
BAT
V
CC
V
CC
Unlock
Lock
Shift
Hazard
Boot
Active
Challenge
Do
not
assemble
parts
within
dotted
boxes
for
RKE-only
application.
Replace
PIC16F639
with
PIC16F636.
240
pF
+
24
pF
220
R3
220
R3
220
pF
CZ1
220
CZ1
3V/6V
BT1
3V/6V
BT1
C12
1.0
uF
C12
1.0
SW2
SW2
7.1
mH
LY1
7.1
LY1
10M
R9
10M
R9
C6
100
nF
C6
100
R16
100k
R16
100k
NE94433
Q1
NE94433
Q1
D8
1N4148WS
D8
1N4148WS
9.0
mH
LX2
9.0
LX2
R12
1K
R12
1K
100
nF
C4
100
C4
SW5
SW5
5.1V
D2
5.1V
D2
4
GND
8
GND
2
IN
1
nc
3
nc
5
nc
7
nc
6
OUT
433.92
U2
433.92
MHz
SAW
U2
470
R20
470
R20
264
pF
CX1
264
CX1
1.0
uF
C5
1.0
C5
12
pF
C3
12
C3
LED-RED
D4
LED-RED
D4
0
R8
0
R8
LED-GRN
D5
LED-GRN
D5
47K
R2
47K
R2
1.0
uF
C11
1.0
C11
SW1
SW1
470
R19
470
R19
47
R1
47
R1
SW3
SW3
SW4
SW4
7.1
mH
LZ1
7.1
LZ1
MA2S784
D1
MA2S784
D1
220
pF
CY1
220
CY1
+
1
+
3
+
5
+
2
+
4
+
6
J1
J1
Antenna
L1
Antenna
L1
470
pF
C1
470
C1
RA0/C1IN+
19
RA1/C1IN-
18
RA2/C1OUT/INT
17
RA3/MCLR
4
RA4/OSC2
3
RA5/OSC1
2
V
DDT
8
LCX
11
LCY
10
LCZ
9
LCCOM
12
RC0/C2IN+
16
RC1/C2IN-
15
RC2
14
RC3
7
RC4/C2OUT
6
RC5
5
V
SST
13
V
CC
1
GND
20
U3
PIC16F639
U3
PIC16F639
2.0
pF
C2
2.0
C2
PKE Reference Design User’s Manual
DS21986A-page 17 © 2006 Microchip Technology Inc.
3.3 SOFTWARE
The transponder firmware is functionally based on the Microchip HCS365 KEELOQ
encoder. See the “HCS365 Data Sheet” (DS41109) for more information. Additional
routines have been added to initialize and interface to the internal low-frequency
analog front-end of the PIC16F639.
The transponder key fob operates as a standard 5-button RKE fob, when not being
challenged by a Low-Frequency Initiator signal. The microcontroller responds as if a
sixth or a phantom button were pushed, when a valid LF field message is sensed and
verified.
The transponder will normally be in a low-power Sleep mode. When a switch input is
taken low or a LF challenge is received, the device will wake-up and go through
debounce delay of 20 ms before the switch value is latched. The device will then read
the configuration options and depending on the configuration options, it will determine
what the data and modulation format will be for the transmission. The transmission will
consist of a stream of code words. The code words are transmitted after the button is
pressed and as long as the buttons are held down or a time out occurs. The code word
format can be either a code hopping format or a seed format.
The time-out time can be selected with the Time-out Select (TSEL) configuration
option. This option allows the time out to be disabled or set to 0.8s, 3.2s or 25.6s. When
a time out occurs, the device will go into Sleep mode to protect the battery from draining
when a button gets stuck.
If during the transmit process a new button is detected, the current code word will be
aborted, a new code word will be transmitted and the time-out counter will reset. If all
the buttons are released, a minimum number of code words will still be completed. The
minimum code words can be set to 1, 2, 4 or 8 using the minimum code words (MTX)
configuration option. If the time for transmitting the minimum code words is longer than
the time-out time, the device will not complete the minimum code words.
A summary table of all the options is given in Section 3.3.3 “EEPROM Organization”.
Note 1: The transponder is initially supplied pre-programmed with the KEELOQ
encryption algorithm. The program memory and EEPROM data memory are
read-protected.
2: The software source files supplied on the CD with this transponder have
the KEELOQ encryption routines deleted. If a new hex file is assembled
using these source files and programmed into the microcontroller, the
original KEELOQ hopping code will be overwritten and lost.
3: Contact Microchip Technology for information about KEELOQ Security ICs
and licensing options.
PKE Transmitter-Transponder
© 2006 Microchip Technology Inc. DS21986A-page 18
The software includes four assemble-time conditional options. These options are
enabled by removing the semi-colon in column 1 of the code line.
Select Processor, enable only one below:
#DEFINE P12F635 1 ;Sets environment for PIC12F635
#DEFINE P16F636 1 ;Sets environment for PIC16F636
#DEFINE P16F639 1 ;Sets environment for PIC16F639
Select PORTA buttons to be connected to ground with internal pull-ups OR, connected
to VCC with internal pull-downs:
#DEFINE pullup 1 ;Set to select pull-ups on PORT A.
;For pull-downs, comment out.
Since the in-circuit emulator does not support Sleep:
#DEFINE ICEmul 1 ;Is set, device will not SLEEP, but will
;loop forever
Select option not to Encrypt:
#DEFINE NoEncryption 1
PKE Reference Design User’s Manual
DS21986A-page 19 © 2006 Microchip Technology Inc.
FIGURE 3-3: FLOWCHART – DEVICE OPERATION
Start
Sample
Increment
Seed
Time Out?
Encrypt
No
No
Yes
Get Config
TX?
Counter
Transmit
MTX?
No
Buttons?
Seed
Time?
Read Seed
Stop
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes Seed
Button?
No
New
Buttons?
No
LF
No
Yes
Data?
Receive
Valid
No
Yes
Request?
Buttons
Challenge
PKE Transmitter-Transponder
© 2006 Microchip Technology Inc. DS21986A-page 20
3.3.1 Dual Encoder Operation
The transponder contains two transmitter Configuration Words, serial numbers,
encoder keys, discrimination values, counters and seed values. This means that the
transponder can be used as two independent encoders. The code word is calculated
using one of two possible encoder configurations. Most options for code word and
modulation formats can be different from Encoder 1 and Encoder 2, but LED and RF
transmitter options have to be the same. The Shift input pin is used to select between
the encoder configurations. A low on the Shift pin will select Encoder 1 and a high will
select Encoder 2.
3.3.2 Code Hopping Code Word Data Format
A code hopping code word consists of 32 bits of code hopping data, 32 bits of fixed
code and between 3 and 5 bits of status information. Various code word formats are
shown in Figure 3-4 for KEELOQ encoder compatible transmissions.
PKE Reference Design User’s Manual
DS21986A-page 21 © 2006 Microchip Technology Inc.
FIGURE 3-4: CODE WORD DATA FORMAT
Fixed Code Portion (32 Bits)
CRC
2 Bits
VLOW
1 Bit
Serial Number
(28 Bits)
C1 C0 S2 S1 S0 S3
BUT
4 Bits
Counter
Overflow
2 Bits
DISC
10 Bits
Synchronization
16 Bits
Counter
15 0
S1
S2 S0 S3 OVR1 OVR0
Transmission Direction LSb First
Hopping Code Portion (32 Bits)
With XSER = 0, 16-bit Counter, QUEN = 0
Status Information
(3 Bits)
BUT
4 Bits
Fixed Code Portion (32 Bits)
QUE
2 Bits
CRC
2 Bits
VLOW
1 Bit
Serial Number
(32 Bits)
Q1 Q0 C1 C0
BUT
4 Bits
Counter
Overflow
2 Bits
DISC
10 Bits
Synchronization
16 Bits
Counter
15 0
S2 S1 S0 S3 OVR1 OVR0
Hopping Code Portion (32 Bits)
With XSER = 1, 16-bit Counter, QUEN = 1
Status Information
(5 Bits)
Fixed Code Portion (32 Bits)
QUE
2 Bits
CRC
2 Bits
VLOW
1 Bit
Serial Number
(28 Bits)
Q1 Q0 C1 C0 S2 S1 S0 S3
BUT
4 Bits
DISC
8 Bits
Synchronization
20 Bits
Counter
19 0
S2 S1 S0 S3
Hopping Code Portion (32 Bits)
With XSER = 0, 20-bit Counter, QUEN = 1
Status Information
(5 Bits)
BUT
4 Bits
Fixed Code Portion (32 Bits)
CRC
2 Bits
VLOW
1 Bit
Serial Number
(32 Bits)
C1 C0
BUT
4 Bits
DISC
8 Bits
Synchronization
20 Bits
Counter
19 0
S2 S1 S0 S3
Hopping Code Portion (32 Bits)
With XSER = 1, 20-bit Counter, QUEN = 0
Status Information
(3 Bits)
PKE Transmitter-Transponder
© 2006 Microchip Technology Inc. DS21986A-page 22
FIGURE 3-5: CODE WORD DATA FORMAT, NO ENCRYPTION
TABLE 3-2: FUNCTION CODES
Button Function
S0 F[xx1x]
S1 F[x1xx]
S2 F[1xxx]
S3 F[xxx1]
S4 User Programmable
LF Challenge User Programmable
Note 1: The function code is repeated in the encrypted and unencrypted data of a transmission.
Fixed Code Portion (64 Bits)
CRC
2 Bits
VLOW
1 Bit
Serial Number 1
(28 Bits)
C1 C0 S2 S1 S0 S3
BUT
4 Bits
S1
S2 S0 S3
Transmission Direction LSb First
With XSER = 0, 16-bit Counter, QUEN = 0, S<3:0> not equal ‘0111’
Status Information
(3 Bits)
BUT
4 Bits
Serial Number 2
(16 Bits)
Fixed Code Portion (64 Bits)
QUE
2 Bits
CRC
2 Bits
VLOW
1 Bit
Serial Number
(32 Bits)
Q1 Q0 C1 C0
BUT
4 Bits
S2 S1 S0 S3
With XSER = 1, 16-bit Counter, QUEN = 1, S<3:0> not equal ‘0111’
Status Information
(5 Bits)
USER1
4 Bits
USER0
8 Bits
Data 71h Data 72h
Serial Number 2
(16 Bits)
USER1
4 Bits
USER0
8 Bits
Data 71h Data 72h
Fixed Code Portion (64 Bits)
CRC
2 Bits
VLOW
1 Bit
Serial Number 1
(28 Bits)
C1 C0 S2 S1 S0 S3
BUT
4 Bits
S1
S2 S0 S3
With XSER = 0, 16-bit Counter, QUEN = 0, S<3:0> equal ‘0111’
Status Information
(3 Bits)
BUT
4 Bits
Serial Number 2
(32 Bits)
Fixed Code Portion (64 Bits)
QUE
2 Bits
CRC
2 Bits
VLOW
1 Bit
Serial Number
(32 Bits)
Q1 Q0 C1 C0
BUT
4 Bits
S2 S1 S0 S3
With XSER = 1, 16-bit Counter, QUEN = 1, S<3:0> equal ‘0111’
Status Information
(5 Bits)
Serial Number 2
(32 Bits)
PKE Reference Design User’s Manual
DS21986A-page 23 © 2006 Microchip Technology Inc.
3.3.3 EEPROM Organization
A summary of the transponder EEPROM organization is shown in Tables 3-3, 3-4 and
3-5. The address column shows the starting address of the option and its length, or bit
position. Options larger than 8 bits are stored with the MSb at the given address, and
enough consecutive 8-bit blocks are reserved for the entire option size. Options such
as SEED, which has a length that is not an exact multiple of 8 bits, are stored right
justified in the reserved space such that additional smaller options, like SDBT, may be
stored in the same address as the MSb.
TABLE 3-3: ENCODER 1 (SHIFT = 0)
Symbol
Address
(Bits)
Description(1)
KEY1 1E: 64 bits Encoder Key
SEED1 14: 60 bits Encoder Seed Value
SYNC1 00: 20 bits
00: 18 bits
Encoder Synchronization Counter (CNTSEL=1)
Encoder Synchronization Counter (CTNSEL = 0) plus overflow
SER1 10: 32 bits Encoder Serial Number
DISC1 1C: 10 bits Encoder Discrimination value
MSEL1 1C: ---- 3--2 Transmission Modulation
Format
Value Format
00b PWM
01b Manchester
10b VPWM
11b PPM
HSEL1 1C: ---4 ---- Header Select 4 TE = 0 10 TE = 1
XSER1 1C: --5- ---- Extended Serial Number 28 bits = 0 32 bits = 1
QUEN1 1C: -6-- ---- Queue Counter Enable Disable = 0 Enable = 1
STEN1 1C: 7--- ---- Start/Stop Pulse Enable Disable = 0 Enable = 1
LEDBL1 3F: -6-- ---- Low-Voltage LED Blink Never = 0 Once = 1
LEDOS1 3F: 7--- ---- LED On-Time Select(1)
50 ms = 0 100 ms = 1
SDLM1 3C: ---- ---0 Limited Seed Disable = 0 Enable = 1
SDEN1 3C: ---- --1- Seed Enable Disable = 0 Enable = 1
SDMD1 00: 7--- ---- Seed Mode User = 0 Production = 1
SDBT1 14: 7654 ---- Seed Button Code
SDTM1 3C: ---- 32-- Time Before Seed Code
Word(1)
Value Time (s)
00b 0.0
01b 0.8
10b 1.6
11b 3.2
BSEL1 3C: --54 ---- Transmission Baud Rate
Select(1)
Value TE (μs)
00b 100
01b 200
10b 400
11b 800
GSEL1 3C: 76-- ---- Guard Time Select(1)
Value Time (ms)
00b 0.0
01b 6.4
10b 51.2
11b 102.4
Note 1: All Timing values vary ±10%.
PKE Transmitter-Transponder
© 2006 Microchip Technology Inc. DS21986A-page 24
TABLE 3-4: ENCODER 2 (SHIFT = 1)
Symbol
Address
(Bits)
Description(1)
KEY2 34: 64 bits Encoder Key
SEED2 2A: 60 bits Encoder Seed Value
SYNC2 08: 20 bits
08: 18 bits
Encoder Synchronization Counter (CNTSEL = 1)
Encoder Synchronization Counter (CTNSEL = 0) plus overflow
SER2 26: 32 bits Encoder Serial Number
DISC2 32: 10 bits Encoder Discrimination value
MSEL2 32: ---- 3--2 Transmission Modulation
Format
Value Format
00b PWM
01b Manchester
10b VPWM
11b PPM
HSEL2 32: ---4 ---- Header Select 4 TE = 0 10 TE = 1
XSER2 32: --5- ---- Extended Serial Number 28 bits = 0 32 bits = 1
QUEN2 32: -6-- ---- Queue Counter Enable Disable = 0 Enable = 1
STEN2 32: 7--- ---- Start/Stop Pulse Enable Disable = 0 Enable = 1
LEDBL2 3D: -6-- ---- Low-Voltage LED Blink Never = 0 Once = 1
LEDOS2 3D: 7--- ---- LED On-Time Select(1)
50 ms = 0 100 ms = 1
SDLM2 3E: ---- ---0 Limited Seed Disable = 0 Enable = 1
SDEN2 3E: ---- --1- Seed Enable Disable = 0 Enable = 1
SDMD2 08: 7--- ---- Seed Mode User = 0 Production = 1
SDBT2 2A: 7654 ---- Seed Button Code
SDTM2 3E: ---- 32-- Time Before Seed Code
Word(1)
Value Time (s)
00b 0.0
01b 0.8
10b 1.6
11b 3.2
BSEL2 3E: --54 ---- Transmission Baud Rate
Select(1)
Value TE (μs)
00b 100
01b 200
10b 400
11b 800
GSEL2 3E: 76-- ---- Guard Time Select(1)
Value Time (ms)
00b 0.0
01b 6.4
10b 51.2
11b 102.4
Note 1: All Timing values vary ±10%.
PKE Reference Design User’s Manual
DS21986A-page 25 © 2006 Microchip Technology Inc.
TABLE 3-5: DEVICE OPTIONS
Symbol
Address
(Bits)
Description(1)
WAKE 3F: ---- --10 Wake-up(1)
Value Value
00b No Wake-up
01b 75 ms 50%
10b 50 ms 33.3%
11b 100 ms 16.6%
CNTSEL 3F: ---- -2-- Counter Select 16 bits = 0 20 bits = 1
VLOWL 3F: ---- 3--- Low-Voltage Latch Enable Disable = 0 Enable = 1
VLOWSEL 3F: ---4 ---- Low-Voltage Trip Point
Select(2)
2.2 V = 0 3.2V = 1
PLLSEL 3F: --5- ---- PLL Interface Select ASK = 0 FSK = 1
MTX 3D: ---- --10 Minimum Code Words Value Value
00b 1
01b 2
10b 4
11b 8
SLEEP 3D: ---- 3--- Sleep Output Enable Disable = 0 Enable = 1
WAIT 3D: ---- -2-- Wait for Step-Up Regulator Disable = 0 Enable = 1
TSEL 3D: --54 ---- Time-out Select(1)
Value Time(s)
00b Disabled
01b 0.8
10b 3.2
11b 25.6
S4CODE 40: --54 32-- Switch 4 Button Code
S5CODE 41: --54 32-- Switch 5 Button Code
PKECODE 42: --54 32-- PKE Challenge Received Code
Note 1: All Timing values vary ±10%.
2: Voltage thresholds are ±100 mV.
PKE REFERENCE DESIGN
USER’S MANUAL
© 2006 Microchip Technology Inc. DS21986A-page 26
Chapter 4. Remote Keyless Entry Receiver-Decoder Module
4.1 INTRODUCTION
The Remote Keyless Entry Receiver-Decoder module serves as a target board for RKE
and PKE transmissions. Visual indications of function codes, as well as, an in-vehicle
network interface are included.
This module consists of a UHF receiver, microcontroller, power supply, LED indicators
and a network physical interface.
FIGURE 4-1: RKE RECEIVER/DECODER
4.2 HARDWARE
4.2.1 UHF Receiver
The RF input is an AM super-regenerative compact hybrid module, which is used to
capture undecoded data from an AM Transmitter. This module has very high frequency
stability over a wide operating temperature and is tolerant of mechanical vibrations or
manual handling. A laser-trimmed, on-board inductor removes the need for any
adjustable components. Either 433.92 MHz or 315 MHz may be supplied with the
board. A CMOS/TTL output supports data rates up to 2000 Hz. This input to the
receiver module is connected to the microcontroller PORTA bit 2 INT pin. For more
information on the receiver module, see the Telecontrolli Data Sheets “DS.0015-1.pdf”
and “DS.0016-9.pdf” available on the PKE Reference Design CD-ROM (DS51575).
4.2.2 Microcontroller
a) The microcontroller can be any one of the 14-pin PICmicro®
microcontroller
family members, but it is usually a PIC16F636 or a PIC16F688. The
PIC16F636 has on-chip KEELOQ encoder/decoder hardware, while the
PIC16F688 has an Enhanced Addressable USART (EAUSART) that
supports the Local Interconnect Network (LIN) and SAE J2602 protocol. In
addition to the RF data input described above, the following table shows the
I/O port connections.
DataIN
Radio Rec.
Microcontroller
LEARN SW
Function LEDS
Transceiver
Bus
Network
LEARN LED
VLOW LED
PKE Reference Design User’s Manual
DS21986A-page 27 © 2006 Microchip Technology Inc.
TABLE 4-1: I/O CONNECTIONS
The microcontroller Flash program and EEPROM data memory may be programmed
through J2. This connector is pinout compatible with PICkit™
1 and PICkit™
2
programmers.
See the “PIC12F635/16F636/639 Data Sheet” (DS41232) or the “PIC16F688 Data
Sheet” (DS41203) for additional information.
4.2.3 Network Interface
This section of the board may not be populated, depending upon the end application.
If this section needs to be assembled, a complete bill of materials is available.
A MCP201 (or MCP202) LIN-bus transceiver is used for the physical slave bus driver
to connect to a LIN or J2602-compatible network. A Zener diode protects the LIN bus
pin from transient voltages. The capacitor between the LIN-bus pin and ground should
have its value adjusted for the particular network topology. A large pull-up resistor on
the FAULT/SLPS pin ensures that the device resets to a standard slope control profile.
See the “MCP201 LIN Transceiver with Voltage Regulator Data Sheet” (DS21730) for
more information.
4.2.4 Power Supply
Power can be supplied to the board by way of either a J3 (5.5 mm x 2.5 mm) power jack
or through J1 (AMP 770969). Voltage should be in the range of 8-18 VDC. The automo-
tive-grade voltage regulator is reverse-battery, transient and load-dump protected.
To reduce power consumption in key-off situations, the power-on LED may be
removed.
PORT Pin Function Notes
Inputs
RA0 Jumper E2 to GND, available to user ICSP™
Data
RA2 RF Data input
RA3 LEARN push button input ICSP MCLR
Outputs
RA4 LEARN mode active LED
RA5 VLOW LED
RC0 S0 Function LED
RC1 S1 Function LED
RC2 S2 Function LED
RC3 S3 Function LED
Network Transceiver
RA1 Chip Select output ICSP Clock
RC4 TX output
RC5 RX input
Note: When programming the module, remove Jumpers 1 and 2. Replace after
verification.
Remote Keyless Entry Receiver-Decoder Module
© 2006 Microchip Technology Inc. DS21986A-page 28
4.2.5 Connectors
FIGURE 4-2: J1 SYSTEM CONNECTOR
FIGURE 4-3: J2 PROGRAMMING CONNECTOR
FIGURE 4-4: J3 POWER CONNECTOR
1
2
3
4
5
6
no connection
no connection
no connection
+12 VDC VBAT
LIN Bidirectional BUS
Chassis GND
1
2
3
4
5
6
MCLR
VCC
ICSPDAT
no connection
VSS
ICSPCLK
+12 VDC VBAT
CHASSIS GND
PKE Reference Design User’s Manual
DS21986A-page 29 © 2006 Microchip Technology Inc.
FIGURE 4-5: SCHEMATIC – TRANSPONDER KEY FOB
LINbus
V
CC
V
CC
V
BB
V
CC
V
CC
V
BB
V
CC
S0
S1
S3
S2
VLOW
LEARN
ON
Can
be
replaced
with
PIC16F688
for
LIN
applications
Can
be
replaced
with
MCP202
or
-315
C4
.01
uF
C4
.01
R4
1K
R4
1K
DS4
LED
DS4
LED
R3
1K
R3
1K
+
C1
10
uF
+
C1
10
R8
1K
R8
1K
DS3
LED
DS3
LED
R1
1K
R1
1K
R6
1K
R6
1K
R2
10K
R2
10K
D1
1N4004
D1
1N4004
LIN
6
RX
1
TX
4
CS/WAKE
2
GND
5
V
BAT
7
V
D
D
3
FAULT/SLPS
8
MCP201
U3
MCP201
U3
ANT1
ANT1
S1
S1
+
1
+
3
+
5
+
2
+
4
+
6
J1
J1
R7
1K
R7
1K
D2
1N4755
43V
D2
1N4755
43V
+
C3
0.1
uF
+
C3
0.1
R10
100K
R10
100K
1
2
3
4
5
6
J2
J2
C6
220
pF
C6
220
DS2
LED
DS2
LED
1 2
E1
E1
DS6
LED
DS6
LED
DS1
LED
DS1
LED
D3
1N4750
27V
D3
1N4750
27V
R9
1K
R9
1K
LED1
Green
LED
LED1
Green
LED
C5
1.0
C5
1.0
IN
1
OUT
3
GND 2
REG1
LM2937IMP-5.0
REG1
LM2937IMP-5.0
V
C
C
1
GND
2
ANT
3
NC
4
NC
5
NC
6
GND
7
NC
8
NC
9
V
C
C
10
GND
11
V
C
C
12
TEST
13
OUT
14
V
C
C
15
U1
AMRRS3-433
U1
AMRRS3-433
1 2
E2
E2
DS5
LED
DS5
LED
RA5/OSC1
2
RA4/OSC2
3
RA3/MCLR
4
RA2/C1OUT/INT
11
RA1/CIN-
12
RA0/CIN+
13
RC0/C2IN+
10
RC4/C2OUT
6
RC5
5
RC3
7
RC1/C2IN-
9
RC2
8
U2
PIC16F636
U2
PIC16F636
+
C2
10
uF
+
C2
10
R5
1K
R5
1K
J3
J3
Not
assembled
with
PIC16F636
Remote Keyless Entry Receiver-Decoder Module
© 2006 Microchip Technology Inc. DS21986A-page 30
4.3 SOFTWARE
The firmware is derived from Microchip Application Note AN743, “Modular PICmicro®
Mid-Range MCU Code Hopping Decoder” (DS00743). Originally written for a
PIC16CE624, the code has been ported to the PIC16F6XX family of devices.
The program implements a KEELOQ code hopping decoder. The software has been
designed as a set of almost independent modules (standard assembly include files
“*.INC”). For clarity and ease of maintenance, each module covers a single simple
function and can be replaced to accommodate different behavior and/or support a
different set of peripherals (memories, timers, etc.).
The set of modules presented in this application note implements the following
features:
• Interrupt driven Radio Receiver (PWM) routine
• Uses internal EEPROM memory to learn up to 16 transmitters
• Supports Normal Learn mode
• Compatible with all existing KEELOQ code hopping encoders with PWM
transmission format selected, operating in “medium mode” (Te = 200 μs)
• Uses internal 8 MHz oscillator (self-calibrating during receive)
4.3.1 Modules Overview
The code presented in this application note is composed of the following basic modules:
The software has been modified to include four assemble-time conditional options.
Select Processor, enable only one below:
#DEFINE P12F635 1 ;Sets environment for PIC12F635
#DEFINE P16F636 1 ;Sets environment for PIC16F636
Select PORTA push buttons to be connected to ground with internal pull-ups OR,
connected to VCC with internal pull-downs:
#DEFINE pullup 1 ;Set to select pull-ups on PORT A.
;For pull-downs, comment out
Since the In-Circuit-Emulator can not properly handle Sleep:
#DEFINE ICEmul 1 ;Is set, device will not SLEEP, but will
;loop forever
Select option not to Encrypt:
#DEFINE NoEncryption 1
File Name Function
CHECKSN.ASM Substituted for KEELOQ
®
decryption files
FASTDEC.INC(1)
KEELOQ
®
decryption routine
KEYGEN.INC(1)
KEELOQ
®
decryption key generation routines implementing Normal
mode
MEM-63X.INC Encapsulates PIC16F636 EEPROM drivers
MID.ASM The actual initialization and main loop
RXI.INC Interrupt driven receiver
TABLE.INC Transmitters table memory management (linear list)
Note 1: These files are not included in the general distribution set. They are available on
the KEELOQ decoder license CD-ROM (DS40038) through your local Microchip
Sales Office.
PKE Reference Design User’s Manual
DS21986A-page 31 © 2006 Microchip Technology Inc.
FIGURE 4-6: MODULES OVERVIEW DIAGRAM
TMR0
RXI.INC
1st Buffer X
BFFULL
Flag
Radio Rec
Receive Buffer CSR
MID.ASM
Main Loop
Interrupt
Learn
Out S0
Out S3
LED
VLOW
KEY64.Inc
Manufacturer Code
KEYGEN.INC
- Normal KEY GEN
- Manufacturer Code Load
CheckSN.asm(1)
TABLE.INC
- Insert
- Search
MEM-62X.INC
- RD Word
- WR Word
EEPROM
KEELOQ® decoder(1)
FL62X.ASM
FASTDEC.INC
- Decrypt
-OR-
Note 1: Substitute for KEELOQ decoder decryption files.
Remote Keyless Entry Receiver-Decoder Module
© 2006 Microchip Technology Inc. DS21986A-page 32
FIGURE 4-7: CODE WORD DATA FORMAT
FIGURE 4-8: CODE WORD DATA FORMAT, NO ENCRYPTION
Fixed Code Portion (32 Bits)
CRC
2 Bits
VLOW
1Bit
Serial Number
(28 Bits)
C1 C0 S2 S1 S0 S3
BUT
4 Bits
Counter
Overflow
2 Bits
DISC
10 Bits
Synchronization
16 Bits
Counter
15 0
S1
S2 S0 S3 OVR1 OVR0
Transmission Direction LSb First
Hopping Code Portion (32 Bits)
With XSER = 0, 16-bit Counter, QUEN = 0
Status Information
(3 Bits)
BUT
4 Bits
Fixed Code Portion (64 Bits)
CRC
2 Bits
VLOW
1Bit
Serial Number 1
(28 Bits)
C1 C0 S2 S1 S0 S3
BUT
4 Bits
S1
S2 S0 S3
Transmission Direction LSb First
With XSER = 0, 16-bit Counter, QUEN = 0, S<3:0> not equal ‘0111’
Status Information
(3 Bits)
BUT
4 Bits
Serial Number 2
(16 Bits)
USER1
4 Bits
USER0
8 Bits
Data 71h Data 72h
DS21986A-page 33 © 2006 Microchip Technology Inc.
AMERICAS
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://support.microchip.com
Web Address:
www.microchip.com
Atlanta
Alpharetta, GA
Tel: 770-640-0034
Fax: 770-640-0307
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Farmington Hills, MI
Tel: 248-538-2250
Fax: 248-538-2260
Kokomo
Kokomo, IN
Tel: 765-864-8360
Fax: 765-864-8387
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
San Jose
Mountain View, CA
Tel: 650-215-1444
Fax: 650-961-0286
Toronto
Mississauga, Ontario,
Canada
Tel: 905-673-0699
Fax: 905-673-6509
ASIA/PACIFIC
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8528-2100
Fax: 86-10-8528-2104
China - Chengdu
Tel: 86-28-8676-6200
Fax: 86-28-8676-6599
China - Fuzhou
Tel: 86-591-8750-3506
Fax: 86-591-8750-3521
China - Hong Kong SAR
Tel: 852-2401-1200
Fax: 852-2401-3431
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
China - Shenzhen
Tel: 86-755-8203-2660
Fax: 86-755-8203-1760
China - Shunde
Tel: 86-757-2839-5507
Fax: 86-757-2839-5571
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
China - Xian
Tel: 86-29-8833-7250
Fax: 86-29-8833-7256
ASIA/PACIFIC
India - Bangalore
Tel: 91-80-2229-0061
Fax: 91-80-2229-0062
India - New Delhi
Tel: 91-11-5160-8631
Fax: 91-11-5160-8632
India - Pune
Tel: 91-20-2566-1512
Fax: 91-20-2566-1513
Japan - Yokohama
Tel: 81-45-471- 6166
Fax: 81-45-471-6122
Korea - Gumi
Tel: 82-54-473-4301
Fax: 82-54-473-4302
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
Malaysia - Penang
Tel: 60-4-646-8870
Fax: 60-4-646-5086
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
Taiwan - Hsin Chu
Tel: 886-3-572-9526
Fax: 886-3-572-6459
Taiwan - Kaohsiung
Tel: 886-7-536-4818
Fax: 886-7-536-4803
Taiwan - Taipei
Tel: 886-2-2500-6610
Fax: 886-2-2508-0102
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
EUROPE
Austria - Wels
Tel: 43-7242-2244-399
Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
UK - Wokingham
Tel: 44-118-921-5869
Fax: 44-118-921-5820
WORLDWIDE SALES AND SERVICE
10/31/05

More Related Content

What's hot

nonClonableID™ Reader SX21 User Manual
nonClonableID™ Reader SX21 User ManualnonClonableID™ Reader SX21 User Manual
nonClonableID™ Reader SX21 User ManualBilcareltd
 
IRJET- Smart Vehicle Security System using Finger Print Sensor
IRJET- Smart Vehicle Security System using Finger Print SensorIRJET- Smart Vehicle Security System using Finger Print Sensor
IRJET- Smart Vehicle Security System using Finger Print SensorIRJET Journal
 
FINGERPRINT BASED LOCKER WITH IMAGE CAPTURE
FINGERPRINT BASED LOCKER WITH IMAGE CAPTUREFINGERPRINT BASED LOCKER WITH IMAGE CAPTURE
FINGERPRINT BASED LOCKER WITH IMAGE CAPTUREMichael George
 
Why TPM in Automotive?
Why TPM in Automotive?Why TPM in Automotive?
Why TPM in Automotive?Alan Tatourian
 
The samsung knox platform 0
The samsung knox platform 0The samsung knox platform 0
The samsung knox platform 0Javier Gonzalez
 
Data Sheet Del 16 F870
Data Sheet Del 16 F870Data Sheet Del 16 F870
Data Sheet Del 16 F870Nataly Paredes
 
아보PDA ARBOR Gladius5 2D 5.5인치 안드로이드 산업용PDA 바코드PDA 매뉴얼
아보PDA ARBOR Gladius5 2D 5.5인치 안드로이드 산업용PDA 바코드PDA 매뉴얼아보PDA ARBOR Gladius5 2D 5.5인치 안드로이드 산업용PDA 바코드PDA 매뉴얼
아보PDA ARBOR Gladius5 2D 5.5인치 안드로이드 산업용PDA 바코드PDA 매뉴얼HION IT
 
Laptop Lenovo ThinkPad E470 - Laptop Doanh Nghiệp đáng mua
Laptop Lenovo ThinkPad E470 - Laptop Doanh Nghiệp đáng muaLaptop Lenovo ThinkPad E470 - Laptop Doanh Nghiệp đáng mua
Laptop Lenovo ThinkPad E470 - Laptop Doanh Nghiệp đáng muaLAPTOP TRẦN PHÁT
 

What's hot (10)

DRAFT
DRAFTDRAFT
DRAFT
 
nonClonableID™ Reader SX21 User Manual
nonClonableID™ Reader SX21 User ManualnonClonableID™ Reader SX21 User Manual
nonClonableID™ Reader SX21 User Manual
 
IRJET- Smart Vehicle Security System using Finger Print Sensor
IRJET- Smart Vehicle Security System using Finger Print SensorIRJET- Smart Vehicle Security System using Finger Print Sensor
IRJET- Smart Vehicle Security System using Finger Print Sensor
 
FINGERPRINT BASED LOCKER WITH IMAGE CAPTURE
FINGERPRINT BASED LOCKER WITH IMAGE CAPTUREFINGERPRINT BASED LOCKER WITH IMAGE CAPTURE
FINGERPRINT BASED LOCKER WITH IMAGE CAPTURE
 
Why TPM in Automotive?
Why TPM in Automotive?Why TPM in Automotive?
Why TPM in Automotive?
 
journal
journaljournal
journal
 
The samsung knox platform 0
The samsung knox platform 0The samsung knox platform 0
The samsung knox platform 0
 
Data Sheet Del 16 F870
Data Sheet Del 16 F870Data Sheet Del 16 F870
Data Sheet Del 16 F870
 
아보PDA ARBOR Gladius5 2D 5.5인치 안드로이드 산업용PDA 바코드PDA 매뉴얼
아보PDA ARBOR Gladius5 2D 5.5인치 안드로이드 산업용PDA 바코드PDA 매뉴얼아보PDA ARBOR Gladius5 2D 5.5인치 안드로이드 산업용PDA 바코드PDA 매뉴얼
아보PDA ARBOR Gladius5 2D 5.5인치 안드로이드 산업용PDA 바코드PDA 매뉴얼
 
Laptop Lenovo ThinkPad E470 - Laptop Doanh Nghiệp đáng mua
Laptop Lenovo ThinkPad E470 - Laptop Doanh Nghiệp đáng muaLaptop Lenovo ThinkPad E470 - Laptop Doanh Nghiệp đáng mua
Laptop Lenovo ThinkPad E470 - Laptop Doanh Nghiệp đáng mua
 

Similar to Ds 21986 a

Similar to Ds 21986 a (20)

Pt100
Pt100Pt100
Pt100
 
Mplab c18 libraries_51297f
Mplab c18 libraries_51297fMplab c18 libraries_51297f
Mplab c18 libraries_51297f
 
PICDEM2PlusUserGuide.pdf
PICDEM2PlusUserGuide.pdfPICDEM2PlusUserGuide.pdf
PICDEM2PlusUserGuide.pdf
 
C18 user guide_51288j
C18 user guide_51288jC18 user guide_51288j
C18 user guide_51288j
 
C18 user guide_51288j
C18 user guide_51288jC18 user guide_51288j
C18 user guide_51288j
 
Hitech picc manual
Hitech picc manualHitech picc manual
Hitech picc manual
 
C18 c compiler user guide
C18 c compiler user guideC18 c compiler user guide
C18 c compiler user guide
 
C18 manual
C18 manualC18 manual
C18 manual
 
51419a
51419a51419a
51419a
 
C30 users guide_51284f
C30 users guide_51284fC30 users guide_51284f
C30 users guide_51284f
 
Ww1.microchip.com downloads en_device_doc_39662b
Ww1.microchip.com downloads en_device_doc_39662bWw1.microchip.com downloads en_device_doc_39662b
Ww1.microchip.com downloads en_device_doc_39662b
 
Pic 16f877a
Pic 16f877aPic 16f877a
Pic 16f877a
 
datasheet-micro.pdf
datasheet-micro.pdfdatasheet-micro.pdf
datasheet-micro.pdf
 
819 data sheet
819 data sheet819 data sheet
819 data sheet
 
Data Sheet Del 16 F870
Data Sheet Del 16 F870Data Sheet Del 16 F870
Data Sheet Del 16 F870
 
Pic18f4550
Pic18f4550Pic18f4550
Pic18f4550
 
Pic16 f676
Pic16 f676Pic16 f676
Pic16 f676
 
PIC Microcontroller
PIC MicrocontrollerPIC Microcontroller
PIC Microcontroller
 
6datasheets
6datasheets6datasheets
6datasheets
 
675
675675
675
 

Recently uploaded

(办理学位证)(Rice毕业证)莱斯大学毕业证成绩单修改留信学历认证原版一模一样
(办理学位证)(Rice毕业证)莱斯大学毕业证成绩单修改留信学历认证原版一模一样(办理学位证)(Rice毕业证)莱斯大学毕业证成绩单修改留信学历认证原版一模一样
(办理学位证)(Rice毕业证)莱斯大学毕业证成绩单修改留信学历认证原版一模一样gfghbihg
 
UNIT-III-TRANSMISSION SYSTEMS REAR AXLES
UNIT-III-TRANSMISSION SYSTEMS REAR AXLESUNIT-III-TRANSMISSION SYSTEMS REAR AXLES
UNIT-III-TRANSMISSION SYSTEMS REAR AXLESDineshKumar4165
 
2024 WRC Hyundai World Rally Team’s i20 N Rally1 Hybrid
2024 WRC Hyundai World Rally Team’s i20 N Rally1 Hybrid2024 WRC Hyundai World Rally Team’s i20 N Rally1 Hybrid
2024 WRC Hyundai World Rally Team’s i20 N Rally1 HybridHyundai Motor Group
 
Call Girls in Karachi | +923081633338 | Karachi Call Girls
Call Girls in Karachi  | +923081633338 | Karachi Call GirlsCall Girls in Karachi  | +923081633338 | Karachi Call Girls
Call Girls in Karachi | +923081633338 | Karachi Call GirlsAyesha Khan
 
Call Girls Vastrapur 7397865700 Ridhima Hire Me Full Night
Call Girls Vastrapur 7397865700 Ridhima Hire Me Full NightCall Girls Vastrapur 7397865700 Ridhima Hire Me Full Night
Call Girls Vastrapur 7397865700 Ridhima Hire Me Full Nightssuser7cb4ff
 
VIP Kolkata Call Girl Kasba 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kasba 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kasba 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kasba 👉 8250192130 Available With Roomdivyansh0kumar0
 
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGER
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGERUNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGER
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGERDineshKumar4165
 
Digamma - CertiCon Team Skills and Qualifications
Digamma - CertiCon Team Skills and QualificationsDigamma - CertiCon Team Skills and Qualifications
Digamma - CertiCon Team Skills and QualificationsMihajloManjak
 
如何办理爱尔兰都柏林大学毕业证(UCD毕业证) 成绩单原版一比一
如何办理爱尔兰都柏林大学毕业证(UCD毕业证) 成绩单原版一比一如何办理爱尔兰都柏林大学毕业证(UCD毕业证) 成绩单原版一比一
如何办理爱尔兰都柏林大学毕业证(UCD毕业证) 成绩单原版一比一mjyguplun
 
如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一
如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一
如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一hnfusn
 
(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样
(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样
(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样gfghbihg
 
(办理学位证)墨尔本大学毕业证(Unimelb毕业证书)成绩单留信学历认证原版一模一样
(办理学位证)墨尔本大学毕业证(Unimelb毕业证书)成绩单留信学历认证原版一模一样(办理学位证)墨尔本大学毕业证(Unimelb毕业证书)成绩单留信学历认证原版一模一样
(办理学位证)墨尔本大学毕业证(Unimelb毕业证书)成绩单留信学历认证原版一模一样whjjkkk
 
如何办理迈阿密大学毕业证(UM毕业证)成绩单留信学历认证原版一比一
如何办理迈阿密大学毕业证(UM毕业证)成绩单留信学历认证原版一比一如何办理迈阿密大学毕业证(UM毕业证)成绩单留信学历认证原版一比一
如何办理迈阿密大学毕业证(UM毕业证)成绩单留信学历认证原版一比一ga6c6bdl
 
定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一
定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一
定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一fhhkjh
 
定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一
定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一
定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一meq5nzfnk
 
Dubai Call Girls Size E6 (O525547819) Call Girls In Dubai
Dubai Call Girls  Size E6 (O525547819) Call Girls In DubaiDubai Call Girls  Size E6 (O525547819) Call Girls In Dubai
Dubai Call Girls Size E6 (O525547819) Call Girls In Dubaikojalkojal131
 
Beautiful Vip Call Girls Punjabi Bagh 9711199012 Call /Whatsapps
Beautiful Vip  Call Girls Punjabi Bagh 9711199012 Call /WhatsappsBeautiful Vip  Call Girls Punjabi Bagh 9711199012 Call /Whatsapps
Beautiful Vip Call Girls Punjabi Bagh 9711199012 Call /Whatsappssapnasaifi408
 

Recently uploaded (20)

(办理学位证)(Rice毕业证)莱斯大学毕业证成绩单修改留信学历认证原版一模一样
(办理学位证)(Rice毕业证)莱斯大学毕业证成绩单修改留信学历认证原版一模一样(办理学位证)(Rice毕业证)莱斯大学毕业证成绩单修改留信学历认证原版一模一样
(办理学位证)(Rice毕业证)莱斯大学毕业证成绩单修改留信学历认证原版一模一样
 
Indian Downtown Call Girls # 00971528903066 # Indian Call Girls In Downtown D...
Indian Downtown Call Girls # 00971528903066 # Indian Call Girls In Downtown D...Indian Downtown Call Girls # 00971528903066 # Indian Call Girls In Downtown D...
Indian Downtown Call Girls # 00971528903066 # Indian Call Girls In Downtown D...
 
UNIT-III-TRANSMISSION SYSTEMS REAR AXLES
UNIT-III-TRANSMISSION SYSTEMS REAR AXLESUNIT-III-TRANSMISSION SYSTEMS REAR AXLES
UNIT-III-TRANSMISSION SYSTEMS REAR AXLES
 
2024 WRC Hyundai World Rally Team’s i20 N Rally1 Hybrid
2024 WRC Hyundai World Rally Team’s i20 N Rally1 Hybrid2024 WRC Hyundai World Rally Team’s i20 N Rally1 Hybrid
2024 WRC Hyundai World Rally Team’s i20 N Rally1 Hybrid
 
Hot Sexy call girls in Pira Garhi🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Pira Garhi🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Pira Garhi🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Pira Garhi🔝 9953056974 🔝 escort Service
 
Call Girls in Karachi | +923081633338 | Karachi Call Girls
Call Girls in Karachi  | +923081633338 | Karachi Call GirlsCall Girls in Karachi  | +923081633338 | Karachi Call Girls
Call Girls in Karachi | +923081633338 | Karachi Call Girls
 
sauth delhi call girls in Connaught Place🔝 9953056974 🔝 escort Service
sauth delhi call girls in  Connaught Place🔝 9953056974 🔝 escort Servicesauth delhi call girls in  Connaught Place🔝 9953056974 🔝 escort Service
sauth delhi call girls in Connaught Place🔝 9953056974 🔝 escort Service
 
Call Girls Vastrapur 7397865700 Ridhima Hire Me Full Night
Call Girls Vastrapur 7397865700 Ridhima Hire Me Full NightCall Girls Vastrapur 7397865700 Ridhima Hire Me Full Night
Call Girls Vastrapur 7397865700 Ridhima Hire Me Full Night
 
VIP Kolkata Call Girl Kasba 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kasba 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kasba 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kasba 👉 8250192130 Available With Room
 
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGER
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGERUNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGER
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGER
 
Digamma - CertiCon Team Skills and Qualifications
Digamma - CertiCon Team Skills and QualificationsDigamma - CertiCon Team Skills and Qualifications
Digamma - CertiCon Team Skills and Qualifications
 
如何办理爱尔兰都柏林大学毕业证(UCD毕业证) 成绩单原版一比一
如何办理爱尔兰都柏林大学毕业证(UCD毕业证) 成绩单原版一比一如何办理爱尔兰都柏林大学毕业证(UCD毕业证) 成绩单原版一比一
如何办理爱尔兰都柏林大学毕业证(UCD毕业证) 成绩单原版一比一
 
如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一
如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一
如何办理(UQ毕业证书)昆士兰大学毕业证毕业证成绩单原版一比一
 
(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样
(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样
(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样
 
(办理学位证)墨尔本大学毕业证(Unimelb毕业证书)成绩单留信学历认证原版一模一样
(办理学位证)墨尔本大学毕业证(Unimelb毕业证书)成绩单留信学历认证原版一模一样(办理学位证)墨尔本大学毕业证(Unimelb毕业证书)成绩单留信学历认证原版一模一样
(办理学位证)墨尔本大学毕业证(Unimelb毕业证书)成绩单留信学历认证原版一模一样
 
如何办理迈阿密大学毕业证(UM毕业证)成绩单留信学历认证原版一比一
如何办理迈阿密大学毕业证(UM毕业证)成绩单留信学历认证原版一比一如何办理迈阿密大学毕业证(UM毕业证)成绩单留信学历认证原版一比一
如何办理迈阿密大学毕业证(UM毕业证)成绩单留信学历认证原版一比一
 
定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一
定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一
定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一
 
定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一
定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一
定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一
 
Dubai Call Girls Size E6 (O525547819) Call Girls In Dubai
Dubai Call Girls  Size E6 (O525547819) Call Girls In DubaiDubai Call Girls  Size E6 (O525547819) Call Girls In Dubai
Dubai Call Girls Size E6 (O525547819) Call Girls In Dubai
 
Beautiful Vip Call Girls Punjabi Bagh 9711199012 Call /Whatsapps
Beautiful Vip  Call Girls Punjabi Bagh 9711199012 Call /WhatsappsBeautiful Vip  Call Girls Punjabi Bagh 9711199012 Call /Whatsapps
Beautiful Vip Call Girls Punjabi Bagh 9711199012 Call /Whatsapps
 

Ds 21986 a

  • 1. © 2006 Microchip Technology Inc. DS21986A Passive Keyless Entry (PKE) Reference Design User’s Manual
  • 2. DS21986A-page ii © 2006 Microchip Technology Inc. Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WAR- RANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer’s risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights. Trademarks The Microchip name and logo, the Microchip logo, Accuron, dsPIC, KEELOQ, microID, MPLAB, PIC, PICmicro, PICSTART, PRO MATE, PowerSmart, rfPIC and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. AmpLab, FilterLab, Migratable Memory, MXDEV, MXLAB, SEEVAL, SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. Analog-for-the-Digital Age, Application Maestro, dsPICDEM, dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, Linear Active Thermistor, MPASM, MPLIB, MPLINK, MPSIM, PICkit, PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, Real ICE, rfLAB, rfPICDEM, Select Mode, Smart Serial, SmartTel, Total Endurance, UNI/O, WiperLock and Zena are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. © 2006, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. Note the following details of the code protection feature on Microchip devices: • Microchip products meet the specification contained in their particular Microchip Data Sheet. • Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. • There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. • Microchip is willing to work with the customer who is concerned about the integrity of their code. • Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.” Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act. Microchip received ISO/TS-16949:2002 quality system certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona and Mountain View, California in October 2003. The Company’s quality system processes and procedures are for its PICmicro® 8-bit MCUs, KEELOQ® code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified.
  • 3. PKE REFERENCE DESIGN USER’S MANUAL © 2006 Microchip Technology Inc. DS21986A-page iii Table of Contents Preface ........................................................................................................................... 1 Chapter 1. System Overview 1.1 Overview ........................................................................................................ 6 1.2 Operational Overview ..................................................................................... 7 1.3 Features ......................................................................................................... 7 1.3.1 LF Initiator ................................................................................................... 7 1.3.2 Key Fob ....................................................................................................... 7 1.3.3 RF Receiver ................................................................................................ 8 1.4 Reference Documents .................................................................................... 8 Chapter 2. Low-Frequency Initiator Module 2.1 Introduction ................................................................................................... 10 2.2 Hardware ...................................................................................................... 10 2.2.1 Microcontroller ........................................................................................... 10 2.2.2 Configurable Inputs ................................................................................... 10 2.2.3 LF Transmitter ........................................................................................... 10 2.2.4 Network Interfaces .................................................................................... 10 2.2.5 Power ........................................................................................................ 10 2.3 Software ....................................................................................................... 12 Chapter 3. PKE Transmitter-Transponder 3.1 Introduction ................................................................................................... 14 3.2 Hardware ...................................................................................................... 14 3.2.1 Transmitter ................................................................................................ 15 3.3 Software ....................................................................................................... 17 3.3.1 Dual Encoder Operation ............................................................................ 20 3.3.2 Code Hopping Code Word Data Format ................................................... 20 3.3.3 EEPROM Organization ............................................................................. 23 Chapter 4. Remote Keyless Entry Receiver-Decoder Module 4.1 Introduction ................................................................................................... 26 4.2 Hardware ...................................................................................................... 26 4.2.1 UHF Receiver ............................................................................................ 26 4.2.2 Microcontroller ........................................................................................... 26 4.2.3 Network Interface ...................................................................................... 27 4.2.4 Power Supply ............................................................................................ 27 4.2.5 Connectors ................................................................................................ 28 4.3 Software ....................................................................................................... 30 4.3.1 Modules Overview ..................................................................................... 30 Worldwide Sales and Service .................................................................................... 33
  • 4. PKE Reference Design User’s Manual DS21986A-page iv © 2006 Microchip Technology Inc. NOTES:
  • 5. PKE REFERENCE DESIGN USER’S MANUAL © 2006 Microchip Technology Inc. DS21986A-page 1 Preface INTRODUCTION This chapter contains general information that will be useful to know before using the PKE Reference Design. Items discussed in this chapter include: • Document Layout • Conventions Used in this Guide • Recommended Reading • The Microchip Web Site • Customer Support DOCUMENT LAYOUT This document describes a Passive Keyless Entry (PKE) system upgrade to an existing Remote Keyless Entry (RKE) application. The manual layout is as follows: • Chapter 1. “System Overview” – Describes the PKE system upgrade to an existing Remote Keyless Entry (RKE) application overview. • Chapter 2. “Low-Frequency Initiator Module” – Describes the Low-Frequency Magnetic Transmitter. • Chapter 3. “PKE Transmitter-Transponder” – Describes the Remote Keyless Entry unit as a solution for Passive and RKE Keyless Entry applications. • Chapter 4. “Remote Keyless Entry Receiver-Decoder Module” – Describes the Remote Keyless Entry Receiver-Decoder module as a target board for RKE and PKE message transmissions. NOTICE TO CUSTOMERS All documentation becomes dated, and this manual is no exception. Microchip tools and documentation are constantly evolving to meet customer needs, so some actual dialogs and/or tool descriptions may differ from those in this document. Please refer to our web site (www.microchip.com) to obtain the latest documentation available. Documents are identified with a “DS” number. This number is located on the bottom of each page, in front of the page number. The numbering convention for the DS number is “DSXXXXXA”, where “XXXXX” is the document number and “A” is the revision level of the document. For the most up-to-date information on development tools, see the MPLAB® IDE on-line help. Select the Help menu, and then Topics to open a list of available on-line help files.
  • 6. Preface © 2006 Microchip Technology Inc. DS21986A-page 2 CONVENTIONS USED IN THIS GUIDE This manual uses the following documentation conventions: DOCUMENTATION CONVENTIONS RECOMMENDED READING It is recommended that you become familiar with the documents listed below, prior to using the PKE Reference Design Kit. PICkit™ 2 Microcontroller Programmer User’s Guide (DS51553) Consult this document for instructions on how to use the PICkit 2 Microcontroller Programmer hardware and software. AMHRRQ3-433 Telecontrolli Data Sheet (DS.0015-1.pdf) AMHRR3-433 Telecontrolli Data Sheet (DS.0016-9.pdf) PIC12F635/PIC16F636/639 Data Sheet (DS41232) Data sheet for the PIC12F635/PIC16F636/639 8/14-pin Flash-based, 8-bit CMOS microcontrollers with nanoWatt technology. PIC16F688 Data Sheet (DS41203) Data sheet for the PIC16F688 14-pin Flash-based 8-bit CMOS microcontrollers with nanoWatt technology. Description Represents Examples Code (Courier font): Plain characters Sample code Filenames and paths #define START c:autoexec.bat Angle brackets: < > Variables <label>, <exp> Square brackets [ ] Optional arguments MPASMWIN [main.asm] Curly brackets and pipe character: { | } Choice of mutually exclusive argu- ments; An OR selection errorlevel {0|1} Lowercase characters in quotes Type of data “filename” Ellipses... Used to imply (but not show) addi- tional text that is not relevant to the example list [“list_option..., “list_option”] 0xnnn A hexadecimal number where n is a hexadecimal digit 0xFFFF, 0x007A Italic characters A variable argument; it can be either a type of data (in lowercase characters) or a specific example (in uppercase characters). char isascii (char, ch); Interface (Arial font): Underlined, italic text with right arrow A menu selection from the menu bar File > Save Bold characters A window or dialog button to click OK, Cancel Characters in angle brackets < > A key on the keyboard <Tab>, <Ctrl-C> Documents (Arial font): Italic characters Referenced books MPLAB® IDE User’s Guide
  • 7. PKE Reference Design User’s Manual DS21986A-page 3 © 2006 Microchip Technology Inc. MCP201 LIN Transceiver with Voltage Regulator Data Sheet (DS21730) Data sheet for the MCP201 LIN transceiver. Gives an overview of the device including modes of operation and electrical characteristics. Modular PICmicro® Mid-Range MCU Code Hopping Decoder Application Note AN742 (DS00742) Application note describes a KEELOQ code hopping decoder implemented on a Microchip mid-range PICmicro microcontroller. Using the PIC16F639 MCU for Smart Wireless Applications Application Note AN959 (DS00959) Application note describing the PIC16F639 as a suitable microcontroller for bidirectional communications and low-frequency sensing applications. HCS365 Data Sheet (DS41109) Data sheet for the HCS365 KEELOQ code hopping encoder. Low-Frequency Magnetic Transmitter Design Application Note AN232 (DS00232 Application note covering the basic aspects to consider when designing the transmitter portion of a LFMC link. PIC18F2585/2680/4585/4680 Data Sheet (DS39625) Data sheet for the PIC18F2585/2680/4585/4680 28/40/44-pin enhanced Flash microcontrollers with ECAN™ technology, 10-bit A/D and nanoWatt technology. TC4421/TC4422 9A High-Speed MOSFET Drivers Data Sheet (DS21420) Data sheet for the TC4421/TC4422 9A High-Speed MOSFET Driver. Gives an overview of the device including electrical characteristics.
  • 8. Preface © 2006 Microchip Technology Inc. DS21986A-page 4 THE MICROCHIP WEB SITE Microchip provides online support via our web site at www.microchip.com. This web site is used as a means to make files and information easily available to customers. Accessible by using your favorite Internet browser, the web site contains the following information: • Product Support – Data sheets and errata, application notes and sample programs, design resources, user’s guides and hardware support documents, latest software releases and archived software • General Technical Support – Frequently Asked Questions (FAQs), technical support requests, online discussion groups, Microchip consultant program member listing • Business of Microchip – Product Selector Guide, latest Microchip press releases, listing of seminars and events, listings of Microchip sales offices, distributors and factory representatives CUSTOMER SUPPORT Users of Microchip products can receive assistance through several channels: • Distributor or Representative • Local Sales Office • Field Application Engineer (FAE) • Technical Support • Development Systems Information Line Customers should contact their distributor, representative or field application engineer (FAE) for support. Local sales offices are also available to help customers. A listing of sales offices and locations is included in the back of this document. Technical support is available through the web site at: http://support.microchip.com
  • 9. PKE Reference Design User’s Manual DS21986A-page 5 © 2006 Microchip Technology Inc. NOTES:
  • 10. PKE REFERENCE DESIGN USER’S MANUAL © 2006 Microchip Technology Inc. DS21986A-page 6 Chapter 1. System Overview 1.1 OVERVIEW This manual describes a Passive Keyless Entry (PKE) system upgrade to an existing Remote Keyless Entry (RKE) application. The key fob design contains a PIC16F639 with a integrated three-axis Analog Front-End (AFE). The Low-Frequency Initiator is implemented in a PIC18F2680. This design has been optimized to integrate into an existing model platform without substantial modification. Operational flexibility is the key to the overall concept with many scalable features that are end-of-line programmable by customer, dealer or factory. FIGURE 1-1: PKE BLOCK DIAGRAM LF Initiator Trigger KEY FOB 3-Axis RF Transmitter Encoder RKE Receiver AFE RF Receiver Decoder Drivers Buttons On-Vehicle LIN Lock Actuator 125 kHz 434 MHz
  • 11. PKE Reference Design User’s Manual DS21986A-page 7 © 2006 Microchip Technology Inc. 1.2 OPERATIONAL OVERVIEW When the Low-Frequency (LF) Initiator detects a trigger input, a coded 125 kHz message is transmitted. Any transponder within range of this signal receives this message and validates the coded data field. If the Initiator is recognized, a RF (433.92 MHz) KEELOQ ® encoded message is transmitted. A standard RKE receiver decodes this packet and, if recognized, the appropriate action is taken. To reduce current consumption, the LF Initiator does not poll for transponders continuously. A trigger event wakes the initiator from Sleep or Power-down (see Figure 1-1). The trigger input can be any type or source such as: • Commanded over one of the networks • Infra-red under door handle • Simple microswitch activated by the door handle mechanism • Capacitive proximity detector sensing a change in a field by a hand approaching the handle The application described herein uses a microswitch input for simplicity. As delivered, the LF initiator will continuously poll for the transponder. This is to facilitate orientation and range evaluation. The transponder key fob can operate as a regular push button RKE fob. When a valid LF field message is sensed, the microcontroller responds as if a sixth phantom button were pushed and transmits a unique function code. The RF Receiver/Decoder combination can include a KEELOQ Security IC. Typical decoders are the HCS500, HCS512 or HCS515. In the case of this design, a custom-programmed PICmicro® mid-range microcontroller was used. 1.3 FEATURES 1.3.1 LF Initiator Refer to Microchip Application Note AN232, “Low-Frequency Magnetic Transmitter Design” (DS00232). Features of the LF Initiator are as follows: • Commanded by various types of inputs • Simple momentary switch • Proximity detector • Serial-numbered challenge • CAN and LIN network support 1.3.2 Key Fob Refer to Microchip Application Note AN959, “Using the PIC16F639 MCU for Smart Wireless Applications” (DS00959). Features of the key fob are as follows: • Functionally compatible with Microchip’s HCS365 encoder • Supports up to five push button inputs • Two LED outputs for valid button and valid low-frequency challenge indication
  • 12. System Overview © 2006 Microchip Technology Inc. DS21986A-page 8 1.3.3 RF Receiver Refer to Microchip Application Note AN742 “Modular PICmicro® Mid-Range MCU Code Hopping Decoder” (DS00742). Features of the RF Receiver are as follows: • Supports two manufacturer’s codes • Compatible with Microchip’s HCS200, HCS201, HCS300, HCS301, HCS360 and HCS361 encoders • Automatic baud rate detection • Automatic Normal or Secure learn detection • Six learnable transmitters 1.4 REFERENCE DOCUMENTS RF Receiver-Decoder 1. “AMHRRQ3-433” Telecontrolli Data Sheet, “DS.0015-1.pdf” 2. “AMHRR3-433” Telecontrolli Data Sheet, “DS.0016-9.pdf” 3. “PIC12F635/PIC16F636/639 Data Sheet” (DS41232), Microchip Technology Inc. 4. “PIC16F688 14-pin Flash-Based 8-Bit Data Sheet” (DS41203), Microchip Technology Inc. 5. “MCP201 LIN Transceiver with Voltage Regulator Data Sheet” (DS21730), Microchip Technology Inc. 6. “Modular PICmicro® Mid-Range MCU Code Hopping Decoder”, Application Note AN742 (DS00742), Microchip Technology Inc. RKE/PKE Key Fob 1. “PIC12F635/PIC16F636/639 Data Sheet” (DS41232), Microchip Technology Inc. 2. “Using the PIC16F639 MCU for Smart Wireless Applications”, Application Note AN959 (DS00959), Microchip Technology Inc. 3. “HCS365 Data Sheet” (DS41109), Microchip Technology Inc. 4. “Low-Frequency Magnetic Transmitter Design”, Application Note AN232 (DS00232), Microchip Technology Inc. LF Initiator 1. “PIC18F2585/2680/4585/4680 Data Sheet” (DS39625), Microchip Technology Inc. 2. “TC4421/TC4422 9A High-Speed MOSFET Drivers Data Sheet” (DS21420), Microchip Technology Inc. 3. “Low-Frequency Magnetic Transmitter Design”, Application Note AN232 (DS00232), Microchip Technology Inc.
  • 13. PKE Reference Design User’s Manual DS21986A-page 9 © 2006 Microchip Technology Inc. NOTES:
  • 14. PKE REFERENCE DESIGN USER’S MANUAL © 2006 Microchip Technology Inc. DS21986A-page 10 Chapter 2. Low-Frequency Initiator Module 2.1 INTRODUCTION The LF transmitter is derived from the design described in Application Note AN232, ”Low-Frequency Magnetic Transmitter Design” (DS00232). 2.2 HARDWARE 2.2.1 Microcontroller A PIC18F2680 was selected for the LF controller based on the wide range of peripherals available on the chip. The PIC18F2680 has both a CAN controller and a LIN-compatible EAUSART to interface to in-vehicle networks. The Capture/Compare/PWM module lends itself to generation of the 125 kHz square wave needed as the LF carrier. 2.2.2 Configurable Inputs Two 12V tolerant inputs are provided for triggers. Both of these PCB circuits can be reconfigured for a variety of input types. Refer to the schematic in Figure 2-1. For example, if one of the inputs is a momentary switch to ground: 1. Substitute a 0Ω resistor for R2. 2. Remove R3 and D3. 3. Replace D2 with a 30K resistor. 2.2.3 LF Transmitter A high-current MOSFET driver (TC4422) is driven by the PWM output of the microcontroller, and in turn, drives the resonant tank circuit consisting of TX coil (L1) and C2. This output circuit generates a magnetic field with a voltage of up to 320V peak-to-peak. 2.2.4 Network Interfaces Network connectivity is provided by a MCP201 LIN transceiver and a MCP2551 CAN transceiver. 2.2.5 Power Power can be supplied through either J1 power jack, J3 CAN plug or J4 LIN connection. Voltage should be in the range of 8-18 VDC. The automotive-grade voltage regulator is reverse-battery, transient and load-dump protected. To reduce power consumption in key-off situations, the power-on LED may be removed.
  • 15. PKE Reference Design User’s Manual DS21986A-page 11 © 2006 Microchip Technology Inc. FIGURE 2-1: SCHEMATIC – LOW-FREQUENCY INITIATOR PWM PWM V CC V CC V CC V CC +12 V DC V CC V CC +12 V DC V CC +12 V DC 400V P3476-ND R6 15K R6 15K R10 120 R10 120 L2 DO5022P L2 DO5022P D3 1N5819 D3 1N5819 C7 0.1 uF C7 0.1 Y1 20.0 MHz Y1 20.0 R5 1K R5 1K D5 1N5819 D5 1N5819 D8 10MQ100N D8 10MQ100N D7 10MQ100N D7 10MQ100N D2 1N5819 D2 1N5819 CANH 7 GND 2 CANL 6 V CC 3 TXD 1 RXD 4 REF 5 RS 8 U2 MCP2551 U2 MCP2551 C8 10 nF C8 10 LED2 YEL LED2 YEL D4 1N5819 D4 1N5819 J1 J1 R8 4.7K R8 4.7K C4 20 pF C4 20 C5 1.0 uF C5 1.0 C9 0.200LS C9 0.200LS D6 1N4148 D6 1N4148 1 3 5 2 4 6 J4 CON6A J4 CON6A C3 20 pF C3 20 C10 0.200LS C10 0.200LS MCLR 1 V CC 2 GND 3 RB7 4 RB6 5 RB3 6 J2 RJ11 J2 RJ11 IN 1 OUT 3 GND 2 VR1 LM2937ET-5.0 VR1 LM2937ET-5.0 C6 1.0 uF C6 1.0 1 TP1 TP1 R7 30K R7 30K R2 25K R2 25K R1 1K R1 1K 1 3 5 2 4 6 J3 CON6A J3 CON6A MCLR/V PP 1 OSC1/CLKIN 9 OSC2/CLKOUT 10 RA0/AN0 2 RA1/AN1 3 RA2/AN2/V REF - 4 RA3/AN3/V REF + 5 RA4/T0CLI 6 RA5/AN4/SS/LVDIN 7 RB0/INT0 21 RB1/INT1 22 RB2/CANTX 23 RB3/CANRX 24 RB4 25 RB5 26 RB6 27 RB7 28 RC0/T1OSO/T1CKI 11 RC1/T1OSI 12 RC2/CCP1 13 RC3/SCK/SCL 14 RC4/SDI/SDA 15 RC5/SDO 16 RC6/TX/CK 17 RC7/RX/DT 18 U1 PIC18F2680 U1 PIC18F2680 C1 10 μF C1 10 R4 25K R4 25K 3 V D D 6 V D D 2 GND 4 GND 5 OUT IN 1 U4 TC4422 U4 TC4422 D1 10MQ100N D1 10MQ100N D9 1N4750 D9 1N4750 L1 10-00189 L1 10-00189 LIN 6 RX 1 TX 4 CS/WAKE 2 GND 5 V BAT 7 V D D 3 FAULT/SLPS 8 MCP201 U3 MCP201 U3 R3 15K R3 15K LED1 GRN LED1 GRN C2 10 μF C2 10 R9 1K R9 1K High Voltage These two input circuits are set-up for +12-to-GND signals. To input a +5-to-0 signal, remove R3 or R6, replace R2 or R4 with 1K, and either put a 10K resistor across D2-D4 OR enable internal pull-ups in the microcontroller.
  • 16. Low-Frequency Initiator Module © 2006 Microchip Technology Inc. DS21986A-page 12 2.3 SOFTWARE The LF message shown in Figure 2-2 is transmitted when the trigger event is detected. As shown, the module will wait up to 50 ms after the challenge for a response from the RF Receiver module. This notification is sent over the LIN data line. If no response is received, the module will send the same message two more times, and then enter power-down, awaiting another trigger. FIGURE 2-2: LF CHALLENGE DATA FORMAT The LF challenge message consists of a 125 kHz carrier modulated as follows: 1: A 4 ms ON to settle the receiving AGC. 2: 500 μs OFF. 3: 2 ms ON followed by a 2 ms OFF to enable the receiver output filter. This pattern is dependant on the configuration setting of the receiving AFE. 4: 16 Least Significant bits (LSb) of the module serial number, PWM encoded (see Figure 2-3). 5: 50 ms OFF, waiting for a valid response from the RF receiver. The challenge code portion of the message is to ensure that only previously learned transponders are hailed. All others will remain silent. This challenge code may be expanded or reduced by changes to the firmware to address individual application requirements. For this design, 16 bits were deemed sufficient. FIGURE 2-3: CODE WORD DATA TRANSMISSION FORMAT (PWM) Transmission Direction LSb First Challenge Code Portion (16 Bits) Least Significant bits of Serial Number (16 Bits) 4 ms 125 kHz Base Frequency UHF Response Slot Wake-Up 125 kHz Preamble 500 μs 2 ms 2 ms 50 ms Guard Time LOGIC ‘0’ LOGIC ‘1’ Bit Period
  • 17. PKE Reference Design User’s Manual DS21986A-page 13 © 2006 Microchip Technology Inc. NOTES:
  • 18. PKE REFERENCE DESIGN USER’S MANUAL © 2006 Microchip Technology Inc. DS21986A-page 14 Chapter 3. PKE Transmitter-Transponder 3.1 INTRODUCTION The RKE Key Fob unit is a complete solution for PKE and RKE applications in a key fob type form factor. The board was designed to accept a PIC16F636 or a PIC16F639 microcontroller. With minor modifications, it will also support a PIC12F635. Some features of this design are: • Up to five push button inputs • One or two LED outputs • 433.92 MHz transmitter • 3-axis low-frequency receiver 3.2 HARDWARE A PIC16F636, installed pin 1 justified at location U1, will support RKE applications. Since the PIC16F636 shares the same pinout as the PIC16F639 on its upper most pins, the only function lost is the on-chip low-frequency analog front-end. For PKE applications, a PIC16F639 and the associated low-frequency receiver coils are installed. The four buttons (S1-S4) on the transmitters are connected to the appropriate inputs on the microcontroller (S1-S4). The user may activate any combination of encoder inputs transmitting any of the 15 possible function codes. The RFEN output option is not used by the demonstration transmitter and should be disabled as this function shares its output with a button input. If RFEN is enabled, the button input will be lost. See Section 3.3 “Software”. Button S5 is not directly associated with a specific function code bit, but rather transmits a user-defined function code stored in EEPROM data memory. The microcontroller Flash program and EEPROM data memory may be programmed through J1. This connector is pinout compatible with PICkit™ 1 and PICkit™ 2 programmers.
  • 19. PKE Reference Design User’s Manual DS21986A-page 15 © 2006 Microchip Technology Inc. TABLE 3-1: I/O CONNECTIONS 3.2.1 Transmitter The RF oscillator uses a Surface Acoustic Wave (SAW) resonator that operates at 433.92 MHz. The Programming Connector (J1) enables In-Circuit Serial Programming™ (ICSP™). The transmitter can therefore be re-configured or re-programmed without removing the microcontroller from the board. FIGURE 3-1: J1 PROGRAMMING CONNECTOR PORT Pin Function Notes Inputs RA0 Switch 5 ICSP™ Data RA1 LF Data Input ICSP Clock RA2 Switch 3 RA3 Switch 2 ICSP MCLR RA4 Switch 1 RA5 Switch 4 Outputs RC0 RF Active LED RC4 LF Challenge LED RC5 RF Data Out Others RC1 Internally connected on PIC16F639 not used on PIC16F636 RC2 Internally connected on PIC16F639 not used on PIC16F636 RC3 Internally and externally connected on PIC16F639 not used on PIC16F636 Note: The design and layout of this transmitter is not sufficient to ensure compliance with EC or FCC regulations. 1 2 3 4 5 6 MCLR VCC ICSPDAT no connection VSS ICSPCLK
  • 20. PKE Transmitter-Transponder © 2006 Microchip Technology Inc. DS21986A-page 16 FIGURE 3-2: SCHEMATIC – RF RECEIVER/DECODER USING THE PIC16F639 CSn ICSPCLK LFDATA ICSPDAT LCCOM LX LY PWM SCLK/ALERT LZ V CC V CC V CC V CC V CC V BAT V BAT V CC V CC Unlock Lock Shift Hazard Boot Active Challenge Do not assemble parts within dotted boxes for RKE-only application. Replace PIC16F639 with PIC16F636. 240 pF + 24 pF 220 R3 220 R3 220 pF CZ1 220 CZ1 3V/6V BT1 3V/6V BT1 C12 1.0 uF C12 1.0 SW2 SW2 7.1 mH LY1 7.1 LY1 10M R9 10M R9 C6 100 nF C6 100 R16 100k R16 100k NE94433 Q1 NE94433 Q1 D8 1N4148WS D8 1N4148WS 9.0 mH LX2 9.0 LX2 R12 1K R12 1K 100 nF C4 100 C4 SW5 SW5 5.1V D2 5.1V D2 4 GND 8 GND 2 IN 1 nc 3 nc 5 nc 7 nc 6 OUT 433.92 U2 433.92 MHz SAW U2 470 R20 470 R20 264 pF CX1 264 CX1 1.0 uF C5 1.0 C5 12 pF C3 12 C3 LED-RED D4 LED-RED D4 0 R8 0 R8 LED-GRN D5 LED-GRN D5 47K R2 47K R2 1.0 uF C11 1.0 C11 SW1 SW1 470 R19 470 R19 47 R1 47 R1 SW3 SW3 SW4 SW4 7.1 mH LZ1 7.1 LZ1 MA2S784 D1 MA2S784 D1 220 pF CY1 220 CY1 + 1 + 3 + 5 + 2 + 4 + 6 J1 J1 Antenna L1 Antenna L1 470 pF C1 470 C1 RA0/C1IN+ 19 RA1/C1IN- 18 RA2/C1OUT/INT 17 RA3/MCLR 4 RA4/OSC2 3 RA5/OSC1 2 V DDT 8 LCX 11 LCY 10 LCZ 9 LCCOM 12 RC0/C2IN+ 16 RC1/C2IN- 15 RC2 14 RC3 7 RC4/C2OUT 6 RC5 5 V SST 13 V CC 1 GND 20 U3 PIC16F639 U3 PIC16F639 2.0 pF C2 2.0 C2
  • 21. PKE Reference Design User’s Manual DS21986A-page 17 © 2006 Microchip Technology Inc. 3.3 SOFTWARE The transponder firmware is functionally based on the Microchip HCS365 KEELOQ encoder. See the “HCS365 Data Sheet” (DS41109) for more information. Additional routines have been added to initialize and interface to the internal low-frequency analog front-end of the PIC16F639. The transponder key fob operates as a standard 5-button RKE fob, when not being challenged by a Low-Frequency Initiator signal. The microcontroller responds as if a sixth or a phantom button were pushed, when a valid LF field message is sensed and verified. The transponder will normally be in a low-power Sleep mode. When a switch input is taken low or a LF challenge is received, the device will wake-up and go through debounce delay of 20 ms before the switch value is latched. The device will then read the configuration options and depending on the configuration options, it will determine what the data and modulation format will be for the transmission. The transmission will consist of a stream of code words. The code words are transmitted after the button is pressed and as long as the buttons are held down or a time out occurs. The code word format can be either a code hopping format or a seed format. The time-out time can be selected with the Time-out Select (TSEL) configuration option. This option allows the time out to be disabled or set to 0.8s, 3.2s or 25.6s. When a time out occurs, the device will go into Sleep mode to protect the battery from draining when a button gets stuck. If during the transmit process a new button is detected, the current code word will be aborted, a new code word will be transmitted and the time-out counter will reset. If all the buttons are released, a minimum number of code words will still be completed. The minimum code words can be set to 1, 2, 4 or 8 using the minimum code words (MTX) configuration option. If the time for transmitting the minimum code words is longer than the time-out time, the device will not complete the minimum code words. A summary table of all the options is given in Section 3.3.3 “EEPROM Organization”. Note 1: The transponder is initially supplied pre-programmed with the KEELOQ encryption algorithm. The program memory and EEPROM data memory are read-protected. 2: The software source files supplied on the CD with this transponder have the KEELOQ encryption routines deleted. If a new hex file is assembled using these source files and programmed into the microcontroller, the original KEELOQ hopping code will be overwritten and lost. 3: Contact Microchip Technology for information about KEELOQ Security ICs and licensing options.
  • 22. PKE Transmitter-Transponder © 2006 Microchip Technology Inc. DS21986A-page 18 The software includes four assemble-time conditional options. These options are enabled by removing the semi-colon in column 1 of the code line. Select Processor, enable only one below: #DEFINE P12F635 1 ;Sets environment for PIC12F635 #DEFINE P16F636 1 ;Sets environment for PIC16F636 #DEFINE P16F639 1 ;Sets environment for PIC16F639 Select PORTA buttons to be connected to ground with internal pull-ups OR, connected to VCC with internal pull-downs: #DEFINE pullup 1 ;Set to select pull-ups on PORT A. ;For pull-downs, comment out. Since the in-circuit emulator does not support Sleep: #DEFINE ICEmul 1 ;Is set, device will not SLEEP, but will ;loop forever Select option not to Encrypt: #DEFINE NoEncryption 1
  • 23. PKE Reference Design User’s Manual DS21986A-page 19 © 2006 Microchip Technology Inc. FIGURE 3-3: FLOWCHART – DEVICE OPERATION Start Sample Increment Seed Time Out? Encrypt No No Yes Get Config TX? Counter Transmit MTX? No Buttons? Seed Time? Read Seed Stop Yes Yes No Yes No No Yes Yes Yes Seed Button? No New Buttons? No LF No Yes Data? Receive Valid No Yes Request? Buttons Challenge
  • 24. PKE Transmitter-Transponder © 2006 Microchip Technology Inc. DS21986A-page 20 3.3.1 Dual Encoder Operation The transponder contains two transmitter Configuration Words, serial numbers, encoder keys, discrimination values, counters and seed values. This means that the transponder can be used as two independent encoders. The code word is calculated using one of two possible encoder configurations. Most options for code word and modulation formats can be different from Encoder 1 and Encoder 2, but LED and RF transmitter options have to be the same. The Shift input pin is used to select between the encoder configurations. A low on the Shift pin will select Encoder 1 and a high will select Encoder 2. 3.3.2 Code Hopping Code Word Data Format A code hopping code word consists of 32 bits of code hopping data, 32 bits of fixed code and between 3 and 5 bits of status information. Various code word formats are shown in Figure 3-4 for KEELOQ encoder compatible transmissions.
  • 25. PKE Reference Design User’s Manual DS21986A-page 21 © 2006 Microchip Technology Inc. FIGURE 3-4: CODE WORD DATA FORMAT Fixed Code Portion (32 Bits) CRC 2 Bits VLOW 1 Bit Serial Number (28 Bits) C1 C0 S2 S1 S0 S3 BUT 4 Bits Counter Overflow 2 Bits DISC 10 Bits Synchronization 16 Bits Counter 15 0 S1 S2 S0 S3 OVR1 OVR0 Transmission Direction LSb First Hopping Code Portion (32 Bits) With XSER = 0, 16-bit Counter, QUEN = 0 Status Information (3 Bits) BUT 4 Bits Fixed Code Portion (32 Bits) QUE 2 Bits CRC 2 Bits VLOW 1 Bit Serial Number (32 Bits) Q1 Q0 C1 C0 BUT 4 Bits Counter Overflow 2 Bits DISC 10 Bits Synchronization 16 Bits Counter 15 0 S2 S1 S0 S3 OVR1 OVR0 Hopping Code Portion (32 Bits) With XSER = 1, 16-bit Counter, QUEN = 1 Status Information (5 Bits) Fixed Code Portion (32 Bits) QUE 2 Bits CRC 2 Bits VLOW 1 Bit Serial Number (28 Bits) Q1 Q0 C1 C0 S2 S1 S0 S3 BUT 4 Bits DISC 8 Bits Synchronization 20 Bits Counter 19 0 S2 S1 S0 S3 Hopping Code Portion (32 Bits) With XSER = 0, 20-bit Counter, QUEN = 1 Status Information (5 Bits) BUT 4 Bits Fixed Code Portion (32 Bits) CRC 2 Bits VLOW 1 Bit Serial Number (32 Bits) C1 C0 BUT 4 Bits DISC 8 Bits Synchronization 20 Bits Counter 19 0 S2 S1 S0 S3 Hopping Code Portion (32 Bits) With XSER = 1, 20-bit Counter, QUEN = 0 Status Information (3 Bits)
  • 26. PKE Transmitter-Transponder © 2006 Microchip Technology Inc. DS21986A-page 22 FIGURE 3-5: CODE WORD DATA FORMAT, NO ENCRYPTION TABLE 3-2: FUNCTION CODES Button Function S0 F[xx1x] S1 F[x1xx] S2 F[1xxx] S3 F[xxx1] S4 User Programmable LF Challenge User Programmable Note 1: The function code is repeated in the encrypted and unencrypted data of a transmission. Fixed Code Portion (64 Bits) CRC 2 Bits VLOW 1 Bit Serial Number 1 (28 Bits) C1 C0 S2 S1 S0 S3 BUT 4 Bits S1 S2 S0 S3 Transmission Direction LSb First With XSER = 0, 16-bit Counter, QUEN = 0, S<3:0> not equal ‘0111’ Status Information (3 Bits) BUT 4 Bits Serial Number 2 (16 Bits) Fixed Code Portion (64 Bits) QUE 2 Bits CRC 2 Bits VLOW 1 Bit Serial Number (32 Bits) Q1 Q0 C1 C0 BUT 4 Bits S2 S1 S0 S3 With XSER = 1, 16-bit Counter, QUEN = 1, S<3:0> not equal ‘0111’ Status Information (5 Bits) USER1 4 Bits USER0 8 Bits Data 71h Data 72h Serial Number 2 (16 Bits) USER1 4 Bits USER0 8 Bits Data 71h Data 72h Fixed Code Portion (64 Bits) CRC 2 Bits VLOW 1 Bit Serial Number 1 (28 Bits) C1 C0 S2 S1 S0 S3 BUT 4 Bits S1 S2 S0 S3 With XSER = 0, 16-bit Counter, QUEN = 0, S<3:0> equal ‘0111’ Status Information (3 Bits) BUT 4 Bits Serial Number 2 (32 Bits) Fixed Code Portion (64 Bits) QUE 2 Bits CRC 2 Bits VLOW 1 Bit Serial Number (32 Bits) Q1 Q0 C1 C0 BUT 4 Bits S2 S1 S0 S3 With XSER = 1, 16-bit Counter, QUEN = 1, S<3:0> equal ‘0111’ Status Information (5 Bits) Serial Number 2 (32 Bits)
  • 27. PKE Reference Design User’s Manual DS21986A-page 23 © 2006 Microchip Technology Inc. 3.3.3 EEPROM Organization A summary of the transponder EEPROM organization is shown in Tables 3-3, 3-4 and 3-5. The address column shows the starting address of the option and its length, or bit position. Options larger than 8 bits are stored with the MSb at the given address, and enough consecutive 8-bit blocks are reserved for the entire option size. Options such as SEED, which has a length that is not an exact multiple of 8 bits, are stored right justified in the reserved space such that additional smaller options, like SDBT, may be stored in the same address as the MSb. TABLE 3-3: ENCODER 1 (SHIFT = 0) Symbol Address (Bits) Description(1) KEY1 1E: 64 bits Encoder Key SEED1 14: 60 bits Encoder Seed Value SYNC1 00: 20 bits 00: 18 bits Encoder Synchronization Counter (CNTSEL=1) Encoder Synchronization Counter (CTNSEL = 0) plus overflow SER1 10: 32 bits Encoder Serial Number DISC1 1C: 10 bits Encoder Discrimination value MSEL1 1C: ---- 3--2 Transmission Modulation Format Value Format 00b PWM 01b Manchester 10b VPWM 11b PPM HSEL1 1C: ---4 ---- Header Select 4 TE = 0 10 TE = 1 XSER1 1C: --5- ---- Extended Serial Number 28 bits = 0 32 bits = 1 QUEN1 1C: -6-- ---- Queue Counter Enable Disable = 0 Enable = 1 STEN1 1C: 7--- ---- Start/Stop Pulse Enable Disable = 0 Enable = 1 LEDBL1 3F: -6-- ---- Low-Voltage LED Blink Never = 0 Once = 1 LEDOS1 3F: 7--- ---- LED On-Time Select(1) 50 ms = 0 100 ms = 1 SDLM1 3C: ---- ---0 Limited Seed Disable = 0 Enable = 1 SDEN1 3C: ---- --1- Seed Enable Disable = 0 Enable = 1 SDMD1 00: 7--- ---- Seed Mode User = 0 Production = 1 SDBT1 14: 7654 ---- Seed Button Code SDTM1 3C: ---- 32-- Time Before Seed Code Word(1) Value Time (s) 00b 0.0 01b 0.8 10b 1.6 11b 3.2 BSEL1 3C: --54 ---- Transmission Baud Rate Select(1) Value TE (μs) 00b 100 01b 200 10b 400 11b 800 GSEL1 3C: 76-- ---- Guard Time Select(1) Value Time (ms) 00b 0.0 01b 6.4 10b 51.2 11b 102.4 Note 1: All Timing values vary ±10%.
  • 28. PKE Transmitter-Transponder © 2006 Microchip Technology Inc. DS21986A-page 24 TABLE 3-4: ENCODER 2 (SHIFT = 1) Symbol Address (Bits) Description(1) KEY2 34: 64 bits Encoder Key SEED2 2A: 60 bits Encoder Seed Value SYNC2 08: 20 bits 08: 18 bits Encoder Synchronization Counter (CNTSEL = 1) Encoder Synchronization Counter (CTNSEL = 0) plus overflow SER2 26: 32 bits Encoder Serial Number DISC2 32: 10 bits Encoder Discrimination value MSEL2 32: ---- 3--2 Transmission Modulation Format Value Format 00b PWM 01b Manchester 10b VPWM 11b PPM HSEL2 32: ---4 ---- Header Select 4 TE = 0 10 TE = 1 XSER2 32: --5- ---- Extended Serial Number 28 bits = 0 32 bits = 1 QUEN2 32: -6-- ---- Queue Counter Enable Disable = 0 Enable = 1 STEN2 32: 7--- ---- Start/Stop Pulse Enable Disable = 0 Enable = 1 LEDBL2 3D: -6-- ---- Low-Voltage LED Blink Never = 0 Once = 1 LEDOS2 3D: 7--- ---- LED On-Time Select(1) 50 ms = 0 100 ms = 1 SDLM2 3E: ---- ---0 Limited Seed Disable = 0 Enable = 1 SDEN2 3E: ---- --1- Seed Enable Disable = 0 Enable = 1 SDMD2 08: 7--- ---- Seed Mode User = 0 Production = 1 SDBT2 2A: 7654 ---- Seed Button Code SDTM2 3E: ---- 32-- Time Before Seed Code Word(1) Value Time (s) 00b 0.0 01b 0.8 10b 1.6 11b 3.2 BSEL2 3E: --54 ---- Transmission Baud Rate Select(1) Value TE (μs) 00b 100 01b 200 10b 400 11b 800 GSEL2 3E: 76-- ---- Guard Time Select(1) Value Time (ms) 00b 0.0 01b 6.4 10b 51.2 11b 102.4 Note 1: All Timing values vary ±10%.
  • 29. PKE Reference Design User’s Manual DS21986A-page 25 © 2006 Microchip Technology Inc. TABLE 3-5: DEVICE OPTIONS Symbol Address (Bits) Description(1) WAKE 3F: ---- --10 Wake-up(1) Value Value 00b No Wake-up 01b 75 ms 50% 10b 50 ms 33.3% 11b 100 ms 16.6% CNTSEL 3F: ---- -2-- Counter Select 16 bits = 0 20 bits = 1 VLOWL 3F: ---- 3--- Low-Voltage Latch Enable Disable = 0 Enable = 1 VLOWSEL 3F: ---4 ---- Low-Voltage Trip Point Select(2) 2.2 V = 0 3.2V = 1 PLLSEL 3F: --5- ---- PLL Interface Select ASK = 0 FSK = 1 MTX 3D: ---- --10 Minimum Code Words Value Value 00b 1 01b 2 10b 4 11b 8 SLEEP 3D: ---- 3--- Sleep Output Enable Disable = 0 Enable = 1 WAIT 3D: ---- -2-- Wait for Step-Up Regulator Disable = 0 Enable = 1 TSEL 3D: --54 ---- Time-out Select(1) Value Time(s) 00b Disabled 01b 0.8 10b 3.2 11b 25.6 S4CODE 40: --54 32-- Switch 4 Button Code S5CODE 41: --54 32-- Switch 5 Button Code PKECODE 42: --54 32-- PKE Challenge Received Code Note 1: All Timing values vary ±10%. 2: Voltage thresholds are ±100 mV.
  • 30. PKE REFERENCE DESIGN USER’S MANUAL © 2006 Microchip Technology Inc. DS21986A-page 26 Chapter 4. Remote Keyless Entry Receiver-Decoder Module 4.1 INTRODUCTION The Remote Keyless Entry Receiver-Decoder module serves as a target board for RKE and PKE transmissions. Visual indications of function codes, as well as, an in-vehicle network interface are included. This module consists of a UHF receiver, microcontroller, power supply, LED indicators and a network physical interface. FIGURE 4-1: RKE RECEIVER/DECODER 4.2 HARDWARE 4.2.1 UHF Receiver The RF input is an AM super-regenerative compact hybrid module, which is used to capture undecoded data from an AM Transmitter. This module has very high frequency stability over a wide operating temperature and is tolerant of mechanical vibrations or manual handling. A laser-trimmed, on-board inductor removes the need for any adjustable components. Either 433.92 MHz or 315 MHz may be supplied with the board. A CMOS/TTL output supports data rates up to 2000 Hz. This input to the receiver module is connected to the microcontroller PORTA bit 2 INT pin. For more information on the receiver module, see the Telecontrolli Data Sheets “DS.0015-1.pdf” and “DS.0016-9.pdf” available on the PKE Reference Design CD-ROM (DS51575). 4.2.2 Microcontroller a) The microcontroller can be any one of the 14-pin PICmicro® microcontroller family members, but it is usually a PIC16F636 or a PIC16F688. The PIC16F636 has on-chip KEELOQ encoder/decoder hardware, while the PIC16F688 has an Enhanced Addressable USART (EAUSART) that supports the Local Interconnect Network (LIN) and SAE J2602 protocol. In addition to the RF data input described above, the following table shows the I/O port connections. DataIN Radio Rec. Microcontroller LEARN SW Function LEDS Transceiver Bus Network LEARN LED VLOW LED
  • 31. PKE Reference Design User’s Manual DS21986A-page 27 © 2006 Microchip Technology Inc. TABLE 4-1: I/O CONNECTIONS The microcontroller Flash program and EEPROM data memory may be programmed through J2. This connector is pinout compatible with PICkit™ 1 and PICkit™ 2 programmers. See the “PIC12F635/16F636/639 Data Sheet” (DS41232) or the “PIC16F688 Data Sheet” (DS41203) for additional information. 4.2.3 Network Interface This section of the board may not be populated, depending upon the end application. If this section needs to be assembled, a complete bill of materials is available. A MCP201 (or MCP202) LIN-bus transceiver is used for the physical slave bus driver to connect to a LIN or J2602-compatible network. A Zener diode protects the LIN bus pin from transient voltages. The capacitor between the LIN-bus pin and ground should have its value adjusted for the particular network topology. A large pull-up resistor on the FAULT/SLPS pin ensures that the device resets to a standard slope control profile. See the “MCP201 LIN Transceiver with Voltage Regulator Data Sheet” (DS21730) for more information. 4.2.4 Power Supply Power can be supplied to the board by way of either a J3 (5.5 mm x 2.5 mm) power jack or through J1 (AMP 770969). Voltage should be in the range of 8-18 VDC. The automo- tive-grade voltage regulator is reverse-battery, transient and load-dump protected. To reduce power consumption in key-off situations, the power-on LED may be removed. PORT Pin Function Notes Inputs RA0 Jumper E2 to GND, available to user ICSP™ Data RA2 RF Data input RA3 LEARN push button input ICSP MCLR Outputs RA4 LEARN mode active LED RA5 VLOW LED RC0 S0 Function LED RC1 S1 Function LED RC2 S2 Function LED RC3 S3 Function LED Network Transceiver RA1 Chip Select output ICSP Clock RC4 TX output RC5 RX input Note: When programming the module, remove Jumpers 1 and 2. Replace after verification.
  • 32. Remote Keyless Entry Receiver-Decoder Module © 2006 Microchip Technology Inc. DS21986A-page 28 4.2.5 Connectors FIGURE 4-2: J1 SYSTEM CONNECTOR FIGURE 4-3: J2 PROGRAMMING CONNECTOR FIGURE 4-4: J3 POWER CONNECTOR 1 2 3 4 5 6 no connection no connection no connection +12 VDC VBAT LIN Bidirectional BUS Chassis GND 1 2 3 4 5 6 MCLR VCC ICSPDAT no connection VSS ICSPCLK +12 VDC VBAT CHASSIS GND
  • 33. PKE Reference Design User’s Manual DS21986A-page 29 © 2006 Microchip Technology Inc. FIGURE 4-5: SCHEMATIC – TRANSPONDER KEY FOB LINbus V CC V CC V BB V CC V CC V BB V CC S0 S1 S3 S2 VLOW LEARN ON Can be replaced with PIC16F688 for LIN applications Can be replaced with MCP202 or -315 C4 .01 uF C4 .01 R4 1K R4 1K DS4 LED DS4 LED R3 1K R3 1K + C1 10 uF + C1 10 R8 1K R8 1K DS3 LED DS3 LED R1 1K R1 1K R6 1K R6 1K R2 10K R2 10K D1 1N4004 D1 1N4004 LIN 6 RX 1 TX 4 CS/WAKE 2 GND 5 V BAT 7 V D D 3 FAULT/SLPS 8 MCP201 U3 MCP201 U3 ANT1 ANT1 S1 S1 + 1 + 3 + 5 + 2 + 4 + 6 J1 J1 R7 1K R7 1K D2 1N4755 43V D2 1N4755 43V + C3 0.1 uF + C3 0.1 R10 100K R10 100K 1 2 3 4 5 6 J2 J2 C6 220 pF C6 220 DS2 LED DS2 LED 1 2 E1 E1 DS6 LED DS6 LED DS1 LED DS1 LED D3 1N4750 27V D3 1N4750 27V R9 1K R9 1K LED1 Green LED LED1 Green LED C5 1.0 C5 1.0 IN 1 OUT 3 GND 2 REG1 LM2937IMP-5.0 REG1 LM2937IMP-5.0 V C C 1 GND 2 ANT 3 NC 4 NC 5 NC 6 GND 7 NC 8 NC 9 V C C 10 GND 11 V C C 12 TEST 13 OUT 14 V C C 15 U1 AMRRS3-433 U1 AMRRS3-433 1 2 E2 E2 DS5 LED DS5 LED RA5/OSC1 2 RA4/OSC2 3 RA3/MCLR 4 RA2/C1OUT/INT 11 RA1/CIN- 12 RA0/CIN+ 13 RC0/C2IN+ 10 RC4/C2OUT 6 RC5 5 RC3 7 RC1/C2IN- 9 RC2 8 U2 PIC16F636 U2 PIC16F636 + C2 10 uF + C2 10 R5 1K R5 1K J3 J3 Not assembled with PIC16F636
  • 34. Remote Keyless Entry Receiver-Decoder Module © 2006 Microchip Technology Inc. DS21986A-page 30 4.3 SOFTWARE The firmware is derived from Microchip Application Note AN743, “Modular PICmicro® Mid-Range MCU Code Hopping Decoder” (DS00743). Originally written for a PIC16CE624, the code has been ported to the PIC16F6XX family of devices. The program implements a KEELOQ code hopping decoder. The software has been designed as a set of almost independent modules (standard assembly include files “*.INC”). For clarity and ease of maintenance, each module covers a single simple function and can be replaced to accommodate different behavior and/or support a different set of peripherals (memories, timers, etc.). The set of modules presented in this application note implements the following features: • Interrupt driven Radio Receiver (PWM) routine • Uses internal EEPROM memory to learn up to 16 transmitters • Supports Normal Learn mode • Compatible with all existing KEELOQ code hopping encoders with PWM transmission format selected, operating in “medium mode” (Te = 200 μs) • Uses internal 8 MHz oscillator (self-calibrating during receive) 4.3.1 Modules Overview The code presented in this application note is composed of the following basic modules: The software has been modified to include four assemble-time conditional options. Select Processor, enable only one below: #DEFINE P12F635 1 ;Sets environment for PIC12F635 #DEFINE P16F636 1 ;Sets environment for PIC16F636 Select PORTA push buttons to be connected to ground with internal pull-ups OR, connected to VCC with internal pull-downs: #DEFINE pullup 1 ;Set to select pull-ups on PORT A. ;For pull-downs, comment out Since the In-Circuit-Emulator can not properly handle Sleep: #DEFINE ICEmul 1 ;Is set, device will not SLEEP, but will ;loop forever Select option not to Encrypt: #DEFINE NoEncryption 1 File Name Function CHECKSN.ASM Substituted for KEELOQ ® decryption files FASTDEC.INC(1) KEELOQ ® decryption routine KEYGEN.INC(1) KEELOQ ® decryption key generation routines implementing Normal mode MEM-63X.INC Encapsulates PIC16F636 EEPROM drivers MID.ASM The actual initialization and main loop RXI.INC Interrupt driven receiver TABLE.INC Transmitters table memory management (linear list) Note 1: These files are not included in the general distribution set. They are available on the KEELOQ decoder license CD-ROM (DS40038) through your local Microchip Sales Office.
  • 35. PKE Reference Design User’s Manual DS21986A-page 31 © 2006 Microchip Technology Inc. FIGURE 4-6: MODULES OVERVIEW DIAGRAM TMR0 RXI.INC 1st Buffer X BFFULL Flag Radio Rec Receive Buffer CSR MID.ASM Main Loop Interrupt Learn Out S0 Out S3 LED VLOW KEY64.Inc Manufacturer Code KEYGEN.INC - Normal KEY GEN - Manufacturer Code Load CheckSN.asm(1) TABLE.INC - Insert - Search MEM-62X.INC - RD Word - WR Word EEPROM KEELOQ® decoder(1) FL62X.ASM FASTDEC.INC - Decrypt -OR- Note 1: Substitute for KEELOQ decoder decryption files.
  • 36. Remote Keyless Entry Receiver-Decoder Module © 2006 Microchip Technology Inc. DS21986A-page 32 FIGURE 4-7: CODE WORD DATA FORMAT FIGURE 4-8: CODE WORD DATA FORMAT, NO ENCRYPTION Fixed Code Portion (32 Bits) CRC 2 Bits VLOW 1Bit Serial Number (28 Bits) C1 C0 S2 S1 S0 S3 BUT 4 Bits Counter Overflow 2 Bits DISC 10 Bits Synchronization 16 Bits Counter 15 0 S1 S2 S0 S3 OVR1 OVR0 Transmission Direction LSb First Hopping Code Portion (32 Bits) With XSER = 0, 16-bit Counter, QUEN = 0 Status Information (3 Bits) BUT 4 Bits Fixed Code Portion (64 Bits) CRC 2 Bits VLOW 1Bit Serial Number 1 (28 Bits) C1 C0 S2 S1 S0 S3 BUT 4 Bits S1 S2 S0 S3 Transmission Direction LSb First With XSER = 0, 16-bit Counter, QUEN = 0, S<3:0> not equal ‘0111’ Status Information (3 Bits) BUT 4 Bits Serial Number 2 (16 Bits) USER1 4 Bits USER0 8 Bits Data 71h Data 72h
  • 37. DS21986A-page 33 © 2006 Microchip Technology Inc. AMERICAS Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: http://support.microchip.com Web Address: www.microchip.com Atlanta Alpharetta, GA Tel: 770-640-0034 Fax: 770-640-0307 Boston Westborough, MA Tel: 774-760-0087 Fax: 774-760-0088 Chicago Itasca, IL Tel: 630-285-0071 Fax: 630-285-0075 Dallas Addison, TX Tel: 972-818-7423 Fax: 972-818-2924 Detroit Farmington Hills, MI Tel: 248-538-2250 Fax: 248-538-2260 Kokomo Kokomo, IN Tel: 765-864-8360 Fax: 765-864-8387 Los Angeles Mission Viejo, CA Tel: 949-462-9523 Fax: 949-462-9608 San Jose Mountain View, CA Tel: 650-215-1444 Fax: 650-961-0286 Toronto Mississauga, Ontario, Canada Tel: 905-673-0699 Fax: 905-673-6509 ASIA/PACIFIC Australia - Sydney Tel: 61-2-9868-6733 Fax: 61-2-9868-6755 China - Beijing Tel: 86-10-8528-2100 Fax: 86-10-8528-2104 China - Chengdu Tel: 86-28-8676-6200 Fax: 86-28-8676-6599 China - Fuzhou Tel: 86-591-8750-3506 Fax: 86-591-8750-3521 China - Hong Kong SAR Tel: 852-2401-1200 Fax: 852-2401-3431 China - Qingdao Tel: 86-532-8502-7355 Fax: 86-532-8502-7205 China - Shanghai Tel: 86-21-5407-5533 Fax: 86-21-5407-5066 China - Shenyang Tel: 86-24-2334-2829 Fax: 86-24-2334-2393 China - Shenzhen Tel: 86-755-8203-2660 Fax: 86-755-8203-1760 China - Shunde Tel: 86-757-2839-5507 Fax: 86-757-2839-5571 China - Wuhan Tel: 86-27-5980-5300 Fax: 86-27-5980-5118 China - Xian Tel: 86-29-8833-7250 Fax: 86-29-8833-7256 ASIA/PACIFIC India - Bangalore Tel: 91-80-2229-0061 Fax: 91-80-2229-0062 India - New Delhi Tel: 91-11-5160-8631 Fax: 91-11-5160-8632 India - Pune Tel: 91-20-2566-1512 Fax: 91-20-2566-1513 Japan - Yokohama Tel: 81-45-471- 6166 Fax: 81-45-471-6122 Korea - Gumi Tel: 82-54-473-4301 Fax: 82-54-473-4302 Korea - Seoul Tel: 82-2-554-7200 Fax: 82-2-558-5932 or 82-2-558-5934 Malaysia - Penang Tel: 60-4-646-8870 Fax: 60-4-646-5086 Philippines - Manila Tel: 63-2-634-9065 Fax: 63-2-634-9069 Singapore Tel: 65-6334-8870 Fax: 65-6334-8850 Taiwan - Hsin Chu Tel: 886-3-572-9526 Fax: 886-3-572-6459 Taiwan - Kaohsiung Tel: 886-7-536-4818 Fax: 886-7-536-4803 Taiwan - Taipei Tel: 886-2-2500-6610 Fax: 886-2-2508-0102 Thailand - Bangkok Tel: 66-2-694-1351 Fax: 66-2-694-1350 EUROPE Austria - Wels Tel: 43-7242-2244-399 Fax: 43-7242-2244-393 Denmark - Copenhagen Tel: 45-4450-2828 Fax: 45-4485-2829 France - Paris Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79 Germany - Munich Tel: 49-89-627-144-0 Fax: 49-89-627-144-44 Italy - Milan Tel: 39-0331-742611 Fax: 39-0331-466781 Netherlands - Drunen Tel: 31-416-690399 Fax: 31-416-690340 Spain - Madrid Tel: 34-91-708-08-90 Fax: 34-91-708-08-91 UK - Wokingham Tel: 44-118-921-5869 Fax: 44-118-921-5820 WORLDWIDE SALES AND SERVICE 10/31/05