2013-IEEE Detection of Electromagnetic Interference in Microcontrollers Using the Instability of an...

8
IEEE TRANSACTIONS ON ELECTROMAGNETIC COMPATIBILITY, VOL. 55, NO. 2, APRIL 2013 299 Detection of Electromagnetic Interference in Microcontrollers Using the Instability of an Embedded Phase-Lock Loop Shih-Yi Yuan, Member, IEEE, Yu-Lun Wu, Richard Perdriau, Senior Member, IEEE, and Shry-Sann Liao, Member, IEEE Abstract—This paper presents a combined hardware–software mechanism for the detection of electromagnetic interference of a microcontroller (μC) in daily usage. This detection mechanism is based on the instability of phase-lock loop embedded in the target μC. It can detect the presence of EMI with higher sensitivity than polling the hardware status of the μC internal registers and thus provides a better detection margin within the 10 kHz to 1 GHz EMI frequency range. Despite its relative slowness and its resource consumption, it is very robust, can be implemented in virtually any application software, and does not require any electromagnetic compatibility test equipment. Index Terms—Electromagnetic compatibility (EMC), electro- magnetic radiation, near fields, phase-locked loops. I. INTRODUCTION C URRENT trend of consumer electronics requires com- pactness and durable power. Power supply voltages of such applications are drastically cut down to reduce power con- sumption along with a negative influence on noise margin. In the meantime, radiofrequency interference (RFI) or electromag- netic interference (EMI) sources are becoming more and more ubiquitous due to ever growing wireless communication envi- ronment. In addition, data transfer rates are becoming much faster (up to several GHz) while system complexity and func- tionalities are increasing; printed circuit board (PCB) tracks in high-speed circuits are getting relatively longer and become electromagnetic (EM) antennas [1] which can propagate RFI up to sensitive devices or integrated circuits (ICs). Therefore, in normal operations and daily usages, electro- magnetic susceptibility (EMS) issues of microcontroller (μC) or embedded systems have become more and more important [2]. Manuscript received December 8, 2011; revised May 4, 2012 and July 30, 2012; accepted August 28, 2012. Date of publication October 26, 2012; date of current version April 11, 2013. This work was supported by the National Science Council (NSC) of the Republic of China under the Project 100-2221- E-035-035 and NSC-101-2221-E-035-050. S.-Y. Yuan is with the Department of Communications Engineering, Feng Chia University, Taichung 40724, Taiwan (e-mail: [email protected]). Y.-L. Wu is with the Department of Ph.D. Program of Electrical and Commu- nications Engineering, Feng Chia University, Taichung 40724, Taiwan (e-mail: [email protected]). R. Perdriau is with the Department of Electronics and Physical Sciences, ESEO, Angers 49009, France (e-mail: [email protected]) S.-S. Liao is with the Department of Communications Engineering, Feng Chia University, Taichung 40124, Taiwan (e-mail: [email protected]). Color versions of one or more of the figures in this paper are available online at http://ieeexplore.ieee.org. Digital Object Identifier 10.1109/TEMC.2012.2218285 μCs can be affected or even subject to total malfunction un- der powerful RFI in common environments. Modern μC cannot determine whether RFI is “strong” enough to disturb its func- tionality during normal operations. Previous researches focused on IC EM simulation [3]–[5], IC EM measurement and analy- sis [5]–[7], IC EM modeling and parameter extraction [8]–[10], IC EM laboratory device design and modeling [11]–[13], or IC EM detection by laboratory equipment [7], [11], [12]. These re- search works are for different design phases. However, in final products, it is still not possible to embed any EMI measurement device small enough into a μC system to detect EMI for daily usages. The solution for detecting EMI under such conditions is a tough problem. It needs to inform users or to trigger some EMI defensive strategies through software interface. Thus, it requires a combined hardware–software EMI detection mechanism. The mechanism can generate alert signals by special hardware, in- form users by software, and activate proper EMI defensive soft- ware strategies embedded in the μC. This paper focuses on building such detecting mechanism which can provide system software (for example, an operating system) with a “presence of EMI” piece of information or alert. This paper focuses mainly on the construction and validation of the proposed hardware–software coworking detection mech- anism. This paper also discusses the sensitivity of the mecha- nism, the configurability of the criterion, and the accuracy and overhead of the mechanism. The purpose of this paper does not study the failure mech- anisms of any functional parts of a μC. Just like other studies on μC EMI modeling and parameter extractions [8]–[10], due to the complexity of μC, the relationship between the proposed mechanism and the internal functional parts of a μC is not this paper’s scope either. This detection mechanism requires several important charac- teristics: first of all, it must be sensitive enough to detect external EMI when EMI appears. Second, the sensitive level adjustment and triggering should be easy and configurable. Third, it can provide some methods (or channels) to communicate with soft- ware. Fourth, it should be fast enough to decrease the response time of defensive software. Last but not least, it requires as few computing resources as possible in order to reduce detection overhead in such systems. Generally, a modern μC is equipped with at least one pro- grammable embedded phase-lock loop (PLL). The embedded PLL is used to keep the system clock accurate from jitter and 0018-9375/$31.00 © 2012 IEEE

description

