C

You are on page 1of 40

AN1980

Capacitor Discharge Ignition Using the Angular Timer

Authors: Ashutosh Tiwari, The merits of using these peripherals, by


Shailendra Vengurlekar, demonstrating how the challenges of the conventional
Namrata Dalvi, design are overcome, are also explained. Furthermore,
Swathi Sridhar this application note provides information on the
improvements realized using CIPs in terms of
Microchip Technology Inc.
performance of the CDI system and reduced usage of
the CPU.
INTRODUCTION
Lastly, this document offers information on multiple PIP
The Capacitor Discharge Ignition (CDI) system is an systems, mathematical formats and certain useful tips
electronic ignition system used in internal combustion and tricks for improving mathematical computations.
engines. An ignition system provides a high-voltage
spark in the engine’s cylinders to ignite the air-fuel INTERNAL COMBUSTION ENGINE
mixture. The CDI system uses high-voltage capacitor
discharge current output to fire the spark plug. The internal combustion engine is a basic building
This application note briefly explains the block of an automobile, which converts the chemical
implementation of CDI for single Profile Ignition Pickup and heat energy into mechanical energy. The air and
(PIP) systems using standard peripherals on an 8-bit fuel chemical mixture is burnt and extreme heat is
PIC® microcontroller and the challenges associated generated, expanding the exhaust gases which force
with such designs. It also covers the implementation of the cylinder piston to move, causing the camshaft to
the CDI system using the following advanced Core rotate and create kinetic energy. This kinetic energy is
Independent Peripherals (CIP) of PIC microcontrollers: coupled to the vehicle’s wheels by gear trains in order
to convert the angular motion into linear motion.
• Angular Timer (AT)
A four-stroke cycle engine that utilizes four distinct
• Signal Measurement Timer (SMT)
piston strokes, intake, compression, power and
• Math Accelerator exhaust to complete one operating cycle is shown in
• Configurable Logic Cell (CLC) Figure 1.

FIGURE 1: FOUR-STROKE ENGINE WITH ENGINE PARTS


Exhaust
Air-fuel gases
mixture pushed out
drawn in
Valves closed Valves closed
Intake
valve
open Air-fuel Exhaust
Spark valve
mixture
Plug open
Combustion compressed
firing
Chamber

Piston

Intake Compression Power ExŚaust

 2015-2016 Microchip Technology Inc. DS00001980C-page 1


AN1980
To burn the air and fuel mixture in the cylinder, a In a Transistor Controlled Ignition (TCI) system, the
high-voltage spark is generated by passing electrical spark for igniting the air-fuel mixture is produced by
current through a spark plug during the power phase. building up the charge in the primary winding of an
This ignites the air-fuel mixture, producing a pressure ignition coil and releasing it. The Capacitive Discharge
wave which forces the piston down. The momentum of Ignition (CDI) system produces the spark by
the crank shaft caused by the power stroke of the discharging a capacitor into the ignition coil at the right
pistons continually moves the engine through the four time.
strokes. The CDI system is characterized by a short and
Top dead center (TDC) is the highest position of the accurate spark which makes it suitable for high RPMs.
piston near the spark plug and bottom dead center The TCI system provides a longer spark duration that
(BDC) is the lowest position near the camshaft. After ensures complete combustion, but takes time to charge
the spark plug fires into the power stroke, the air-fuel the ignition coil, called dwell time, which makes it less
mixture needs some time to completely burn; this efficient at higher RPMs. For more information on TCI,
burning process is progressive in nature (i.e., the refer to application note AN2095 – Transistor Coil
mixture at the top burns first and quickly moves Ignition with Integrated Remote Keyless Entry and
towards the bottom). Therefore, to completely burn the Immobilizer Using PIC® Microcontrollers.”
air-fuel mixture and produce the maximum pressure This application note will focus on the CDI system.
wave, the spark plug should be precisely fired
moments before the piston reaches TDC and at the
proper angle, which is determined by the engine piston THE CAPACITOR DISCHARGE
speed. There are other factors, such as temperature IGNITION (CDI) SYSTEM
and throttle position (i.e., amount of air-fuel mixture)
which also determine the spark firing angle. To fire the The CDI system uses the current produced by a
spark correctly and accurately, a separate module capacitor discharge to fire the spark plugs. Figure 2
known as the ignition control mechanism, is used. shows a basic CDI system.
There are two types of ignition systems: The following section explains the basic blocks of a CDI
• Inductive Discharge Ignition (IDI) or Transistor system.
Controlled Ignition (TCI) The parts that make up a CDI system are listed below:
• Capacitor Discharge Ignition (CDI)
• High-Voltage Supply
• Capacitor
• Ignition Coil and High-Power Switch
• Pulser Coil
• Signal Conditioning
• Microcontroller

FIGURE 2: BASIC CAPACITOR DISCHARGE IGNITION (CDI) SYSTEM

HV Supply
Magneto
(AC CDI)

Spark
HV Supply 300-400V Capacitor Plug
DC-DC (DC CDI) HV Supply
12V Battery Converter SCR

Pulser Coil Ignition


Coil
PWM

SCR Gate
+ Control
Pick-up signal Signal
from ƉƵůƐĞƌcoil Conditioning -

Thermistor
Throttle MCU

DS00001980C-page 2  2015-2016 Microchip Technology Inc.


AN1980
High-Voltage Supply A Silicon-Controlled Rectifier (SCR) is most commonly
used as a high-power switch in CDI. It is highly durable
There are two types of CDI systems: due to the higher operating voltages and current
• Alternating Current Capacitor Discharge Ignition ranges with moderate frequency response. The
(AC-CDI) disadvantage of the SCR is that it is a one-sided switch
• Direct Current Capacitor Discharge Ignition (i.e., the switch can only be switched ON at desired
(DC-CDI) time). The SCR automatically goes to the OFF state
when the anode current falls below the holding current
In an AC-CDI system, an alternator or stator (magneto)
of the SCR.
generates enough power for all electronic systems
including the CDI. The capacitor is charged through Insulated Gate Bipolar Transistors (IGBT) and Metal-
rectified output of magneto AC supply, which is 200V Oxide Semiconductor Field Effect Transistors
DC to 400V DC. When the engine is cold (not running), (MOSFET) can also be used as high-power switches in
a kick-start is required to rotate both the engine and the CDI systems instead of SCR.
magneto. This does not generate sufficient power from
the magneto to completely charge the capacitor for a Pulser Coil
high-voltage spark. For very low RPM, the firing angle
is always constant. Hence, analog firing is used to fire The pulser coil or pick-up/timing coil is responsible for
at negative PIP output from the magneto-flywheel providing the timing signal to the ignition control
pulser coil without calculating the RPM. system. A magnet is mounted on a flywheel. The
flywheel is mounted on the magneto shaft. When the
In a DC-CDI system, a constant 12V DC power is flywheel rotates, the magnet passes near the pulse coil
always available from the battery. It requires an producing a timing pulse. There is one pulse per pole.
additional DC/DC converter circuit to raise the 12V DC Hence, for each magnet there are two outputs, one
to 200-400V DC. This additional circuitry makes the positive pulse followed by a negative pulse, generating
CDI module slightly larger than an AC-CDI system. one alternating pulse pair. For a single PIP system,
When the engine is not running, it can be started easily there is only one pair. For multi-pulse systems there are
at a precisely calculated firing angle, as the input DC multiple pulse pairs, based on the number of magnets
supply is always available. on the flywheel. The alternating pulses are at a fixed
angle with respect to the TDC piston position in the
Capacitor engine for each rotation. The period of the pulses
triggers the rotation of the engine.
To create the high-voltage spark in the spark plug, a
high-voltage capacitor with a high-charge capacity is Based on the number of alternating pulses from the
charged using either the output of the DC/DC converter pick-up, per engine rotation, the pulser coil system can
(DC-CDI) or using the output of the magneto, an AC be divided into the following types:
alternator (AC-CDI). The capacitor is charged to a • Single PIP System
high-voltage supply, usually 200V to 400V.
• Multiple PIP System

Ignition Coil and High-Power Switch


Note: Hall effect sensors are also used for
The capacitor is connected to an ignition coil or step-up
providing timing pulses to the CDI system.
pulse transformer which produces a very high voltage,
When a magnet moves in close proximity
in the range of 40 kV or more.
of the Hall effect sensor, the sensor’s
The switch is used to connect the capacitor to the output voltage jumps to maximum voltage,
primary of the ignition coil. The switch is fired when the indicating the presence of a magnetic
microcontroller gives a pulse at the gate of the switch. field. When the magnetic field is removed,
The sudden rush of current in the primary of the coil the voltage abruptly changes to zero. To
produces a very high voltage in the secondary, which produce an output signal, a Hall effect
generates the spark to ignite the air-fuel mixture. Thus, sensor must be supplied with a reference
the microcontroller controls the firing angle of the voltage, which is taken from the CDI
switch for generating the spark. system. This produces a square wave
output that can be used for timing
purposes

 2015-2016 Microchip Technology Inc. DS00001980C-page 3


AN1980
FIGURE 3: PICK-UP SIGNAL IN THE
SINGLE PIP SYSTEM

SINGLE PIP SYSTEM


In a single PIP system, the pulser coil produces
alternate positive and negative pulses, as shown in
Figure 3. The angular distance between the positive
reference pulse and the negative reference pulse is
called the PIP length. This waveform refers to the Top
Dead Centre (TDC) position of the piston. The angle
between the pulses is fixed and this period is useful for
determining the RPM. The distance between the
negative reference pulse and the occurrence of the
TDC is also fixed. The negative pulse is used as a
reference for firing the pulses (i.e., the angular distance
from this position is used for determining the firing
angle). With this position and RPM information and
also with knowledge of parameters like engine
temperature and throttle position, the firing angle is
determined.

FIGURE 4: PICK-UP SIGNAL IN THE DUAL PIP SYSTEM

