Professional Documents
Culture Documents
Reference Design
User’s Manual
• 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.
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
Preface
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.
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.
DOCUMENTATION CONVENTIONS
Description Represents Examples
Code (Courier font):
Plain characters Sample code #define START
Filenames and paths c:\autoexec.bat
Angle brackets: < > Variables <label>, <exp>
Square brackets [ ] Optional arguments MPASMWIN [main.asm]
Curly brackets and pipe Choice of mutually exclusive argu- errorlevel {0|1}
character: { | } ments; An OR selection
Lowercase characters in Type of data “filename”
quotes
Ellipses... Used to imply (but not show) addi- list
tional text that is not relevant to the [“list_option...,
example “list_option”]
0xnnn A hexadecimal number where n is a 0xFFFF, 0x007A
hexadecimal digit
Italic characters A variable argument; it can be either a char isascii (char,
type of data (in lowercase characters) ch);
or a specific example (in uppercase
characters).
Interface (Arial font):
Underlined, italic text A menu selection from the menu bar File > Save
with right arrow
Bold characters A window or dialog button to click OK, Cancel
Characters in angle A key on the keyboard <Tab>, <Ctrl-C>
brackets < >
Documents (Arial font):
Italic characters Referenced books MPLAB® IDE User’s Guide
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.
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
RF
Transmitter
Encoder
KEY
FOB
3-Axis
AFE
Trigger
RF Decoder
125 kHz Receiver
LF LIN Lock
Initiator RKE Drivers
Actuator
Receiver
On-Vehicle
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.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
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.
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.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.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.
GND
C1 C2 in the microcontroller.
DS21986A-page 11
10 μF 10 μF
J1
LED1 GRN
1N5819 D2 VCC
25K R2
MCLR 1
J2 2 1N5819 D3 15K R3
VCC VCC
GND 3
RJ11 4
RB7
RB6 5 VCC
6 1N5819 D4
RB3 25K R4
1K R5 YEL LED2
VCC 1N5819 D5 15K R6
R10 120
R7 30K D6 1N4148 +12 VDC
VCC U1 U2
1 21 4 6 J3
C3 20 pF MCLR/VPP RB0/INT0 RXD CANL
22 1 7
RB1/INT1 TXD CANH 2 1
9 23
OSC1/CLKIN RB2/CANTX 4 3
24 2 5
Y1 RB3/CANRX GND REF 6 5
25 3 8
RB4 VCC RS
20.0 MHz 26 CON6A
RB5 VCC R8 4.7K
10 27 MCP2551
OSC2/CLKOUT PIC18F2680 RB6
28
C4 20 pF RB7
J4
11 C6 D7 10MQ100N
RC0/T1OSO/T1CKI C5 1.0 uF 2 1
12
RC1/T1OSI PWM 1.0 uF 4 3
2 13
RA0/AN0 RC2/CCP1 D8 10MQ100N 6 5
3 14
3
7
RA1/AN1 RC3/SCK/SCL
4 15 CON6A
RA2/AN2/VREF- RC4/SDI/SDA
5 16
RA3/AN3/VREF+ RC5/SDO D9 1N4750
6 17
VD D
RA4/T0CLI RC6/TX/CK
VBAT
R9 1K
SCHEMATIC – LOW-FREQUENCY INITIATOR
7 18
RA5/AN4/SS/LVDIN RC7/RX/DT
2
CS/WAKE
4 6
TX LIN
PKE Reference Design User’s Manual
+12 VDC 1
RX
8
C7 FAULT/SLPS
5
3
6
0.1 uF U4 GND
High Voltage
MCP201 U3
TP1
VD D
L1
1
1 5
IN OUT
PWM
10-00189 C8 C9 C10
GND VD D
GND
L2 10 nF
400V
P3476-ND
2
4
TC4422 DO5022P 0.200LS 0.200LS
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.
UHF Response Slot Challenge Code Portion (16 Bits) Wake-Up 125 kHz Preamble
500 μs
50 ms Least Significant bits of Serial Number 2 ms 2 ms 4 ms
Guard Time (16 Bits)
LOGIC ‘0’
LOGIC ‘1’
Bit
Period
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.
3.2.1 Transmitter
The RF oscillator uses a Surface Acoustic Wave (SAW) resonator that operates at
433.92 MHz.
Note: The design and layout of this transmitter is not sufficient to ensure
compliance with EC or FCC regulations.
MCLR 1
VCC 2
VSS 3
ICSPDAT 4
ICSPCLK 5
no connection 6
C4 5.1V C5
VCC Hazard 100 nF 1.0 uF
SW3 3V/6V
SW5
Shift
Boot
C6 100 nF Active
VCC
VCC LED-GRN
J1
1
U3
1 2 D5 R20 470
+ +
3 4 ICSPDAT 19 16
+ + RA0/C1IN+ RC0/C2IN+ VCC
CSn
VCC
5 6 18 15
+ + RA1/C1IN- RC1/C2IN-
17 14 SCLK/ALERT
RA2/C1OUT/INT RC2
ICSPCLK 4 7 LFDATA R19 470
RA3/MCLR RC3
3 6
RA4/OSC2 RC4/C2OUT VCC
2 5 PWM D4
RA5/OSC1 RC5
PIC16F639 LED-RED
VCC 8 13 Challenge
VDDT VSST
11
LCX
C12 10
LCY
9
LCZ
1.0 uF 12 R2 47K
LCCOM
GND
Q1 C2 L1
NE94433 2.0 pF Antenna
2
20
IN
U2 1 nc R1 47
LCCOM 3 nc
6
VBAT
LX 433.92 MHz SAW 5 nc OUT
LZ
LY 7 nc
R3
R8 220 C3 C1
GND
GND
0 12 pF 470 pF
4
8
DS21986A-page 16
PKE Transmitter-Transponder
PKE Reference Design User’s Manual
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.
Start
Sample
Buttons
Receive
Get Config Challenge
No No
Seed Yes
Read Seed
TX?
No
Increment
Counter
Encrypt
Transmit
Yes
Time Out?
No
No
MTX? Stop
Yes
No Yes
Buttons?
No
No No
No New
Buttons?
Yes
Status Information Fixed Code Portion (32 Bits) Hopping Code Portion (32 Bits)
(3 Bits)
Synchronization
Counter
Counter
CRC VLOW BUT Serial Number BUT Overflow DISC 16 Bits
2 Bits 1 Bit 4 Bits (28 Bits) 4 Bits 2 Bits 10 Bits 15 0
C1 C0 S2 S1 S0 S3 S2 S1 S0 S3 OVR1 OVR0
Status Information Fixed Code Portion (32 Bits) Hopping Code Portion (32 Bits)
(5 Bits)
Synchronization
Counter
Counter
QUE CRC VLOW Serial Number BUT Overflow DISC 16 Bits
2 Bits 2 Bits 1 Bit (32 Bits) 4 Bits 2 Bits 10 Bits 15 0
Q1 Q0 C1 C0 S2 S1 S0 S3 OVR1 OVR0
Status Information Fixed Code Portion (32 Bits) Hopping Code Portion (32 Bits)
(5 Bits)
Synchronization
Counter
QUE CRC VLOW BUT Serial Number BUT DISC 20 Bits
2 Bits 2 Bits 1 Bit 4 Bits (28 Bits) 4 Bits 8 Bits 19 0
Q1 Q0 C1 C0 S2 S1 S0 S3 S2 S1 S0 S3
Status Information Fixed Code Portion (32 Bits) Hopping Code Portion (32 Bits)
(3 Bits)
Synchronization
Counter
CRC VLOW Serial Number BUT DISC 20 Bits
2 Bits 1 Bit (32 Bits) 4 Bits 8 Bits 19 0
C1 C0 S2 S1 S0 S3
C1 C0 S2 S1 S0 S3 S2 S1 S0 S3
Q1 Q0 C1 C0 S2 S1 S0 S3
Microcontroller
Function LEDS
Radio Rec. DataIN
LEARN LED
VLOW LED
LEARN SW Bus
Network
Transceiver
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.
4.2.5 Connectors
MCLR 1
VCC 2
VSS 3
ICSPDAT 4
ICSPCLK 5
no connection 6
AMRRS3-433 or -315
DS21986A-page 29
VBB
REG1
J1
VC C
GND
ANT
NC
NC
NC
GND
NC
NC
VC C
GND
VC C
TEST
OUT
VC C
LM2937IMP-5.0
1 2
+ + D1 VCC
3 4 1 3
1
2
3
4
5
6
7
8
9
+ + IN OUT
10
11
12
13
14
15
5 6
+ + 1N4004
+ C2 + C3 + R1 VCC
GND
C1 1K
D2 10 uF 10 uF 0.1 uF
2
J2
1N4755 43V 1
LED1 VCC
Green LED 2
3
ON 4
5
VCC 6
R2 R3 1K DS1
10K S0
U2 LED
S1 R4 1K
13 10 R5 1K DS3
RA0/CIN+ RC0/C2IN+
12 9 S1
LED RA1/CIN- RC1/C2IN-
LEARN 11 8 LED
RA2/C1OUT/INT RC2
4 PIC16F636 7
RA3/MCLR RC3 R7 1K DS4
3 6
DS2 1K R6 RA4/OSC2 RC4/C2OUT
2 5 S2
RA5/OSC1 RC5
SCHEMATIC – TRANSPONDER KEY FOB
LED
1
1
Not assembled with PIC16F636 E1 E2 Can be replaced with PIC16F688 for LIN applications R8 1K DS5
VBB S3
C4 C5
2
2
LED
PKE Reference Design User’s Manual
.01 uF 1.0
7
3
DS6
R9 1K
U3 VLOW
LED
VD D
VBAT
2
LINbus CS/WAKE
6 4
LIN TX
1
RX
8
C6 FAULT/SLPS
5
GND R10
D3 220 pF MCP201
100K
Can be replaced with
1N4750 27V MCP202
VCC
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)
TMR0
Interrupt
Radio Rec RXI.INC
1st Buffer X
BFFULL
Flag
MEM-62X.INC
Learn Receive Buffer CSR
TABLE.INC
Out S0
MID.ASM
- Insert FL62X.ASM
Out S3
Main Loop - Search EEPROM
LED
VLOW
- RD Word
- WR Word
KEYGEN.INC
KEY64.Inc
- Normal KEY GEN
Manufacturer Code - Manufacturer Code Load
-OR- CheckSN.asm(1)
KEELOQ® decoder(1)
FASTDEC.INC
- Decrypt
Status Information Fixed Code Portion (32 Bits) Hopping Code Portion (32 Bits)
(3 Bits)
Synchronization
Counter
Counter
CRC VLOW BUT Serial Number BUT Overflow DISC 16 Bits
2 Bits 1Bit 4 Bits (28 Bits) 4 Bits 2 Bits 10 Bits 15 0
C1 C0 S2 S1 S0 S3 S2 S1 S0 S3 OVR1 OVR0
10/31/05