Abstract—This paper presents a combined hardware–softwaremechanism for the detection of electromagnetic interference of amicrocontroller (μC) in daily usage. This detection mechanism isbased on the instability of phase-lock loop embedded in the targetμC. It can detect the presence of EMI with higher sensitivity thanpolling the hardware status of the μC internal registers and thusprovides a better detection margin within the 10 kHz to 1 GHzEMI frequency range. Despite its relative slowness and its resourceconsumption, it is very robust, can be implemented in virtuallyany application software, and does not require any electromagneticcompatibility test equipment.

Transcript of 2013-IEEE Detection of Electromagnetic Interference in Microcontrollers Using the Instability of an...

Page 1: 2013-IEEE Detection of Electromagnetic Interference in Microcontrollers Using the Instability of an Embedded Phase-Lock Loop

IEEE TRANSACTIONS ON ELECTROMAGNETIC COMPATIBILITY, VOL. 55, NO. 2, APRIL 2013 299

Detection of Electromagnetic Interference inMicrocontrollers Using the Instability of an

Embedded Phase-Lock LoopShih-Yi Yuan, Member, IEEE, Yu-Lun Wu, Richard Perdriau, Senior Member, IEEE,

and Shry-Sann Liao, Member, IEEE

Abstract—This paper presents a combined hardware–softwaremechanism for the detection of electromagnetic interference of amicrocontroller (μC) in daily usage. This detection mechanism isbased on the instability of phase-lock loop embedded in the targetμC. It can detect the presence of EMI with higher sensitivity thanpolling the hardware status of the μC internal registers and thusprovides a better detection margin within the 10 kHz to 1 GHzEMI frequency range. Despite its relative slowness and its resourceconsumption, it is very robust, can be implemented in virtuallyany application software, and does not require any electromagneticcompatibility test equipment.

Index Terms—Electromagnetic compatibility (EMC), electro-magnetic radiation, near fields, phase-locked loops.

I. INTRODUCTION

CURRENT trend of consumer electronics requires com-pactness and durable power. Power supply voltages of

such applications are drastically cut down to reduce power con-sumption along with a negative influence on noise margin. Inthe meantime, radiofrequency interference (RFI) or electromag-netic interference (EMI) sources are becoming more and moreubiquitous due to ever growing wireless communication envi-ronment. In addition, data transfer rates are becoming muchfaster (up to several GHz) while system complexity and func-tionalities are increasing; printed circuit board (PCB) tracks inhigh-speed circuits are getting relatively longer and becomeelectromagnetic (EM) antennas [1] which can propagate RFI upto sensitive devices or integrated circuits (ICs).

Therefore, in normal operations and daily usages, electro-magnetic susceptibility (EMS) issues of microcontroller (μC) orembedded systems have become more and more important [2].

Manuscript received December 8, 2011; revised May 4, 2012 and July 30,2012; accepted August 28, 2012. Date of publication October 26, 2012; dateof current version April 11, 2013. This work was supported by the NationalScience Council (NSC) of the Republic of China under the Project 100-2221-E-035-035 and NSC-101-2221-E-035-050.

S.-Y. Yuan is with the Department of Communications Engineering, FengChia University, Taichung 40724, Taiwan (e-mail: [email protected]).

Y.-L. Wu is with the Department of Ph.D. Program of Electrical and Commu-nications Engineering, Feng Chia University, Taichung 40724, Taiwan (e-mail:[email protected]).

R. Perdriau is with the Department of Electronics and Physical Sciences,ESEO, Angers 49009, France (e-mail: [email protected])

S.-S. Liao is with the Department of Communications Engineering, FengChia University, Taichung 40124, Taiwan (e-mail: [email protected]).

Color versions of one or more of the figures in this paper are available onlineat http://ieeexplore.ieee.org.

Digital Object Identifier 10.1109/TEMC.2012.2218285

μCs can be affected or even subject to total malfunction un-der powerful RFI in common environments. Modern μC cannotdetermine whether RFI is “strong” enough to disturb its func-tionality during normal operations. Previous researches focusedon IC EM simulation [3]–[5], IC EM measurement and analy-sis [5]–[7], IC EM modeling and parameter extraction [8]–[10],IC EM laboratory device design and modeling [11]–[13], or ICEM detection by laboratory equipment [7], [11], [12]. These re-search works are for different design phases. However, in finalproducts, it is still not possible to embed any EMI measurementdevice small enough into a μC system to detect EMI for dailyusages.

The solution for detecting EMI under such conditions is atough problem. It needs to inform users or to trigger some EMIdefensive strategies through software interface. Thus, it requiresa combined hardware–software EMI detection mechanism. Themechanism can generate alert signals by special hardware, in-form users by software, and activate proper EMI defensive soft-ware strategies embedded in the μC.

This paper focuses on building such detecting mechanismwhich can provide system software (for example, an operatingsystem) with a “presence of EMI” piece of information or alert.This paper focuses mainly on the construction and validationof the proposed hardware–software coworking detection mech-anism. This paper also discusses the sensitivity of the mecha-nism, the configurability of the criterion, and the accuracy andoverhead of the mechanism.

The purpose of this paper does not study the failure mech-anisms of any functional parts of a μC. Just like other studieson μC EMI modeling and parameter extractions [8]–[10], dueto the complexity of μC, the relationship between the proposedmechanism and the internal functional parts of a μC is not thispaper’s scope either.