MULTIPLE PIP SYSTEM The first positive and negative pulses can be used for
calculating the RPM of the engine. The second positive
In a multiple PIP system the pulser coil provides more
pulse can be used as a reference point for deciding the
than one alternating pulse. The pick-up signal for the
firing angle for higher speeds.
dual PIP system is shown in Figure 4, along with the
TDC and the firing range. The second negative pulse is
the reference point before TDC. This is the minimum
firing angle at which the spark should be generated for
engine speeds below idle speed.

DS00001980C-page 4  2015-2016 Microchip Technology Inc.


AN1980
Signal Conditioning CDI IMPLEMENTATION USING TIMER,
The pulser coil generates the timing signals that CAPTURE AND COMPARE MODULES
contain both positive and negative pulses. These (CONVENTIONAL METHOD)
pulses are in the range of ±3V to ±90V, depending on
the magnetic field strength of the magnet mounted on Peripherals on PIC MCUs, such as Capture Compare
the flywheel. A signal conditioning circuit is used to or PWM (CCP) and the ADC, together with the interrupt
invert the negative pulse and limit the pulses to a range pin INT, are used to determine the firing angle control
of 0V to 5V. It is also used to filter any spurious noise. in CDI, as explained in the following section.
The signal conditioning circuit will provide two positive
outputs, one corresponding to positive pulses and Capture/Compare/PWM (CCP) Capture
another for negative pulses. Output of the signal Mode
conditioning circuit is connected to the microcontroller.
Output for the positive PIP signal of the signal
conditioning circuit is given to the capture module. The
Microcontroller capture module measures the time between two
In a digital CDI system the microcontroller has two positive pulses (the period of the pulser coil output).
major functions: The period of the pulses gives the RPM of the engine.
• Deciding the advance firing angle by reading input
from the sensors, such as the pulser coil, Analog-to-Digital Converter (ADC)
thermistor, and throttle position, then producing An ADC is used to determine the engine temperature
the firing pulse. and the throttle position (if it is analog). Throttle position
• Setting the duty cycle of pulse-width modulation input can be either analog or digital. In the case of a
(PWM) for the DC to DC converter. digital throttle, the position for the wide open throttle
The advance angle required for achieving optimum (WOT) is one state and the partially open throttle (POT)
performance of the engine is mainly dependent on the is another. There are distinct firing maps for different
RPM. Hence, the system must be aware of parameters throttle positions and different temperature ranges.
such as RPM, temperature and throttle position. Spark Figure 5 shows the conventional method for the CDI
plug firing timing information, referred to as timing implementation.
maps, is stored as look-up tables in the microcontroller.
These tables provide the appropriate advance angles
with respect to the RPM. Multiple timing maps are
stored based on different combinations of throttle
positions and temperature ranges. After the controller
computes the RPM, it can then fetch the advance angle
information from the look-up table.
The following sections of the application note will
explain two different implementations of CDI on PIC®
microcontrollers: CDI Implementation using Timer,
ADC, capture and compare modules, which is the
conventional method and CDI implementation using
AT. Challenges that are observed in the CCP method
are explained and how these challenges can be
simplified using Angular Timer is explained in the
Comparison Between CDI Using the AT, and CDI Using
the Conventional Approach section.

 2015-2016 Microchip Technology Inc. DS00001980C-page 5


AN1980
FIGURE 5: CDI IMPLEMENTATION (CONVENTIONAL METHOD)
Spark
300-400V Capacitor Plug
DC-DC HV Supply
12V Battery Converter SCR
Ignition
Coil
PWM

PWM

+ CCP CCPRx
Pick-up signal Signal (Capture)
from pulsĞr coil Conditioning -
INT

SCR Gate
CDI LOGIC
Thermistor Control
ADC Map
Throttle RPM Calculation
Selection
RPM

Firing Angle to
Firing Angle
Timer Counts
Calculation
Conversion

CCP
I/O
(Compare)
PICΠ MCU

DS00001980C-page 6  2015-2016 Microchip Technology Inc.


AN1980
CDI Logic
RPM CALCULATION
The RPM of the engine can be calculated from the external signal frequency fsignal as shown in Equation 1:

EQUATION 1: RPM CALCULATION USING TIMER1

Timer1 CLK
f = -----------------------------------------------------------------------
signal Timer1 Prescaler  CCPRx

Timer1 CLK
RPMEngine = -----------------------------------------------------------------------  60
Timer1 Prescaler  CCPRx

Where: Timer1 CLK = Clock input for Timer1 using T1CON register = Fosc/4 = 32/4 = 8 MHz
Timer 1Prescalar = Timer1 clock prescaler selected in T1CON register = 1:8 = 8
CCPRx is the captured value of Timer1 at falling edge of fsignal
fsignal is input signal frequency of the pick-up signal
60 scalar value is multiplied to convert Hz to RPM, RPMEngine = fsignal * 60

FIRING MAP SELECTION Challenges in the Conventional CDI


Every engine is associated with a firing map which Approach
shows the relationship between input engine speeds in
RPM and the firing angle of spark in degrees. These FIRING ANGLE TO TIMER COUNTS
maps vary depending on the throttle position and the CONVERSION
engine temperature. The current engine temperature After selecting the firing angle from the map and the
and throttle position is measured through sensors and interpolation, the firing angle has to be converted to
the firing map is selected by using these values. corresponding timer counts. Even if the firing angle
value is the same for the range of RPM, the
FIRING ANGLE CALCULATION corresponding timer counts will be different. Thus, the
If the current RPM is in between the values stored in calculation of the firing angle to timer count is
the look-up table, then the firing angle for that RPM can necessary for every RPM change. If computations are
be calculated using linear interpolation. not complete before the expected firing event, a
previous value of the firing angle is used.
FIRING ANGLE TO TIMER COUNTS
CONVERSION RPM CALCULATION
The firing angle is converted to corresponding timer Conventional method of RPM calculation uses a 16-bit
counts. Timer1 along with capture peripheral. In case of lower
RPM values, less than 60 (corresponding to 1 Hz
Capture/Compare/PWM (CCP) Compare frequency), the 16-bit Timer1 will overflow if the timer
clock frequency is 1 MHz. The timer overflow bit should
Mode
be taken into account for RPM calculations.
The timer count corresponding to the firing angle is
stored in the CCP compare register. When the timer RESOLUTION
count and compare values match, the interrupt flag is The firing angle resolution is RPM dependent.
set. In the Interrupt Service Routine, a pulse is given on
For example, for a Timer1 clock of 1 MHz and RPM of
the digital output connected to the SCR gate. The
250 the angular resolution is AR = 360/Timer1 counts
output of the compare function can also drive the pin
for 250 RPM = 360/4000 = 0.09˚ and for 10.000 RPM
connected to the SCR directly by means of the
the angular resolution is AR = 360/Timer1 counts for
Peripheral Pin Select.
10.000 RPM = 360/100 = 3.6˚.

 2015-2016 Microchip Technology Inc. DS00001980C-page 7


AN1980
CDI IMPLEMENTATION USING AT The period counter uses (ATxCLK/(ATxRES+1)) as a
clock for counting. The phase counter divides the input
The PIC16F161X family of 8-bit PIC microcontrollers periodic pulse or one cyclic rotation to equidistant
has a CIP called the Angular Timer (AT), which can be angles. The phase counter uses (ATxCLK/
used in internal combustion engines to fire the spark at (ATxPER+1)) as a clock for counting. The ATxRES
the exact firing angle with very little CPU intervention. register defines the number of angular divisions per
The features of the AT need to be explored before cycle. This value is determined by the user. If the
understanding how they reduce the need of CPU external pulse frequency is reduced, the period counter
intervention with the help of few other CIPs. value crosses the ATxPER register that was stored
during the previous period. When the period counter
AT value is 1.5 times of ATxPER, a missing pulse trigger is
given by the AT to indicate sudden decrease in external
The AT divides the incoming periodic signal (one single frequency. This is called missing pulse trigger in the
cycle) into smaller equidistant angles. This allows the Adaptive mode. The ATxMISS register is configured by
division of signals based on a phase angle, instead of the user to give a missing pulse output at a fixed value
time. Irrespective of the frequency of an input signal, which can be used to detect errors in line frequency
the division is always constant and configurable. detection to control generator engine speed. This is
As shown in Figure 6, the periodic pulse input to the AT called a Fixed Missing Pulse mode.
can be selected either from the internal core The AT has no output, but it generates an interrupt at
independent peripherals or from the external pin. The every period pulse, phase pulse, and missing pulse.
AT has two counters: the period counter and the phase
counter. The period counter counts the length of the There are two modes in which the Angular Timer can
external periodic pulse which is stored in the ATxPER be configured:
register after every external pulse. • Single-Pulse mode
• Multi-Pulse mode
The following sections explains each of the modes in
detail.
FIGURE 6: AT BLOCK DIAGRAM IN SINGLE-PULSE MODE
Rev. 10-000245A
ATxRES 1/21/2015

15
Set PERIF
SSEL Divide by Period
ATxRES+1 Counter
R R
ATx_perclk
PRP
LC4_out 111
PREC 15
LC3_out 110 ATxMISS
LC2_out 101
+ Divide by 2
LC1_out 100 Sync ATxsig LD ATxPER Difference
ZCD1_out 011 (2 Clocks)
-
15
C2OUT_sync 010 1 0 APMOD
C1OUT_sync 001
PPS 000 MPP ATx_missedpulse
Comparator
ATxINPPS
PHP
PS 1 Clock
CS Delay
ATx_phsclk
HFINTOSC (16 MHz) 1 Divide by Phase
Prescaler ATxclk
FOSC 0 ATxPER+1 Counter
R R Set PHSIF
ATxclkcc

10

To Capture/
Compare
Instruction
LD ATxPHS
Clock

DS00001980C-page 8  2015-2016 Microchip Technology Inc.


AN1980
FIGURE 7: SINGLE-PULSE MODE TIMING DIAGRAM

Period
fsignal

AT Phase Pulse

ATxPER

AT Period Pulse

360°

ATxPHS