This detection mechanism requires several important charac-teristics: first of all, it must be sensitive enough to detect externalEMI when EMI appears. Second, the sensitive level adjustmentand triggering should be easy and configurable. Third, it canprovide some methods (or channels) to communicate with soft-ware. Fourth, it should be fast enough to decrease the responsetime of defensive software. Last but not least, it requires as fewcomputing resources as possible in order to reduce detectionoverhead in such systems.

Generally, a modern μC is equipped with at least one pro-grammable embedded phase-lock loop (PLL). The embeddedPLL is used to keep the system clock accurate from jitter and

0018-9375/$31.00 © 2012 IEEE

Page 2: 2013-IEEE Detection of Electromagnetic Interference in Microcontrollers Using the Instability of an Embedded Phase-Lock Loop

300 IEEE TRANSACTIONS ON ELECTROMAGNETIC COMPATIBILITY, VOL. 55, NO. 2, APRIL 2013

instability. The effects of EMI on PLL are reported by Leeet al. [7]—when H-field strength is applied on PLL, a jittervariation is observed. A PLL includes a voltage controlledoscillator which is also proven to be very sensitive to powerdisturbances [6]. However, different intensity of EMI may ormay not lead to loss of data or fail of a μC—the detection crite-ria should be more sensitive and respond faster before the failureconditions. Since the PLL is sensitive to external EMI, it fulfillsthe first detection mechanism requirement.

As will be detailed in following sections, the proposed mecha-nism counts the status changes and the duration of these changesas criteria of the external EMI detection. Because the criteria de-pend on the counting of the status change and durations, one caneasily change the alert condition (or sensitivity level) by modi-fying the “tolerance of the deviation” of the normal condition.Thus, the second requirement is fulfilled.

Thanks to the current embedded PLL designs, the PLL isprogrammable and can reflect its status to software system. ThePLL status can be communicated between system hardware andsoftware by “polling” or “interrupt” mechanisms [11]. In manyμCs, the hardware statuses of peripherals are stored in “statusregisters” which can be queried by software. Thus, modern PLLcan be used to feed EMI information to software through such“software communication channel” and the third characteristicis satisfied.

Of course, the “software communication channel” requires asoftware loop to scan the status registers repeatedly. This kindof hardware–software mechanism is called “polling.” Polling isnot efficient and much CPU time is wasted. Another way forsoftware to get the updating of the status registers is by a newkind of hardware help: interrupt mechanism. Special hardwareis designed to raise an “interrupt flag” when a predefined eventoccurs (for example, a state change of a status register).

Interrupt mechanism is both response faster than pollingmechanism and consumes less CPU time. All modern μCs areequipped with at least one PLL and PLL status register. Gener-ally, modern μCs include PLL interrupt status registers as well.These designs make PLL software detection a good candidatefor EMI detection. Due to the interrupt mechanism implementedin PLL, the last two requirements are fulfilled. However, the pro-posed mechanism depends on several hundreds of detection it-erations for robustness. Thus, the current mechanism of the EMIdetection–decision–alert cycle is still slow. This can be tradedoff between the EMI detection false-alarm ratio and detectionresponse time.

Since a PLL is not designed for EMI detection purpose, someconcerns can be raised. One of them is how can it be surethat, when a μC is under an EMI aggression, the PLL is themost sensitive one and, hence, is the most suitable candidate forEMI detection. The second concern is that the PLL hardwareis limited and is used for system synchronization. There is nodedicated PLL for the proposed EMI detection mechanism. Thethird concern is that a PLL can be stopped under very severe EMIaggression and, therefore, the proposed method is not applicableto such scenario. The fourth concern is how to design defensivesoftware which can take countermeasures to avoid the loss ofdata when the proposed mechanism detects EMI.

These concerns may be addressed as follows. For the firstconcern, the other functional parts (such as ALU, internal flash,internal RAM, etc.) are digital circuits. Research [14] has shownthat the functionalities of digital circuits are less sensitive toEMI. If a device includes both analog and digital circuit (inthis case, a μC), the analog PLL EMI behavior is more sensitivethan digital parts and can make early EMI warnings to the digitalparts.

About the second concern, this paper aims to demonstratethat the proposed hardware–software mechanism can actuallydetect RFI through the use of an embedded PLL. If this conceptis acknowledged and adopted by industry, it is quite certain thatmore suitable hardware or designs, based on this concept, willbe integrated into stock μCs. For now, a designer can still im-plement this concept into a system by using a low-cost spare μCdedicated to EMI detection if EMI detection is critical concernsin the applications.

The third concern is important: the PLL may stop workingunder severe RFI, which leads to the proposed mechanism be-ing unusable. This issue must be taken into account and manypreliminary tests must be conducted in order to determine thevalidity domain of this method. This issue will be fully consid-ered in Section II-C. It should be noticed that the immunity toelectrostatic discharges, which can also disturb the PLL opera-tion, is not the scope of this paper.

The fourth concern is about the defensive software designissue but it is not the topic considered in this paper. Manydifferent behaviors can be chosen once the system is aware of theEMI alert, for example, modifying the resolution of the analog–to–digital converter if RFI reduces its accuracy, saving criticaldata to nonvolatile storage, resetting or even shutting down thesystem in case of a more severe EMI aggression. Although thispaper can inform software with the presence of EMI, the EMIdefensive strategy and software must be customized accordingto the purpose of the target applications in target environments.

This paper defines “PLL lock time” as the time from PLLbeing enabled to the time that system clock is locked by PLL.The proposed EMI detection mechanism bases on the countingof the PLL lock time to give an early stage EMI attacking warn-ing. This is very important to life-critical or accuracy-criticalembedded systems such as avionic system, guiding system, carelectronics, etc.

This method can only be implemented in embedded systemswith the following characteristics.

1) The system must be equipped with at least one μC.2) The μC must be equipped with at least one PLL functional

part.3) The status of the PLL functional part can be queried by

software.It seems the limitations are many. However, these character-

istics are generally included in modern μCs and the proposedmethod can be easily implemented.

This paper proposes a method to detect the PLL lock time’svariation and its relationship to external EMI. The result showsthat the proposed method can detect external EMI more sensi-tively. The extrasensitivity lefts the circuit more time to trig-ger (activate) strategies to dealing with EMI at early stage

Page 3: 2013-IEEE Detection of Electromagnetic Interference in Microcontrollers Using the Instability of an Embedded Phase-Lock Loop

YUAN et al.: DETECTION OF ELECTROMAGNETIC INTERFERENCE IN MICROCONTROLLERS 301

when the circuit is still functionally correct under external EMIattacks.

A special PLL interrupt service routine (ISR) is designedfor EMI detection; this ISR fulfills both of the aforementionedrequirements: it is a high-priority program with a fast responsetime. The ISR overhead of the detection mechanism can beneglected because it uses only small fraction of CPU time andmemories.

This paper also considers the sensitivity of the proposedmethod to EMI at different frequencies. The sensitivity is quan-tified by “fault margin” which is defined to be the RFI power dif-ference between the malfunction of a target μC and the detectionof the RFI. Large fault margin means the detection mechanismcan provide a μC more time to trigger (activate) EMI defensivestrategies. Negative fault margin at any interested frequenciesmeans the failure of the proposed detection mechanism.

The immunity of a μC depends on what the EMS strategies oralgorithms implemented in such μC. The detection mechanismcan only provide accurate information to the strategies. Theproposed solution is for early warning of the external EMI andfocuses on the software external EMI detection mechanism. Inshort, we provide a “software EMI sensor” mechanism. Howthe mechanism is used by EMS algorithm in a μC is not whatthis paper’s topic.

This paper is organized as follows. First, Section II introducesthe experimental setup used in this study. Section III describesthe concepts of the PLL-based detection method. Section IVpresents all experimental results. Finally, Section V providesconclusions and perspectives.

II. EXPERIMENTAL SETUP

A. Device Under Test (DUT)

The DUT of this paper is the same as in [12]. It is a 16-bitFreescale μC belonging to the S12X family (MC9S12XDT256).The embedded PLL of the DUT can generate a stable internalclock from a lower frequency reference clock. The PLL outputclock frequency is controlled by the input clock frequency and aprogrammable multiplication factor. The multiplication factorsof the DUT are controlled by two registers: SYNR and REFDV.The SYNR register controls the multiplication factor of thePLL and the REFDV register (loop divider) provides a finergranularity for the PLL multiplier steps. The PLL frequencycan be set by following formula:

PLLCLK =2 × OSCCLK × (SYNR + 1)

(REFDV + 1)(1)

where OSCCLK is the frequency of the external reference clockand PLLCLK the frequency of the PLL output clock. The PLLhas two states: locked and unlocked. Without EMI, the PLLstate should change only once (from unlocked to locked) afterit is enabled. The first action to be taken in EMI testing is toconfirm that, without EMI, this state actually changes once andnot back and forth. For subsequent experiments, a 4-MHz inputclock (crystal oscillator) is chosen.

Fig. 1. Test board.

Fig. 2. Experimental injection setup.

The test board is designed by the University Institute of Tech-nology (IUT) in Tarbes, France. It includes three seven-segmentdisplays, one LCD module and four pushbuttons (see Fig. 1).

In order to determine if the μC is still in normal operation orhas failed under interference, the embedded software makes oneseven-segment display flash. Another seven-segment display isdesigned to be an alert signal. It will be turned ON by thesystem when the system gets an RFI alert from the implementeddetection mechanism.

B. Injection Method

The RFI coupling method used in this paper is near-fieldinjection (NFI), which is under standardization process by theInternational Electrotechnical Commission (IEC) under the IEC62132-9 reference. The setup for this experiment includes asignal generator, a 30-W power amplifier (Amplifier ResearchAR30W1000B), a power meter, and a directional coupler. Fig. 2shows the proposed architecture, where P1 is the incident powerand P2 is the reflected power. The actual injected power can becalculated from P1, P2 and the attenuations of the directionalcoupler.

In order to ensure a homogeneous field coupling into thetarget μC, a “skate probe” [9] is used courtesy of IUT Tarbes.The skate probe is a square PCB with a 1-cm2 area, coveredby copper foil tape and fitted with an SMA connector. Thesebroadband probes make it possible to disturb the DUT withless power. An H-field probe is used as an RFI source in thispaper. The H-probe has two orientations (Hx and Hy ). Hx is