SINGLE-PULSE MODE pulse output depends on the previous period value,


since the period register (ATxPER) only updates once
In Single-Pulse mode, every external pulse is a period
every period.
pulse which determines one complete cycle or rotation
of 0 to 2π (360), as shown in Figure 7. The phase The AT uses the clocks in Equation 2 for the period and
phase counter.
EQUATION 2: AT CLOCKS
AT clock
AT = -------------------------------
periodClock ATxRES + 1

AT clock
AT = -------------------------------
phaseClock ATxPER + 1

Where ATclock is AT input clock given by


ATxCLK
AT clock = ----------------------------------
AT Prescalar

Where: ATxCLK is the clock selection using the ATxCLK register.


ATPrescalar is the AT clock prescaler value.
ATxRES is the AT resolution register set by the user, determines the number of angular divisions per
cycle.
ATxPER is the period counter value for one complete period cycle of the external signal fsignal (input
periodic pulse signal).

The instantaneous values of ATxPER and ATxPHS in


Single-Pulse mode can be calculated as shown in
Equation 3.
EQUATION 3: ATxPER AND ATxPHS IN SINGLE-PULSE MODE
AT
periodClock ATxCLK
ATxPER = ---------------------------------------- = -----------------------------------------------------------------------------------------------------
f AT   ATxRES + 1   f
signal Prescalar signal
AT phaseClock ATxCLK
ATxPHS = -------------------------------------- = -----------------------------------------------------------------------------------------------------
f signal AT Prescalar   ATxPER + 1   f signal

 2015-2016 Microchip Technology Inc. DS00001980C-page 9


AN1980
Maximum phase value in the ATxPHS counter in the
case of Single-Pulse mode will be equal to ATxRES
(angular resolution), as indicated in Equation 4.

EQUATION 4: ATxPHS MAXIMUM PHASE VALUE

ATxPHS max = ATxRES = AR – 1

Where: ATxPHSmax is maximum value of the AT phase register.


ATxRES is value configured in the AT angle resolution register.
AR is the desired angular resolution.

EXAMPLE 1: AT REGISTER VALUES IN SINGLE-PULSE MODE

Suppose, ATxCLK = 32 MHz, ATPrescalar = 1:1 = 1, AR = 360˚, fsignal = 250 Hz.


Hence, ATxRES = AR-1= 359, as shown below:

32000000
ATxPER = ----------------------------------------------- = 355.55555555556  355 and
1   359 + 1   250
32000000
ATxPHS = ----------------------------------------------- = 359.55  360
1   355 + 1   250

MULTI-PULSE MODE
In AT Multi-Pulse mode, the input signal contains more
than one pulse per cycle, as shown in Figure 9 as
fsignal.

FIGURE 8: AT BLOCK DIAGRAM IN MULTI-PULSE MODE


Rev. 10-000246A
ATxRES 1/21/2015

15

SSEL Divide by Period Set PERIF


ATxRES+1 Counter
R R

PREC ATx_perclk
LC4_out 111 PRP
15
LC3_out 110 ATx_missedpulse ATxMISS
ATxperiod
LC2_out 101
+ Divide by 2
LC1_out 100 Missing ATxsig
ATx_in
Pulse Period LD ATxPER Difference
ZCD1_out 011 Trigger -
15
C2OUT_sync 010 1 0 APMOD
C1OUT_sync 001
PPS 000 MPP ATx_missedpulse
Comparator
ATxINPPS
PHP
PS 1 Clock
CS Delay
ATx_phsclk
HFINTOSC (16 MHz) 1 ATxclk Divide by Phase
Prescaler
FOSC 0 ATxPER+1 Counter
R R Set PHSIF
ATxclkcc

10

To Capture/
Compare
Instruction
LD ATxPHS
Clock

DS00001980C-page 10  2015-2016 Microchip Technology Inc.


AN1980
FIGURE 9: MULTI-PULSE MODE TIMING DIAGRAM

Period

fsignal

AT Phase Pulse

AT Missing Pulse

AT Period Pulse

ATxPER

360°

ATxPHS

To determine the period of input signal, the signal must Since the ATxPER value resets every external pulse
have at least one missing pulse. As indicated in except for the pulse after the missing pulse, the
Figure 9, there are five signal pulses with one missing ATxRES should be chosen so that ATxPHS should not
pulse which makes it six pulses per period. A missing cross the maximum count of 1024 (10-bit register which
pulse is generated by the AT when no pulse is detected is 210).
after the fifth one. After the missing pulse, the first rising A Multi-Pulse mode example, Example 2, shows
edge on fsignal gives the AT period pulse output. Hence, choosing the resolution register (ATxRES) value for the
the missing pulse and the period pulse have exactly the required angular resolution (AR).
same length. The ATxPER register updates on every
rising edge of the external pulse, except for the pulse The instantaneous values of period and phase
immediately following the missing pulse. This helps registers in Multi-Pulse mode can be given as shown in
ATxPHS to correct itself according to ATxPER after Equation 5.
every rising edge in order to output phase pulses
correctly within the same period.

EQUATION 5: ATxPER AND ATxPHS IN MULTI-PULSE MODE

ATxCLK
ATxPER = --------------------------------------------------------------------------------------------------
AT f   ATxRES + 1 
Prescalar pulse

ATxCLK
ATxPHS = -------------------------------------------------------------------------------------------------------------------------
AT f   ATxPER + 1 
Prescalar Mis sin gPulse

Where: fpulse is the pulse frequency in a period signal.


fmissingPulse is the missing pulse frequency of AT, which is same as fsignal.

 2015-2016 Microchip Technology Inc. DS00001980C-page 11


AN1980
So, the relationship between maximum counts of
ATxPHS with respect to ATxRES can be determined,
as demonstrated in Equation 6.

EQUATION 6: MAX ATxPHS VALUE FOR MULTI-PULSE MODE

 fpulse 
ATxPHS max = ATxRES   -------------------------------------
 mis sin gPulse
f

As a result, the value of ATxRES will be different for the


same angular division or angular resolution (AR) in the
Multi-Pulse mode compared to the Single-Pulse mode.
See Equation 7.

EQUATION 7: ATxRES CALCULATION FOR MULTI-PULSE MODE

 f mis sin gPulse  T pulse 


ATxRES = AR   ------------------------------------- – 1 = AR   --------------------------------------- – 1
 f pulse   mis sin gPulse
T

Where: Tpulse = 1/fpulse and TmissingPulse = 1/fmissingPulse.

Using the above value of ATxRES and Equation 5, the


values of ATxPER and ATxPHS can be calculated as
indicated in Example 2.

EXAMPLE 2: AT REGISTER VALUES IN MULTI-PULSE MODE

Suppose, ATxCLK = 32 MHz, ATPrescalar = 1:1 = 1, AR = 360˚.


fsignal = fmissingPulse = 250 Hz and fpulse = 2500 Hz;
Hence, using Equation 7 the below results will be obtained:

250 360
ATxRES = 360  ------------ – 1 = --------- – 1 = 36 – 1 = 35
2500 10
32000000
ATxPER = ----------------------------------------------- = 355.55555555556  355
1  2500   35 + 1 

32000000
ATxPHS = ----------------------------------------------- = 35.955  35
1  250   355 + 1 

CAPTURE AND COMPARE FUNCTIONS Compare Mode


The AT has three capture/compare modules along with In the Compare mode, the AT module compares the
it. current phase counter value (ATxPHS) to the value in
the compare register (ATxCCy). The compare register
Capture Mode (ATxCCy) can be loaded with an angle value which is
In Capture mode, on the rising or on the falling edge of less than or equal to the angular resolution AR
the capture input signal, the value of the phase counter (ATxRES) in the Single-Pulse mode. When the two
(ATxPHS) is captured into the capture register values match, a compare event is generated. This can
(ATxCCy). be used to trigger other peripherals such as an ADC or
a CLC input, or to generate an interrupt.
The capture event also generates a pulse that can be
used to trigger other peripherals such as an ADC or a
CLC input, or to generate an interrupt.

DS00001980C-page 12  2015-2016 Microchip Technology Inc.


AN1980
CDI Implementation with AT SIGNAL MEASUREMENT TIMER (SMT)
Figure 10 shows the AT with Core Independent For the RPM calculation, a 24-bit SMT is used. SMT is
Peripherals (CIPs) in PIC16F1615/9 for the configured in Windowed Measurement mode with the
implementation of the CDI system. window input set to AT period pulse. Whenever AT
gives period pulse, the SMT captures the timer value
CIPs of PIC microcontrollers, such as CLC, AT, SMT, into SMTxCPR register, resets its timer count, and
and Math Accelerator are used for the firing angle restarts counting. The timer capture into the SMTxCPR
control in CDI. register generates a captured period interrupt.
CONFIGURABLE LOGIC CELL (CLC) ADC
The outputs of the signal conditioning circuit are An ADC is used to find the engine temperature and the
connected to the CLC. The outputs of the signal throttle position (if it is analog). Throttle position input
conditioning circuit will be in logic 1 state except for the can be either analog or digital. In the case of a digital
positive and negative pulses from the pick-up coil. The throttle position, the wide open throttle (WOT) is one
CLC is configured as an XOR gate, so that the CLC state and the partially open throttle (POT) is another.
output will give positive pulses for both inputs, as There are different firing maps for different throttle
shown in Figure 11. The CLC output is connected to positions and different temperature ranges.
the AT input internally. The AT will provide a period
pulse to SMT.

FIGURE 10: CDI IMPLEMENTATION WITH PIC16F161X

Spark
200-400V Capacitor Plug
DC-DC HV Supply
12V Battery Converter SCR
Ignition
Coil
PWM
SCR Gate
Control
CWG I/O

Angular Timer

Capture
+
Phase
Pick-up signal Signal Compare
from pulser coil Conditioning - CLC AT
Input ATxCCy

AT Period Pulse
Firing Angle
SMT SMTxCPR

CDI LOGIC
Thermistor
ADC Map RPM
Throttle Selection Calculation
RPM
Firing Angle
Calculation