Page 4: 2013-IEEE Detection of Electromagnetic Interference in Microcontrollers Using the Instability of an Embedded Phase-Lock Loop

302 IEEE TRANSACTIONS ON ELECTROMAGNETIC COMPATIBILITY, VOL. 55, NO. 2, APRIL 2013

Fig. 3. H -probe orientations.

Fig. 4. RFI detection setup.

determined with the current loop parallel to the VDDPLL pin, asshown in Fig. 3. The distance between the probe and the DUTis 1 mm.

The whole RFI detection setup, with the generator, the am-plifier and the coupler, is shown in Fig. 4.

We have run several testing routines (not shown in this paper)to make sure some of the targeted functionalities (PLL, I/O, andALU) are correct. However, fully functional checking is out ofour capability. A commercial product can be trusted to be fullyfunctional when the design follows the design rule supported bythe manufacturer and we have to trust the manufacturer’s QCprocedure. This μC is a commercial product from Freescale andis considered to be fully functionally qualified in the case of noEMI power injected.

C. Verification of the Validity Domain of the Method

This verification addresses the third concern raised in theintroduction: the PLL may crash under sever RFI aggression,which will lead to the proposed hardware–software mechanismfail. It is verified that the μC can still working under maxi-mum interference power (45 dBm) delivered by the amplifier.Previous papers [10], [15] used 25 and 40 dBm maximum in-jection power, respectively. If the environment RFI is withinthis range, the presented mechanism can work successfully. IfRFI levels are more severe than 45 dBm, it is likely to fail likeother pure hardware-based EMI detection mechanism. If thislimit is reached without any failure, the DUT is considered im-mune enough. Although only one μC case (MC9S12XDT256,with many samples) is tested, this case study demonstrates thatmodern PLL technology can be robust enough to operate under45-dBm power in an NFI experiment.

Fig. 5. Definition of clock count.

Fig. 6. CC measurement flow by PLL ISR and PIT.

III. PROPOSED EMI DETECTION METHOD

A. Definition of Clock Count (CC)

The CC is defined as the number of system clock periodsfrom the effective activation of the PLL to its locking, namely,the duration of the “unlocked” state (see Fig. 5).

When applying EMI to the DUT, the loss of lock condition(the sequence of “lock → unlock → lock”) is also checked inthis μC. We use our power amplifier to the largest power levelallowable (see Fig. 2) and we find no such condition occurs.However, if other μC has such condition, our method can bemodified by adding another “Loss of Lock Counter” (LoLC) forcounting the number of loss of lock conditions—the modifiedmechanism depends on these two counters: LoLC and CC. Themodified mechanism would be slightly more complex. However,it can be easily applied to such μC and can still provide an earlystage warning.

B. CC Measurement by ISR

In order to measure CC, a specific PLL ISR is designed usingan embedded timer (PIT, periodic interrupt timer), as depicted inFig. 6. When the μC starts executing its main routine, the ISR isalso set to “Active” as indicated in Fig. 5. At the same time, thePIT is enabled to count down. When the PLL status switches tothe “locked” state, the ISR is waken up by the interrupt signal,reads the PIT counter to measure the CC value, and transfersthe CC value to the main program. This method also makesit possible to confirm the “lock only once” hypothesis in the

Page 5: 2013-IEEE Detection of Electromagnetic Interference in Microcontrollers Using the Instability of an Embedded Phase-Lock Loop

YUAN et al.: DETECTION OF ELECTROMAGNETIC INTERFERENCE IN MICROCONTROLLERS 303

Fig. 7. Flowchart of CCs statistics.

absence of EMI. The ISR flow and pseudocode are shown inFig. 6.

C. PLL Lock Curve (PLC) and Distance Measurement

According to the CC measurement method developed above,500 CCs are successively measured for a given PLL outputfrequency. The procedure of CC measurements are repeated foreach output frequency, from 8 to 160 MHz in 8-MHz steps (20PLL output frequencies), both with and without EMI.

From the experiments conducted on the S12X μC, it is no-ticed that the measured CCs (both with and without EMI) arelimited to a small set of values, such as 406, 422, 438, 454, . . . ,598. Therefore, it is possible to build a histogram of the occur-rences of these CCs. A CC histogram at a specific PLL lockingfrequency is defined as a PLC. A PLC without RFI is called the“base PLC” and a PLC with RFI is called the “target PLC.” Theflowchart for the establishment of PLCs is shown in Fig. 7. Theexperiments are performed after the whole setups are poweredON. The PLL is programmed according to Fig. 7 to be ON (orOFF) at specified time. There are 20 different histograms forthese 20 different “f .” Each of them is measured under a singlePLL output frequency.

Since the process needs 500 CCs for each loop, the detectiontime is slow (about 0.5-s per frequency). This is about the sameprocessing speed or a little faster than a standard IEC 62132-9test for one frequency, but it can be implemented without anyelectromagnetic compatibility equipment.

Fig. 8 plots the PLC under 620-MHz injection frequencywhich is one of the most sensitive frequencies for this DUT [12];the output frequency of Fig. 8 is set to 4 MHz (f = 4 MHz) whichis the same as [12]. Other frequencies can be measured by the

Fig. 8. PLCs with RFI (dotted) and without RFI (solid) by NFI at 620-MHzdisturbance injection (PLL output frequency = 4 MHz).

same statistics flow. However, due to no other literature resultscan be compared with, the comparisons of these frequenciesreomitted. As can be seen, PLCs with and without EMI can betold apart, which means that PLC is sensitive to EMI.

The worst case of the total RFI detection time tRFIdetect ofthe proposed EMI detection method implantation in this papercan be represented as

tRFIdetect = ((NINIT + NISR + NSTAT)

∗ Tclk ∗ Ncc + CCDur) ∗ Nfreq . (2)

where NINIT , NISR , and NSTAT are the machine code count ofthe ISR/timer initialization, the PLL interrupt service routine,and the routines for statistics; Tclk is the clock period; Ncc is thenumber of a CC histogram measurement (or one f -iteration ofFig. 7); CCDur is the average time depending on ambient RFIcondition; and Nfreq is the number of RFI frequency.

In this paper, NINIT = 16, NISR = 3, NSTAT = 30, Tclk =0.25 μs (4 MHz), and Ncc = 500; the CCDur is among 94–146 μs (depends on the RFI frequency injected); and Nfreq =20.

Although tRFIdetect is expressed by (2) for worst case esti-mation, CCDur is overlapped with other CPU execution timebecause CCDur is determined by PLL component and does notuse CPU during the detection time. Thus, the proposed methoddoes not waste any CPU time. The RFI detection can concur-rently coexist with other programs (for example, the statisticsprogram (NSTAT) or any other unrelated application software).Thus, the worst case detection time for one frequency is lessthan 6.3 ms and the overall 20 frequencies detection time is lessthan 0.13 s which is much less than the time for current labora-tory measurement, not to mention the preparation time for suchmeasurement.

Another issue is that due to the detection mechanism is basedon interrupt mechanism. There is no loop inside the single RFIdetection flow. Only the Ncc is a loop count for multiple RFIfrequency detections.

Since PLCs are sensitive to RFI, it is possible to detect EMIby comparing PLCs directly at a given PLL frequency. Since theestablishment of a PLC consists in repeated measurements, only“quasi-static” EMI can be detected. The difference between two

Page 6: 2013-IEEE Detection of Electromagnetic Interference in Microcontrollers Using the Instability of an Embedded Phase-Lock Loop

304 IEEE TRANSACTIONS ON ELECTROMAGNETIC COMPATIBILITY, VOL. 55, NO. 2, APRIL 2013

Fig. 9. Extraction of the final base PLC from ten PLCs without EMI. (a) Tenmeasurements of the base PLC. (b) Average of (a).

PLCs can be defined by the squared Euclidean distance:

dist(A,B) =n∑

i=1

(ai − bi)2 (3)

where A is the base PLC, B the target PLC, i the index in theCC set of values, and n the number of different CC values in theset. In this paper, the base PLC is constructed by averaging tenPLCs without EMI, as shown in Fig. 9; in fact, it can be seenthat the PLC distributions of different measurements are verysimilar and stable.

Then, the squared Euclidean distance between the target PLC(with EMI) and the base PLC is computed. The variations ofmore/less PLC measurements have been done from five timesup to 10 000 times. However, ten times PLC variation is veryclose to the variation of 10 000 times and we choose ten tosave detecting time. The EMI detection threshold is set to thelargest distance among the ten PLCs obtained without EMI. Ifthe computed distance is greater than this threshold, it meansthat the μC is being subject to EMI. In this case, the softwaretriggers an EMI alarm which is indicated by one of the seven-segment displays.

The detection algorithm is summarized in Fig. 10.

IV. EXPERIMENTAL COMPARISON WITH OTHER DETECTION

METHODS

A. Register-Based Detection Method

The most convenient procedure for the detection of opera-tion failures in the S12X consists in monitoring its status reg-isters, particularly the clock status register (CRGFLG). In all

Fig. 10. Flowchart of the RFI detection using the PLC method.

Fig. 11. Immunity comparison between PLL ON (solid) and PLL OFF (dot-ted), courtesy of [12].

subsequent paragraphs, the test setup is the one described inSection II-A.

The first experiment, described in [12], consisted in deter-mining the influence of the PLL on the immunity of the μCby E-field skate probe. These results are obtained by pollingthe CRGFLG register for any change; with the PLL OFF, theself-clocked mode (SCM) bit is the only one used to identifya possible malfunction whereas, with the PLL ON, the LOCKand TRACK bits, respectively, representing the lock/unlock andacquisition states, are also polled. Fig. 11 represents the S12Xsusceptibility plots for both PLL-ON and PLL-OFF states (in-jected power versus frequency) between 10 MHz and 1 GHz; thelower the injected power, the more susceptible the μC accordingto the criterion.

It can be seen that, except for a few discrete frequencies (450and 620 MHz) where the detection threshold of the PLL (LOCKbit) is lower (by 9 dB at 620 MHz), the register-based detectionmethod using the PLL does not carry any improvement over theSCM bit.

Page 7: 2013-IEEE Detection of Electromagnetic Interference in Microcontrollers Using the Instability of an Embedded Phase-Lock Loop

YUAN et al.: DETECTION OF ELECTROMAGNETIC INTERFERENCE IN MICROCONTROLLERS 305