Math Accelerator
PIC16F161x MCU

 2015-2016 Microchip Technology Inc. DS00001980C-page 13


AN1980
CDI LOGIC

RPM Calculation
The RPM of the engine can be calculated from the
external signal frequency fsignal as shown in
Equation 8.

FIGURE 11: SIGNAL CONDITIONING OUTPUT

TDC
+5to15V +ve
Period
Advance
pulse
Pick-up Signal
Pulser output -ve
Reference
-5to15V pulse
Input signals +5V
to p_PIP
MCU After
signal +5V
n_PIP
conditioning

CLC (XOR) output

AT Period Pulse

EQUATION 8: RPM CALCULATION USING SMT

SMTxCLK
fsignal = ------------------------------------------------------------------------
SMT Prescalar  SMTxCPR

SMTxCLK
RPM = ------------------------------------------------------------------------  60
Engine SMT  SMTxCPR
Prescalar

Where: SMTxCLK = clock input for SMT using SMTxCLK register= Fosc = 32 MHz.
SMTPrescalar = SMT clock prescaler selected in SMTxCON0 = 1:8 = 8.
SMTxCPR is captured value of SMTxTMR at window input event.
fsignal is input signal frequency to AT and SMT.
60 scalar value is multiplied to convert Hz to RPM, RPMEngine = fsignal * 60.

DS00001980C-page 14  2015-2016 Microchip Technology Inc.


AN1980
Firing Map Selection
Every engine is associated with a firing map which
shows the relation between the input engine speeds in
RPM and the firing angle of the spark in degrees.
These maps vary depending on throttle position and
engine temperature. The current temperature of the
engine and the throttle position can be used to select
one of the firing maps. The map is nonlinear in nature
and nondeterministic, which can change from engine to
engine. Hence, these maps are divided into smaller
linear maps (piecewise linear curves) and are
expressed in terms of a table with RPM on LHS and
firing angle on RHS.

FIGURE 12: EXAMPLE OF RPM TO


FIRING ANGLE (THETA)
MAP

Figure 12 shows an example of a firing map. This firing


map is a plot of a piecewise linear curve. Here, the red
curve shows the RPM to firing angle relationship for
throttle ON and the blue curve shows RPM to firing
angle relationship for throttle OFF.

Firing Angle Calculation


To find the firing angle of an engine between two points
in the map, linear interpolation is used as follows:

EQUATION 9: FIRING ANGLE CALCULATION USING LINEAR INTERPOLATION

y 2 – y1
y = y +  x – x   -----------------
1 1 x –x
2 1

Where: y is the instantaneous value of the firing angle to be calculated, which is in between y1 and y2.
x is the instantaneous value of engine RPM which is known and in between x1 and x2.
(x1, y1) and (x2, y2) are the successive points in the graph between which a line is drawn these are
shown as row 1 and row 2 in the firing map table, respectively.
x1 and x2 represent values of Engine RPM of two endpoints. y1 and y2 represent the values of the
firing angle of two endpoints of a straight line curve.

 2015-2016 Microchip Technology Inc. DS00001980C-page 15


AN1980
In Equation 9, the ratio ((y2-y1)/(x2-x1)) is always MATH ACCELERATOR
constant and is called slope m of a straight line. This
The math accelerator peripheral, also called a PID
can be precalculated for a curve to reduce the amount
module, is used to calculate the firing angle for the
of calculation.
current RPM using Equation 9. Using the math
For example, Table 1 is the firing map given by the accelerator, the calculation can be done faster. It
engine specifications. The values in the column “Slope” performs an addition and a multiplication as shown in
are calculated from the previous two column values, Equation 10.
and are called line slopes.
TABLE 1: Firing Map for Example Engine EQUATION 10: MULTIPLY/ADD OPERATION
IN MATH ACCELERATOR
Engine Speed Firing Angle Slope
(RPM) (θ°) (m) R = A + B  C
250 10 0
Where:
500 10 0 A is the first input operand for addition (PIDxIN
1600 10 0 register).
B is the second input operand for addition
1800 10 0.075 (PIDxSET register).
2000 25 0.012 C is the third input operand for multiplying with
the result of addition (PIDxK1 register).
2500 31 0 R is the results of one complete add and multi-
4100 31 0 ply operation (PIDxOUT register).

4200 31 0 The math accelerator performs these operations in


5100 31 0 16-bit integer, either in signed or unsigned format,
configured by the user. The result of this operation is
5200 31 0
32-bit in size, and is stored in the PIDxOUT register.
5900 31 0 The result of this operation can be configured to be
8500 31 -0.042 accumulated or non-accumulated. For accumulation of
the result, the PIDxACC register is used to accumulate
9000 10 0
previous results.
10000 10 0
AT
EXAMPLE 3: FIRING ANGLE Depending on the angular resolution settings in the
CALCULATION USING resolution register (ATxRES) the AT will start counting.
INTERPOLATION AT will divide the input signal into equidistant angles.
The phase counter (ATxPHS) is incremented
Suppose, RPMEngine = 1915 rpm. accordingly.
From Table 1, this RPM value lies between 1800 Selecting the ATxRES Value of the AT for CDI
rpm (with a firing angle of 10˚) and 2000 rpm (with
Implementation
a corresponding firing angle of 25˚).
The granularity of the phase counter is called angle
Thus, from Equation 9, the terms are as follows:
resolution. The value in the ATxRES register is used to
y1 = 10, y2 = 25, x1 = 1800, x2 = 2000, x = 1915 determine the angle resolution of the AT phase counter.
The result is shown below: The angle resolution can be achieved through
25 – 10 Equation 11 below.
y = 10 +  1915 – 1800   ------------------------------ = 18.625  18
2000 – 1800
EQUATION 11: ANGLE RESOLUTION
Thus, the firing angle for the given RPM of 1915 is 18˚. 360 
Angle Resolution = -------------------------------
ATxRES + 1

In the AT, the period is measured in increments of


ATxRES. For smaller ATxRES values, the ATxPER
values will be high. AT truncates the actual period value
in order to load the value in the period register
(ATxPER). For a smaller percentage of error, the higher
ATxPER value is required.

DS00001980C-page 16  2015-2016 Microchip Technology Inc.


AN1980
The figure of merit (FOM) for the system is defined as
the minimum expected ATxPER value. For error to be
less than 0.2%, FOM should be as per Equation 12.

EQUATION 12: FIGURE OF MERIT

1 1
FOM = 100  --------------- = 100  ------- = 500
Error 0.2

Therefore, it is recommended that the AT clock and


resolution (ATxRES) be chosen so that the minimum
expected ATxPER value (FOM) corresponding to the
highest RPM will be greater than 500.

EXAMPLE 4: ATxRES CALCULATIONS

Consider the following values:


Maximum engine RPM = 10000
fsignal = RPM/60= 10000/60 = 166.66 Hz
ATxCLK = 32 MHz
ATPrescalar = 1:1
ATxPER is given by
ATxCLK
ATxPER = ------------------------------------------------------------------------------------------------------------------------------
min AT
Prescalar
  ATxRES
max
+ 1  f
signal_max

So, for a FOM of 500 (ATxPERmin), ATxRESmax will be as shown below:

ATxCLK  ----------------------------------------
32000000 
ATxRES = -------------------------------------------------------------------------------------------------------------- – 1 =  1  500  166.66- – 1 = 383
max AT
Prescalar
 ATxPER f
min signal_max

It is preferable to select the value of ATxRES smaller than ATxRESmax.


If ATxRES is chosen as 359°, to get an angle resolution of 1° the minimum ATxPER value (FOM), corresponding
to the highest RPM will be as shown below:

ATxCLK 32000000
ATxPER = ------------------------------------------------------------------------------------------------------------------ = ----------------------------------------- = 533.33
AT Prescalar   ATxRES + 1   fsignal_max 1  360  166.66

LOW RPM CORRECTION


From zero RPM to very low RPM, the AT period counter
can overflow due to the limited size of the AT period
counter, which is 15 bits in length. The value in this AT
period counter will be high for lower RPM counts.
Therefore, a sufficiently low clock needs to be chosen
for the AT input, so that lower RPM can also be taken
into consideration. As a result, the minimum value of
RPM is 60, as calculated in Example 5. Decreasing the
AT input clock frequency and increasing the AT clock
prescaler would result in less accuracy of angular
divisions, but this design trade-off is necessary here to
take lower RPM into account.

 2015-2016 Microchip Technology Inc. DS00001980C-page 17


AN1980
EXAMPLE 5: LOW RPM CORRECTION

Suppose ATxCLK = 32 MHz, ATxRES = 60, ATxPER max = 32767 (15-bit counter), hence fmin is calculated as
shown below:

ATxCLK
f min = -------------------------------------------------------------------------------------------------------------------
AT Prescaler   ATxRES + 1   ATxPERmax

As a result, for the case above with ATPrescalar = 1, fmin is 16.27 Hz or 976 RPM.
To include lower RPM, if ATxCLK = 16 MHz and ATPrescalar = 8 are selected, the value will be calculated as
follows:
16000000
f min = ------------------------------------ = 1.017 Hz  60 RPM
8  60  32767

SCR/IGBT FIRING
The calculated firing angle is loaded into the AT
compare register. When the value in the compare
register matches the AT phase counter, a compare
interrupt is generated and IGBT or SCR is fired, as
shown in Figure 13. In case of IGBT, another compare
register is used to switch off the firing.

FIGURE 13: TIMING DIAGRAM FOR SCR FIRING

TDC
+5to15V +ve
Period
Advance
pulse
Pick-up Signal
Pulser output -ve
Reference
-5to15V pulse

CLC (XOR) output

AT Period Pulse

360°
ATxPHS
Phase Counter

Advance Angle ΘA

SCR/IGBT trigger Θ=ΘA-ΘF


from MCU
Firing
Angle ΘF
TDC

DS00001980C-page 18  2015-2016 Microchip Technology Inc.


AN1980
COMPLEMENTARY WAVEFORM
GENERATOR (CWG)
The CWG is used to generate a single or
complementary sine wave modulated PWM signal for
the DC to AC inversion. This inversion is required to
convert 12V DC from battery to 220V AC RMS which is
rectified again to generate 300V DC. This 300V DC is
used to charge the CDI capacitor. A complementary
PWM can be used to make full-wave inversion while a
single PWM only makes half-wave inversion. For very
small engines, only half cycle is enough to charge the
capacitor where RPM is very low (i.e., chainsaws, lawn
mowers, etc.).

FIRMWARE
Firmware flowchart is shown in Figure 14.

FIGURE 14: FIRMWARE FLOWCHART

Start

Initialize

NO

SMT1 Int? & ADC Int? & AT period Int? NO AT1CC1 Int? NO AT1CC2 Int?
NO NO FAU = 1? NO
FAU = 3? FAU = 2? & FAU = 0?
NO
YES YES
Y ES YES YES YES
YES
Calculate RPM Select Firing Map Ignition coil Ignition coil
from SMT timer Mode = Mode = using Temperature Set Switch ON Switch OFF
NO
Thermister? Throttle? and Throttle AT1CC1 = On Firing Angle
AT1CC2 = Off Firing Angle
Set FAU = 2
YES YES
Get ON and OFF
Convert ADC to Convert ADC Set FAU = 3
firing angles
Temperature to Throttle
from MAP

ADC channel = ADC channel =


Throttle Temperature
Set FAU = 0
Mode = Mode =
Throttle Thermister

Set FAU = 1

Note 1: FAU is a firing angle update variable which keeps track of the firing angle calculation step number.
When it is done, update the ON and OFF firing angles.
2: The ADC will sample the engine temperature and the throttle position for each AT period pulse. These
will be taken as current parameter values, and a firing map is selected based on these values.

 2015-2016 Microchip Technology Inc. DS00001980C-page 19


AN1980
Program Flow Interpolation Calculation for Firing Angle
The program execution is sequentially divided into a For the conventional method, the interpolation
number of steps to compute the RPM and firing angle calculation of the firing angle and its conversion to timer
as explained below: count calculation take a longer time.
1. Initialize: The board is powered on or reset; all When using the math accelerator, the firing angle
the peripherals (ADC, PID, CWG, CLC1, SMT1 interpolation calculation can be expedited.
and AT1) are initialized.
2. Input Acquisition: The CLC1 takes two inputs RPM Calculation
to generate one XORed output connected to AT
input. AT starts counting and gives period pulses When the conventional method is applied, there is the
periodically. This AT period pulse is used by possibility of a timer overflow at lower RPM.
SMT as window input in “Windowed Measure SMT is a 24-bit timer. If used for RPM calculations with
mode”. The SMT at every AT period input a clock frequency of 1 MHz, it can count until 0.125 Hz
captures the value of the SMT1TMR register to (7.5 RPM) without overflowing.
the SMT1CPR register and a corresponding
interrupt is generated. The program is notified
Resolution
about a new SMT value available for calculation.
This is the acquisition step. The angular resolution varies with RPM in the case of
3. ADC: The analog output of the sensor for conventional methods using the timer, capture and
engine temperature and throttle position is compare peripherals. Whereas, the desired resolution
digitized by an internal 10-bit ADC. of the firing angle can be directly loaded into the
4. RPM calculation: The RPM of the engine is resolution register (ATx RES) of the AT. For a resolution
calculated from the SMT1CPR register value. of 1°, the resolution register is loaded with a value of
359, in the case of Single-Pulse mode. The angular
5. Map selection: Using temperature and throttle
resolution is independent of the RPM of the engine.
position values, a particular map is selected.
From this selected map, the firing angle
corresponding to the present RPM is read from Overall Comparison
the look-up table. If the current RPM is between The maximum frequency of the input pick-up signal to
the values stored in the look-up table, the firing the CDI system can be 500 Hz, corresponding to
angle for that RPM is calculated using 30000 RPM (500 Hz or 2 ms period). Within this period
interpolation. of 2 ms, the CDI operation must finish all of the
6. Firing Angle Update: The firing angle value is execution and calculations. Considering PIC16F
stored in the AT compare register (AT1CCy). devices for both the conventional method and that
7. AT compare interrupt: In the AT compare ISR using the AT, which has eight MIPS of execution speed
a pulse is given on the port pin connected to at 32 MHz, the comparison table below shows the CPU
SCR/IGBT gate to turn ON the switch for firing usage for both systems.
the spark. If the IGBT is used, another ATxCCy The MIPS can be calculated as indicated in
register is used to switch OFF the IGBT. Equation 13.
8. Steps 2 through 7 are repeated every AT period
cycle. EQUATION 13: MIPS CALCULATION

COMPARISON BETWEEN CDI USING MIPS Total


MIPS Actual = -----------------------------  T Execution
THE AT, AND CDI USING THE T MIN
CONVENTIONAL APPROACH
Where: MIPSActual is the calculated MIPS for
Firing Angle to Timer Counts Conversion current program execution
When the conventional method is used, the firing angle TMIN is the minimum input period which
has to be converted to corresponding timer counts. is 1/fMAX i.e., inverse of minimum input
Whereas the firing angle value obtained from the map signal frequency
can be written directly to AT compare register. When MIPSTotal is the max MIPS of the device
the angle value matches, it generates an interrupt and TExecution is the actual execution time of
the SCR can be fired. There is no CPU intervention program
because the AT is a separate on-chip peripheral.

DS00001980C-page 20  2015-2016 Microchip Technology Inc.


AN1980
In the case above, the TMIN = 2 ms and MIPSTotal = 8. EQUATION 14: % CPU USAGE
And CPU usage, based on maximum MIPS, is given as
shown in Equation 14, below. MIPS Actual
%CPU = --------------------------------  100
USAGE MIPS
Total

TABLE 2: TIMING COMPARISON


CDI Using the Angular Timer CDI Using the Conventional Method
Program
Operations Execution % CPU Execution Time % CPU
MIPS MIPS
Time (µs) Usage (µs) Usage
Long Division 150 0.6 7.5 200 0.8 10
(includes extra time for the T1 count over-
flow value inclusion in the calculation)
Firing Angle 150 0.6 7.5 350 1.4 15.5
Calculation (using Math
Accelerator)
T1 count to degree 0 0 0 200 0.8 10
ISR and other 50 0.2 2.5 50 0.2 2.5
program commands
Total 350 1.4 17.5 800 3.2 40
Table 3 summarizes the resource comparisons of the two methods for CDI implementation.

TABLE 3: RESOURCE COMPARISON


CDI Using the CDI Using the
Parameters
AT Conventional Method
Flash Memory (Words) 1994 3347
RAM (Bytes) 65 233
Peripherals Used ADC, CLC, AT, SMT, Math Accelerator, CWG ADC, CCP, Timer 1, PWM

Table 4 summarizes the performance comparisons of the two methods for CDI implementation.

TABLE 4: PERFORMANCE COMPARISON


Parameters CDI Using AT CDI Using conventional Method
Accuracy Depends on FOM and the ATxRES Depends on engine speed (i.e., RPM and granularity of timer
value count for firing angle calculation).
Resolution Minimum 0.35˚ resolution (i.e., 10 Depends on Timer1 clock and RPM (i.e., for 1 MHz clock, 250
bit) ATxRES value RPM, the angular resolution is 0.09˚, and for 10000 RPM the
angular resolution is 3.6 ˚).

 2015-2016 Microchip Technology Inc. DS00001980C-page 21


AN1980
EXTENDING THE CDI DESIGN USING
CIPs FOR DUAL SPARK TOPOLOGY
The CDI system can have more than one spark per
ignition system for improving fuel consumption and
exhaust emissions, thus improving performance. The
CDI design using CIPs of PIC16F1615/9 can be
modified to support dual spark ignition. The two sparks
can be used either in two different cylinders of an
engine or in the same cylinder in multi-spark topology
per cylinder, in order to have a high performance (i.e.,
RPM to ignite air fuel mixture more quickly). Figure 15
illustrates the modification over the existing design to
suit the dual spark topology.

FIGURE 15:
Spark
300-400V Capacitor Plug
DC-DC HV Supply
12V Battery Converter
SCR Ignition
Coil
PWM

CWG

SCR Gate
Control
I/O
Spark
Capacitor
+ Plug
Pick-up signal Signal
from pulsar coil Conditioning -
PIC16F1615/19
SCR Ignition
Coil

Thermistor I/O
SCR Gate
Control
Throttle

DS00001980C-page 22  2015-2016 Microchip Technology Inc.


AN1980
CONCLUSION
CDI systems can be implemented using PIC16F
microcontrollers either through the conventional
method or by using CIPs, such as AT, CLC, SMT, Math
Accelerator, and CWG. However, using the CIPs
greatly improves the overall performance and
implementation of CDI.
The AT successfully divides the input signal to angular
division without CPU intervention, which helps to boost
performance by removing the need for firing angle
conversion from degree to equivalent time. These
angular divisions are also very accurate and constant
throughout the input signal range. As shown in the
comparison tables (Table 2 through Table 4) of this
document, the performance of the CDI system can be
greatly enhanced using the AT, with significant CPU
bandwidth remaining for other calculations. In addition,
with the use of the Math Accelerator, the calculations
are now more accurate and faster. The SMT with its
inherent high-bit resolution helps in tracking low engine
RPM and taking necessary action, without the need for
large computations. Albeit being outside the scope of
this application note, a similar implementation
technique can be extended to other systems, such as
inductive discharge ignition (IDI), that use the same
CIPs.

 2015-2016 Microchip Technology Inc. DS00001980C-page 23


AN1980
APPENDIX A: SCHEMATICS
For schematics and reference board, contact the local
sales office.

FIGURE A-1: CAPACITIVE DISCHARGE IGNITION REFERENCE DESIGN

DS00001980C-page 24  2015-2016 Microchip Technology Inc.