Fig. 12. Comparison between the register- and PLC-based detection methodfor a Hx injection by the frequency of disturbance at 620 MHz.

Fig. 13. Susceptibility plots versus frequency in Hx field for the register-basedmethod (dotted) and the PLC-based method (solid).

B. PLC-Based Detection Method

With the aforementioned results as a reference, another ex-periment is conducted using the PLC method described inSection III. Since the PLL seemed to be particularly sensitive at620 MHz, this frequency is chosen for the first test. Fig. 12 plotsmeasurement results for both methods in the same operatingconditions (Hx injection).

These preliminary results are quite promising (PLC improvesthe detection threshold by 7.9 dB over register polling). There-fore, a broadband EMI test is performed. As explained inSection II-A, one display is made to flash while another oneshowed detection information. The maximum injected poweris set to 45 dBm (maximum power delivered by the amplifier).Consequently, in subsequent plots, a 45 dBm susceptibility levelindicates that the μC could not detect any interference with ei-ther method. Figs. 13 and 14 depict susceptibility plots withboth methods, respectively, for Hx and Hy injections. The dot-ted lines in Figs. 13 and 14 are similar but not the same to thesolid line in Fig. 11. In Fig. 11, the power is injected by E-probe,while in Figs. 13 and 14 the power are injected by H-probe withtwo vertical directions.

These experimental results show that the PLC-based methodis always more sensitive than the register-based method in everyfrequency band. In Fig. 13, the minimum difference is 2.75 dBat 260 MHz. The Hy injection (see Fig. 14) presents similarresults except for 560–580 MHz where PLC is less sensitive.At this time, the authors do not have any explanation for thisphenomenon.

Fig. 14. Susceptibility plots versus frequency in Hy field for the register-basedmethod (dotted) and the PLC-based method (solid).

Fig. 15. Characterization of the fault margin for Hx probe.

Fig. 16. Characterization of the fault margin for Hy probe.

This demonstrates that PLC is a very efficient method thatcan detect EMI as low as 23 dBm (200 mW) depending onfrequency.

C. Fault Margin

The fault margins (defined in Section I) of different frequen-cies are the sensitivity measurement of the proposed mechanism.The failure criterion is the output malfunction of the DUT. In thispaper, the output malfunction of the DUT is the seven-segmentdisplay to stop flashing. As would be expected, the detection ofEMI through the internal PLL is more sensitive than that throughthe μC’s output responses by external measurement device (seeFigs. 15 and 16). The fault margins of every frequency are non-

Page 8: 2013-IEEE Detection of Electromagnetic Interference in Microcontrollers Using the Instability of an Embedded Phase-Lock Loop

306 IEEE TRANSACTIONS ON ELECTROMAGNETIC COMPATIBILITY, VOL. 55, NO. 2, APRIL 2013

negative. It means the EMI can be detected before the DUT failsat interested frequency range. Due to the EMI nonsensitive tosome frequencies, these frequencies’ fault margins are zero (thepower for EMI detection and failing of DUT are beyond themaximum power injected).

V. CONCLUSION

This paper proposes a combined hardware–software mecha-nism for the detection of EMI in μCs. This detection mechanismuses the instability of integrated PLLs which are proven to bevery sensitive to EMI. The purpose of this paper is the electro-magnetic interference detection in microcontrollers through therelationships between the PLC variation and intensity of externalEMI, the behavior changes due to such EMI, and the detectionmechanism of such change. This paper neither studies the fail-ure mechanisms of any functional parts nor the relationships ofthe detecting mechanism to any functional parts.

This method is based on counting the number of clocksneeded for the PLL to lock after being started. An NFI testin magnetic field demonstrated that the EMI detection thresh-old using this method is much lower (by an average of 10 dB)than by polling the status register of the internal clock manager.Therefore, the inclusion of a second PLL dedicated to this mech-anism could be a valuable solution to enhance EMI detectioncapabilities in μCs.

The next step should consist in using this information to de-sign “defensive software” which could take appropriate coun-termeasures to protect data in case of strong EMI.

REFERENCES

[1] S. Grivet-Talocia, M. Bandinu, F. G. Canavero, I. Kelander, andP. Kotiranta, “Fast evaluation of electromagnetic interference betweenantenna and PCB traces for compact mobile devices,” in Proc. IEEE Int.Symp. Electromagn. Compat., Aug. 2008, pp. 1–5.

[2] M. Ramdani, E. Sicard, A. Boyer, S. Ben Dhia, J. J. Whalen, T. H. Hubing,M. Coenen, and O. Wada, “The electromagnetic compatibility of inte-grated circuits—Past, present, and future,” IEEE Trans. Electromagn.Compat., vol. 51, no. 1, pp. 78–100, Feb. 2009.

[3] E. Sicard and G. Peres, “A novel software environment for predicting theparasitic emission of integrated circuits,” Proc. IEEE Int. Symp. Electro-magn. Compat., vol. 3, pp. vii–xix, Aug. 2005.

[4] A. Boyer, E. Sicard, and S. Ben Dhia, “IC-EMC, a demonstration freewarefor predicting Electromagnetic Compatibility of integrated circuits,” inProc. 19th Int. Asia-Pacific Symp. Electromagn. Compat., May 2008,pp. 16–19.