AN1980
APPENDIX B: CDI
IMPLEMENTATION
WITH MULTI PIP
SYSTEM
If the pick-up signal from the pulser coil consists of
more than one pulse per period, then AT Multi-Pulse
mode should be used. The example of multi-pulse
output is shown in Figure 4.
The implementation of the CDI system for both Single
and Multi-Pulse modes is the same, except for the
configuration of the AT mode and the ATxRES register
value, which is explained in the Multi-Pulse mode
section of CDI Implementation Using AT (Equation 7).
LSb in the AT1CON0 register should be set to 1 for the
Multi-Pulse mode.
The RPM calculation, map selection, and firing angle
calculations are all the same. The value to be loaded in
the ATxCCy register is also the same, and it is noted as
such in the Equation B-1 below.

EQUATION B-1: AT COMPARE MODULE


VALUE CALCULATION

ATxCCy =  – 

Where:  is the angle of positive pulse with


respect to TDC in an anticlockwise
rotation.
θ is the calculated firing angle in an
anticlockwise rotation.

In Single or Multi-Pulse mode, the φ represents the


angle where the pulser coil gives the first positive pulse
at an angle before TDC and after BDC in a
counterclockwise direction.

 2015-2016 Microchip Technology Inc. DS00001980C-page 25


AN1980
APPENDIX C: FIRING ANGLE
CALCULATION WITH
Q15 NUMBER
FORMAT AND MATH
ACCELERATOR
Equation 9 of the firing angle calculation requires one
addition, three subtractions, one division, and one
multiplication operation per external signal cycle for
implementation. In 8-bit MCU, these arithmetic
operations might require quite a long time to finalize. To
minimize the number of computations, the slope value
can be precalculated in firing angle calculation as
shown in Table 1. Hence, Equation 9 can be
represented as shown in Equation C-1:

EQUATION C-1: LINEAR INTERPOLATION

y = y1 +  x – x 1   m

Where: m = (y2–y1)/(x2–x1).
m is the slope of straight line between
(x1, y1) and (x2, y2).

As seen from Table 1, the value of m can be smaller


than 1 which requires Equation C-1 to be calculated
using the floating point math. In 8-bit MCU, this math
can take significant amount of time. To ease this
calculation, the Q15 number format is used. In Q15
format, every number is divided with the max value of
that parameter type and then multiplied with the
maximum value of 16-bit signed integer (i.e., 32767).
This brings the number to a 16-bit numeral form. This
technique is also called normalization.
Now, the normalized Q15 number can be used in
calculation and integer math can easily be used. When
all calculations are finished, the result of the operation
is converted back to normal units.

EXAMPLE C-1: FIRING ANGLE CALCULATION IN Q15 FORMAT


Suppose, RPMMAX = 30660, fMAX = RPMMAX/60 = 511
θMAX = 63 (Maximum firing angle)
Applying Q15 on RPM = 10000 and FiringAngle = θ = 25, the following string of equations is obtained:

RPM 10000
f = ------------- = --------------- = 166.666667  167
60 60
f 167
f = --------------  32767 = ---------  32767 = 10687.21461  10687
Q15 f MAX 511

 25
 = ----------------  32767 = ------  32767 = 13002.77778  13002
Q15  MAX 63

DS00001980C-page 26  2015-2016 Microchip Technology Inc.


AN1980
Applying the above formulas, Table 1 can be written as The slope value in Table C-1 is calculated from the Q15
Table C-1 below. formatted firing map values and not from the actual
TABLE C-1: FIRING MAP REPRESENTED RPM and firing angle values. To calculate the actual
IN Q15 FORMAT firing angle from Table C-1, Equation C-1 can be used,
with some modifications:
fsignal Firing Angle (θ˚ to
Slope (m ˚/Hz)
(Hz to Q15) Q15) EQUATION C-2: CALCULATION OF FIRING
267 5201 0 ANGLE
534 5201 0
1710 5201 0
y + x –x  m 
1924 5201 37 1 Q15  Q15 1 Q15 MAX
y = -------------------------------------------------------------------------------------------------------
2137 13003 6 Q15 MAX
2672 16123 0
4382 16123 0
4489 16123 0
5450 16123 0
5557 16123 0
6305 16123 0
9084 16123 -20
9618 5201 0
10687 5201 0

EXAMPLE C-2: FIRING ANGLE CALCULATION IN Q15 FORMAT WITH CONVERSION FROM Q15
TO DEGREES

By using the values given in Example 3 and performing Q15 calculations, the following results are obtained.

RPM 1915
f = ------------- = ------------ = 31.91666667  32
60 60
f 32
f Q15 = --------------  32767 = ---------  32767 = 2046.6  2046
f MAX 511

 10
 Q15 = ----------------  32767 = ------  32767 = 5201.111111  5201
 MAX 63

Hence, from Table C-1 and the above calculated values, the results are shown here:
y1Q15 = 5201, xQ15 = 2046, x1Q15 = 1924, m = 37, Q15 MAX = 32767. Using Equation C-1 y can be calculated as
shown:

 5201 +  2046 – 1924   37   63


y = ---------------------------------------------------------------------------------- = 18.6787  18
32767

These results match the results in Example 3, Firing The final output of the second operation can then be
Angle Calculation Using Interpolation. shifted logically to the right 15 times to make the
The integer math above can easily be done with the division by 32767.
Math Accelerator. The result in the above example
contains Equation 10 operation twice. The first multiply/
add operation is [(2046-1924)x37] in numerator. The
second multiply/add operation is adding the result of
the first operation to 5201, which is multiplied by 63.

 2015-2016 Microchip Technology Inc. DS00001980C-page 27


AN1980
APPENDIX D: TIPS AND TRICKS TO TABLE D-1: EXPANSION OF TABLE 1 FOR
REMOVE EVERY 1˚ CHANGE IN FIRING
ANGLE (CONTINUED)
INTERPOLATION
CALCULATION Engine Speed Range Firing Angle
(RPM) (θ˚)
The interpolation operation in Equation C-1 takes a
8596-8619 26
long time to finalize due to the inclusion of one division
and one multiplication operation, since these 8620-8642 25
operations are implemented using an emulator in an 8- 8643-8666 24
bit MCU. To increase the speed of execution of the CDI
program, the interpolation operation can be replaced 8667-8690 23
by a firing angle look-up table. For this, Table 1 can be 8691-8714 22
implemented as a look-up table for 1˚ change in firing 8715-8738 21
angle and the left hand side will contain the range of
RPM values for that firing angle. Below is Table 1 8739-8761 20
expanded as a look-up table. 8762-8785 19
8786-8809 18
TABLE D-1: EXPANSION OF TABLE 1 FOR
EVERY 1˚ CHANGE IN FIRING 8810-8833 17
ANGLE 8834-8857 16
Engine Speed Range Firing Angle 8858-8880 15
(RPM) (θ˚) 8881-8904 14
250-1813 10 8905-8928 13
1814-1826 11 8929-8952 12
1827-1839 12 8953-8976 11
1840-1853 13 8977-10000 10
1854-1866 14 This method increases the performance of the CDI
1867-1879 15 program by simply finding the firing angle against the
range of RPM at the cost of requiring more Flash
1880-1893 16 memory. If enough memory is available for
1894-1906 17 implementing all the maps as a look-up table, and
1907-1919 18 performance is of prime importance, the above look-up
table method can be used. For example, for a RPM
1920-1933 19 value of 1915, the firing angle from Table D-1 is 18˚.
1934-1946 20
1947-1959 21
1960-1973 22
1974-1986 23
1987-1999 24
2000-2083 25
2084-2166 26
2167-2249 27
2250-2333 28
2334-2416 29
2417-2499 30
2500-8500 31
8501-8523 30
8524-8547 29
8548-8571 28
8572-8595 27

DS00001980C-page 28  2015-2016 Microchip Technology Inc.


AN1980
APPENDIX E: ENGINE AND EQUATION E-2: ENGINE LINEAR
VEHICLE SPEED VELOCITY
CALCULATION V Engine = r   Engine
The engine speed is calculated from Equation 8 which
is in Hz or RPS (rotations per second). This value is Where: VEngine is the linear velocity or speed of
multiplied by 60 to convert it to engine speed (RPM). the engine piston in meters/second
This rotation per second or speed in Hz can also be r is the radius which is equal to half of the
used to find the angular speed or velocity of the engine distance between the TDC and BDC
given as follows: position of the piston in meters

EQUATION E-1: ENGINE ANGULAR


VELOCITY The engine rotation is mechanically coupled to
automobile wheels through gear trains. The
 Engine = 2  f signal mechanical coupling through gears has a ratio called
gear turn ratio, which measures how fast the wheel will
rotate for one complete rotation of the engine. The gear
Where: ωEngine is the angular velocity of engine turn ratio value can be used to convert the engine linear
in radians/second. velocity into automobile linear velocity or speed as
fsignal is the engine speed in Hz. follows:
2π is the length of circumference of a
circle in radian angles or one complete EQUATION E-3: AUTOMOBILE LINEAR
rotation of circle in radian. VELOCITY

V = V G
Equation E-1 can be used to find the linear speed of the Automobile Engine
engine as shown below:
Where: VAutomobile is the automobile linear
velocity or speed in meters/second.
G is the gears’ turn ratio of engine rotation
and the automobile wheel rotation.

 2015-2016 Microchip Technology Inc. DS00001980C-page 29


AN1980
APPENDIX F: MPLAB® CODE select the required settings. This reduces the time to
development. The MCC also provides some built-in
CONFIGURATOR
functions for working with specific peripherals.
(MCC)
Figure F-1 to Figure F-5 shows the configuration of the
The MPLAB® Code Configurator (MCC) plug-in for PIC16F1615 device peripherals such as AT, CLC, Math
MPLAB X can be used to configure the peripherals in Accelerator and SMT, respectively, used in the CDI
PIC MCU. The MCC provides graphical user interface implementation.
(GUI) tools to easily understand the configuration and

FIGURE F-1: AT CONFIGURATION IN MCC FOR PIC16F1615

FIGURE F-2: CLC CONFIGURATION IN MCC FOR PIC16F1615

DS00001980C-page 30  2015-2016 Microchip Technology Inc.


AN1980
FIGURE F-3: MATH ACCELERATOR IN MCC FOR PIC16F1615

FIGURE F-4: SMT1 CONFIGURATION IN MCC FOR PIC16F1615

To install MCC, go to Tools  Plugins Available Plugins  MPLAB X Code Configurator Install. To start and use
the MCC after installation, go to Tools Embedded MPLAB Code Configurator.

 2015-2016 Microchip Technology Inc. DS00001980C-page 31


AN1980
FIGURE F-5: MCC GENERATED FILES AND FOLDER STRUCTURE

After all the settings are selected in MCC, click the


Generate Code button to generate the peripheral code,
and create a header and a C file for every peripheral
separately. Figure F-2 shows the files created and
arranged under the MCC Generated Files folder for
CDI implementation using AT. The programmer should
add the code wherever it is required in these files.

DS00001980C-page 32  2015-2016 Microchip Technology Inc.


AN1980
APPENDIX G: ENGINE TUNING Installation and Usage of the Desktop
USING PC Application
APPLICATION 1. Start the IgnitionSystemTuning.exe
application. Figure G-1 shows the GUI of the
This section explains the PC-based GUI application
tuning application. The GUI has an Engine
which is developed for the debugging and the engine
Settings area. In this area, the user enters
tuning of a CDI system.
engine parameters and the Angular Timer
As explained in the previous sections, microcontroller- parameters for timing map generation and
based CDI applications have a timing map/look-up tuning. These values can be modified by the
table to handle the advance of the ignition depending user.
upon the engine speed, temperature and throttle
position. These are based on the ignition timing
advance characteristics specified by the engine
manufacturers. Tuning a CDI system by varying firing
angles at different RPMs helps us to check and
improve the efficiency, thereby enhancing the
performance of the engine.

FIGURE G-1: DEBUGGING/TUNING APPLICATION AT START-UP

As shown in Figure G-1, the GUI has a table on the left 2. The application has a menu labeled
consisting of three columns: “Application” on the left topmost corner. Upon
• Engine speed in RPM clicking on it, it displays several menu options
• Firing Angle in Degrees such as “Clear All” and “File”. The “Clear All”
• Dwell Time in µs menu option clears all settings done by the user
in the Engine Settings area and the table. It
There are two text boxes labeled “Application resets the GUI to it’s default state. The File
Messages” and “Application Debug Information”. menu has two options: Save and Load. The
“Application Messages” displays errors and any Save option saves the engine information
messages during the operation. “Application Debug entered by the user in a file at a user-specified
Information” displays the user with real-time engine location. The Load option loads the engine
parameters like engine speed, firing angle, information file from a user-defined location.
temperature and throttle position.

 2015-2016 Microchip Technology Inc. DS00001980C-page 33


AN1980
3. The following list describes the functions of - The following errors can occur:
various buttons on the GUI: “Error: Communication time-out Error” – This
• LOAD MAP – When this button is clicked, the error message occurs when a communication
application finds any connected CDI/TCI board time out happens due to causes such as baud
and starts sending the tuning map data and rate mismatch or any other incorrect serial port
engine parameters set by the user. Figure G-2 settings. The application attempts to resend the
illustrates the messages received while loading data in case of an error.
the map using the GUI. If the data transmission is
“Error: Checksum error” – This error message
successful, a “Data Transmission is successful”
occurs when checksums do not match due to
message is displayed in the application messages
erroneous data transmission or reception. The
box. If unsuccessful, an error message indicating
GUI tries to retransmit up to three times to
the nature of the error is displayed.
recover from this kind of error. If the error is
resolved then a “Data Transmission is
successful” message appears on the
Application Message text box. If the error
persists despite three attempts to retransmit,
then data transmission is halted completely. The
user has to manually check and resolve any
data discrepancies and then press the Load
Map button.

FIGURE G-2: OCCURRENCE OF COMMUNICATION ERROR MESSAGE AND ITS RESOLUTION

• START – Clicking this button will start the tuning


operation with CDI/TCI board. The board sends
real-time data and it is displayed on the GUI.
When the tuning starts successfully, the “Tuning
started successfully” message is displayed.
• STOP – Clicking this button will stop the tuning
operation with CDI/TCI board and will reset the
board for normal operation. If the user tries to start
tuning while the operation is already ON, then the
message “Tuning mode already on” appears. If
the user tries to stop the tuning after it has been
stopped before, then the message “Tuning mode
already off” appears.

DS00001980C-page 34  2015-2016 Microchip Technology Inc.


AN1980
APPENDIX H: CDI WITH REMOTE
KEYLESS ENTRY,
BIKE FINDER AND
IMMOBILIZER
One of the advantages of using the CIPs of the
PIC16F1615/9 for the implementation of the CDI
system is that it frees up the CPU time and also
reduces the code size. This can be utilized for adding
different enhancement features to the system, such as
remote keyless entry (RKE) (i.e., an anti-theft remote
lock, a bike finder and an immobilizer to name a few).
This appendix explores the possibility of implementing
the CDI system with integrated RKE, bike finder and
immobilizer functionalities.

FIGURE H-1: BLOCK DIAGRAM OF CDI WITH RKE, BIKE FINDER AND PASSIVE KEYLESS
ENTRY FUNCTIONALITIES
Spark
300-400V Capacitor Plug
DC-DC HV Supply
SCR
12V Battery Converter
Ignition
Coil
PWM SCR Gate
Control
I/O PKE+Immobilizer
CWG

Angular Timer PWM


CLC LF Initiator
Capture
+
Pick-up signal Signal
Phase
Compare
from pulsar coil Conditioning - CLC AT
Input
ATxCCy
125 kHz
AT Period Pulse Ignition
Firing Angle Enable
SMT SMTxCPR
RKE + Immobilizer
LOGIC
CDI LOGIC
Thermistor Ignition Enable
ADC Map RPM
Vehicle Finder 43 MHz
433
Throttle Selection Calculation Key (KEELOQ
ELOQ
KEELOQ transponder
RPM
Decoder HCS410)
Firing Angle
Calculation
CCP
RF Receiver
Math Accelerator (capture)

Vehicle Finder
I/O LED and Buzzer
PIC16F161x MCU
RKE + BikeFinder

 2015-2016 Microchip Technology Inc. DS00001980C-page 35


AN1980
Remote Keyless Entry and Bike Finder Passive Keyless Entry and Immobilizer
System In a passive keyless entry system, the base unit inside
The remote keyless entry (RKE) system is an the vehicle initiates communication by transmitting out
electronic lock that controls the access to a vehicle a low-frequency signal between fixed time intervals to
without using a traditional key. The RKE system can be search for a transponder (key) in the field. When
used for unlocking doors, as well as starting the engine. located, the transponder in the vehicle automatically
The RKE system consists of two blocks: a keyfob/ responds to the base unit. If a valid authentication
remote and an RF receiver on the vehicle (Figure H-1). response is received, then the base unit performs the
necessary action.
The keyfob has three different push buttons for lock,
unlock and bike finder functionalities. For every An immobilizer is an electronic security feature fitted to
different key press, the transponder in the key sends a an automobile, that prevents the engine from running
stream of 64 or 128 bits encoded data to the key's RF unless a correct key is transmitted. When the keyfob is
transmitter. The transmitter modulates the carrier and in the proximity of the vehicle, it broadcasts a unique
the data is radiated through a simple printed-circuit binary code. This code is read by the automobile’s
loop antenna. The wireless carrier frequency by the immobilizer unit. When the immobilizer unit determines
RKE system is currently 315 MHz in the US/Japan and that the coded key is both current and valid, it enables
433.92 MHz (ISM band) in Europe and Asia. the ignition.
Keyfob uses an HCS410, which is both an LF When the low-frequency (LF) initiator detects a trigger
transponder (battery less) plus KEELOQ® encoder in a input, a coded 125 kHz message is transmitted. Any
single chip. The same keyfob can be used both for the transponder within range of this signal receives this
RKE and the immobilizer functionalities. message and validates the coded data field. If the
initiator is recognized, an RF KEELOQ encoded
For details on how to use an HCS410 for RKE, bike
message is transmitted. A standard RKE receiver
finder and keyfob applications, refer to the application
decodes the packet and, if recognized, appropriate
note AN744, “Modular Mid-range PICmicro® KEELOQ®
action is taken.
Decoder in C”, (DS00000744).
A key or a transponder is a feature of the base unit.
RF Receiver in Vehicle Side This allows the addition of new transmitters into the
system without having to reprogram from the outside.
The data sent by keyfob is captured by the RF receiver During this process, the base station reads the
on the vehicle side. The microcontroller decodes the transponder’s serial number, calculates the
data captured. It then sends an appropriate message to transponder’s key, and gets the transponder’s
lock or unlock the vehicle. If the vehicle is parked in a synchronization counter. The next time the base unit
crowded parking lot, the bike finder key can be pressed receives a transmission or reads the serial number
to locate the vehicle. If the bike finder key is pressed, from a transponder, the base unit searches through its
then the flash lights on the vehicle will blink along with ‘database’ of serial numbers. If the base unit finds the
the buzzer beep, so the user can easily locate the newly acquired serial number, the code hopping portion
vehicle. of a transmission (or response from the transponder) is
For details on how to implement the RF receiver decrypted. The resulting value is then compared to the
section, refer to MICRF229-433 Evaluation Board expected value. An LED can be lit to indicate if the data
User’s Guide. is valid.
For more information on the KEELOQ code hopping,
refer to the technical brief TB003, “An Introduction to
KEELOQ® Code Hopping”, (DS91002).

DS00001980C-page 36  2015-2016 Microchip Technology Inc.