[5] S. Y. Yuan, H. E. Chung, and S. S. Liao, “A microcontroller instructionset simulator for EMI prediction,” IEEE Trans. Electromagn. Compat.,vol. 51, no. 3, pp. 692–699, Aug. 2009.

[6] E. Orietti, S. Saggini, P. Mattavelli, and G. Spiazzi, “Electromagneticsusceptibility analysis on a digital pulse width modulator for SMPSs,”IEEE Trans. Electromagn. Compat., vol. 51, no. 4, pp. 1034–1043, Nov.2009.

[7] Y. J. Lee, T. Kane, J. J. Lim, L. Schiano, Y. B. Kim, F. J. Meyer,F. Lombardi, and S. Max, “Analysis and measurement of timing jitterinduced by radiated EMI noise in automatic test equipment,” IEEE Trans.Instrum. Meas., vol. 52, no. 6, pp. 1749–1755, Dec. 2003.

[8] T. Steinecke, H. Koehne, and M. Schmidt, “Behavioral EMI models ofcomplex digital VLSI circuit,” Proc. IEEE Int. Symp. Electromagn. Com-pat., May 2003, vol. 2, pp. 848–851.

[9] S. Akue Boulingui and S. Baffreau, “Conception d’une nouvelle sondepour etudier l’immunite champ proche de circuits integres,” presented atthe Compatibilit Lectromagntique, Paris, France, May 2008.

[10] S. Baffreau and E. Sicard, “On the modeling of microcontrollers immunityto radio frequency interferences,” presented at Int. Workshop Electromagn.Compat. Integrated Circuits, Angers, France, Mar. 2004.

[11] J. L. Peterson and A. Silberschatz, Operating System Concepts, 6th ed.New York: Wiley, 2011.

[12] S. Baffreau, R. Perdriau, and S. Y. Yuan, “Assessment of the immunityof a dual-core 16-Bit microcontroller to near-field injection,” presented atthe Int. Workshop Electromagn. Compat. Integrated Circuits, Toulouse,France, Nov. 2009.

[13] S. Pan, J. Kim, S. Kim, J. Park, H. Oh, and J. Fan, “An equivalent three-dipole model for IC radiated emissions based on TEM cell measurements,”in Proc. IEEE Int. Symp. Electromagn. Compat., Jul. 2010, pp. 652–656.

[14] B. Hu and K. Y. See, “Impact of analog/digital ground design on circuitfunctionality and radiated EMI,” presented at the 7th Electron. Packag.Technol. Conf., Singapore,, Dec. 2005.

[15] A. Boyer, S. Bendhia, and E. Sicard, “Modeling of a mixed signal pro-cessor susceptibility to near-field aggression,” in Proc. IEEE Int. Symp.Electromagn. Compat., Jul. 2007, pp. 1–5.

Shih-Yi Yuan (M’07) received the Ph.D. degree inelectrical engineering from National Taiwan Univer-sity, Taipei, Taiwan, in 1997.

He joined the Department of Communica-tions Engineering, Feng Chia University, Taichung,Taiwan, where he is currently an Associate Professorand Member of Integrated Circuits ElectromagneticCompatibility (ICEMC) Center, Feng Chia Univer-sity. His research interests include compiler design,ICEMC modeling, software solution for electromag-netic compatibility problems.

Yu-Lun Wu was born in Changhua, Taiwan, in1976. He received the M.S. degree in communicationengineering from Feng Chia University, Taichung,Taiwan, in 2007, where he is currently working to-ward the Ph.D. degree in Ph.D. Program of Electricaland Communications Engineering.

His research interests include integrated circuitelectromagnetic compatibility and radio-frequencycircuit design.

Richard Perdriau (M’01–SM’07) was born inAngers, France, in 1971. He received the engineer-ing degree in electronics and computer science fromESEO, Angers, in 1992, the Ph.D degree in appliedscience from the Catholic University of Louvain,Louvain-la-Neuve, Belgium, in 2004, and the Ac-creditation to Supervise Research (HDR) degree inelectronics from the University of Rennes 1, Rennes,France, in 2012.

Since 1992, he has been an Associate Professorat ESEO, in the fields of microelectronics and em-

bedded systems. His research interests include electromagnetic compatibility ofintegrated circuits, mixed-signal hardware description languages, and integratedcircuit design.

Shry-Sann Liao (M’02) was born in Taiwan in 1954.He received the B.S. and M.S. degrees in physics fromTamkang University, Tamshui, Taiwan, in 1976 and1978, respectively, and the Ph.D. degree in physicsfrom the University of Texas at Dallas, Richardson,in 1988.

From 1979 to 1983, he was a Nuclear Engineer atthe Taiwan Power Company, Taipei, Taiwan, wherehe was engaged in providing education and trainingto engineers who had worked in nuclear power plants.Since 1988, he has been an Associate Professor in the

Department of Electronic Engineering, Feng Chia University, Taichung, Taiwan,where he has also been in the Department of Communication Engineering since2002. In 2006, he had been a Professor in the Department of CommunicationEngineering and the Director of the integrated circuits electromagnetic com-patibility Center. He has taught at various levels and has developed specializedcourses in radio-frequency circuit design at both the undergraduate and gradu-ate levels. The current research interests include electromagnetic compatibility,integrated circuits electromagnetic compatibility, and microwave.