AN1980
APPENDIX I: REFERENCES
1. TB3129 – Signal Measurement Timer on PIC®
Microcontrollers (DS90003129)
2. TB3133 – Configurable Logic Cell on PIC®
Microcontrollers (DS90003133)
3. TB3134 – 16-Bit Multiplication and Addition by
using the Math Accelerator Peripheral on
PIC16(L)F161X (DS90003134)
4. TB3118 – Complementary Waveform Generator
Technical Brief (DS90003118)
5. MPLAB® Code Configurator User's Guide
(DS40001725)
6. AN744 – Modular Mid-range PICmicro®
KEELOQ® Decoder in C (DS00000744)
7. MICRF229-433 Evaluation Board User’s Guide
8. TB003 – An Introduction to KEELOQ® Code
Hopping (DS91002)
9. AN2095 – Transistor Coil Ignition with Integrated
Remote Keyless Entry and Immobilizer Using
PIC® Microcontrollers (DS00002095)

 2015-2016 Microchip Technology Inc. DS00001980C-page 37


AN1980
NOTES:

DS00001980C-page 38  2015-2016 Microchip Technology Inc.


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.

Information contained in this publication regarding device Trademarks


applications and the like is provided only for your convenience The Microchip name and logo, the Microchip logo, AnyRate,
and may be superseded by updates. It is your responsibility to
dsPIC, FlashFlex, flexPWR, Heldo, JukeBlox, KEELOQ,
ensure that your application meets with your specifications.
KEELOQ logo, Kleer, LANCheck, LINK MD, MediaLB, MOST,
MICROCHIP MAKES NO REPRESENTATIONS OR MOST logo, MPLAB, OptoLyzer, PIC, PICSTART, PIC32 logo,
WARRANTIES OF ANY KIND WHETHER EXPRESS OR
RightTouch, SpyNIC, SST, SST Logo, SuperFlash and UNI/O
IMPLIED, WRITTEN OR ORAL, STATUTORY OR are registered trademarks of Microchip Technology
OTHERWISE, RELATED TO THE INFORMATION, Incorporated in the U.S.A. and other countries.
INCLUDING BUT NOT LIMITED TO ITS CONDITION,
QUALITY, PERFORMANCE, MERCHANTABILITY OR ClockWorks, The Embedded Control Solutions Company,
FITNESS FOR PURPOSE. Microchip disclaims all liability ETHERSYNCH, Hyper Speed Control, HyperLight Load,
arising from this information and its use. Use of Microchip IntelliMOS, mTouch, Precision Edge, and QUIET-WIRE are
devices in life support and/or safety applications is entirely at registered trademarks of Microchip Technology Incorporated
the buyer’s risk, and the buyer agrees to defend, indemnify and in the U.S.A.
hold harmless Microchip from any and all damages, claims, Analog-for-the-Digital Age, Any Capacitor, AnyIn, AnyOut,
suits, or expenses resulting from such use. No licenses are BodyCom, chipKIT, chipKIT logo, CodeGuard, dsPICDEM,
conveyed, implicitly or otherwise, under any Microchip dsPICDEM.net, Dynamic Average Matching, DAM, ECAN,
intellectual property rights unless otherwise stated. EtherGREEN, In-Circuit Serial Programming, ICSP, Inter-Chip
Connectivity, JitterBlocker, KleerNet, KleerNet logo, MiWi,
motorBench, MPASM, MPF, MPLAB Certified logo, MPLIB,
MPLINK, MultiTRAK, NetDetach, Omniscient Code
Generation, PICDEM, PICDEM.net, PICkit, PICtail,
PureSilicon, RightTouch logo, REAL ICE, Ripple Blocker,
Serial Quad I/O, SQI, SuperSwitcher, SuperSwitcher II, Total
Endurance, TSHARC, USBCheck, VariSense, ViewSpan,
WiperLock, Wireless DNA, 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.
Microchip received ISO/TS-16949:2009 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and Silicon Storage Technology is a registered trademark of
Tempe, Arizona; Gresham, Oregon and design centers in California Microchip Technology Inc. in other countries.
and India. The Company’s quality system processes and procedures
are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping GestIC is a registered trademarks of Microchip Technology
devices, Serial EEPROMs, microperipherals, nonvolatile memory and Germany II GmbH & Co. KG, a subsidiary of Microchip
analog products. In addition, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified. Technology Inc., in other countries.
All other trademarks mentioned herein are property of their
respective companies.
QUALITY MANAGEMENT SYSTEM © 2015-2016, Microchip Technology Incorporated, Printed in
CERTIFIED BY DNV the U.S.A., All Rights Reserved.
ISBN: 978-1-5224-0452-1
== ISO/TS 16949 ==

 2015-2016 Microchip Technology Inc. DS00001980C-page 39


Worldwide Sales and Service
AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE
Corporate Office Asia Pacific Office China - Xiamen Austria - Wels
2355 West Chandler Blvd. Suites 3707-14, 37th Floor Tel: 86-592-2388138 Tel: 43-7242-2244-39
Chandler, AZ 85224-6199 Tower 6, The Gateway Fax: 86-592-2388130 Fax: 43-7242-2244-393
Tel: 480-792-7200 Harbour City, Kowloon China - Zhuhai Denmark - Copenhagen
Fax: 480-792-7277 Hong Kong Tel: 86-756-3210040 Tel: 45-4450-2828
Technical Support: Tel: 852-2943-5100 Fax: 86-756-3210049 Fax: 45-4485-2829
http://www.microchip.com/ Fax: 852-2401-3431 India - Bangalore France - Paris
support
Australia - Sydney Tel: 91-80-3090-4444 Tel: 33-1-69-53-63-20
Web Address:
Tel: 61-2-9868-6733 Fax: 91-80-3090-4123 Fax: 33-1-69-30-90-79
www.microchip.com
Fax: 61-2-9868-6755 India - New Delhi Germany - Dusseldorf
Atlanta Tel: 91-11-4160-8631 Tel: 49-2129-3766400
China - Beijing
Duluth, GA
Tel: 86-10-8569-7000 Fax: 91-11-4160-8632 Germany - Karlsruhe
Tel: 678-957-9614
Fax: 86-10-8528-2104 India - Pune Tel: 49-721-625370
Fax: 678-957-1455
China - Chengdu Tel: 91-20-3019-1500 Germany - Munich
Austin, TX Tel: 86-28-8665-5511
Tel: 512-257-3370 Japan - Osaka Tel: 49-89-627-144-0
Fax: 86-28-8665-7889 Tel: 81-6-6152-7160 Fax: 49-89-627-144-44
Boston Fax: 81-6-6152-9310
China - Chongqing Italy - Milan
Westborough, MA
Tel: 86-23-8980-9588 Japan - Tokyo Tel: 39-0331-742611
Tel: 774-760-0087
Fax: 86-23-8980-9500 Tel: 81-3-6880- 3770 Fax: 39-0331-466781
Fax: 774-760-0088
China - Dongguan Fax: 81-3-6880-3771 Italy - Venice
Chicago Tel: 86-769-8702-9880 Korea - Daegu Tel: 39-049-7625286
Itasca, IL
Tel: 630-285-0071 China - Hangzhou Tel: 82-53-744-4301 Netherlands - Drunen
Fax: 630-285-0075 Tel: 86-571-8792-8115 Fax: 82-53-744-4302 Tel: 31-416-690399
Fax: 86-571-8792-8116 Korea - Seoul Fax: 31-416-690340
Cleveland
China - Hong Kong SAR Tel: 82-2-554-7200 Poland - Warsaw
Independence, OH
Tel: 216-447-0464 Tel: 852-2943-5100 Fax: 82-2-558-5932 or Tel: 48-22-3325737
Fax: 216-447-0643 Fax: 852-2401-3431 82-2-558-5934
Spain - Madrid
China - Nanjing Malaysia - Kuala Lumpur Tel: 34-91-708-08-90
Dallas
Tel: 86-25-8473-2460 Tel: 60-3-6201-9857 Fax: 34-91-708-08-91
Addison, TX
Tel: 972-818-7423 Fax: 86-25-8473-2470 Fax: 60-3-6201-9859
Sweden - Stockholm
Fax: 972-818-2924 China - Qingdao Malaysia - Penang Tel: 46-8-5090-4654
Tel: 86-532-8502-7355 Tel: 60-4-227-8870
Detroit UK - Wokingham
Fax: 86-532-8502-7205 Fax: 60-4-227-4068
Novi, MI Tel: 44-118-921-5800
Tel: 248-848-4000 China - Shanghai Philippines - Manila Fax: 44-118-921-5820
Tel: 86-21-5407-5533 Tel: 63-2-634-9065
Houston, TX
Tel: 281-894-5983 Fax: 86-21-5407-5066 Fax: 63-2-634-9069
China - Shenyang Singapore
Indianapolis
Tel: 86-24-2334-2829 Tel: 65-6334-8870
Noblesville, IN
Tel: 317-773-8323 Fax: 86-24-2334-2393 Fax: 65-6334-8850
Fax: 317-773-5453 China - Shenzhen Taiwan - Hsin Chu
Tel: 86-755-8864-2200 Tel: 886-3-5778-366
Los Angeles
Fax: 86-755-8203-1760 Fax: 886-3-5770-955
Mission Viejo, CA
Tel: 949-462-9523 China - Wuhan Taiwan - Kaohsiung
Fax: 949-462-9608 Tel: 86-27-5980-5300 Tel: 886-7-213-7828
Fax: 86-27-5980-5118 Taiwan - Taipei
New York, NY
Tel: 631-435-6000 China - Xian Tel: 886-2-2508-8600
Tel: 86-29-8833-7252 Fax: 886-2-2508-0102
San Jose, CA
Tel: 408-735-9110 Fax: 86-29-8833-7256 Thailand - Bangkok
Tel: 66-2-694-1351
Canada - Toronto
Tel: 905-673-0699 Fax: 66-2-694-1350
Fax: 905-673-6509
07/14/15

DS00001980C-page 40  2015-2016 Microchip Technology Inc.

You might also like