INTERRUPT INSIDE An in-depth magazine about embedded technology from Data Respons 1, 2015 Data from An in-depth magazine about embedded technology

Device specific power Industrial connected consumption control things Monitor usage and savings, both What challenges are there, economically and environmentally. and how can we meet them? WHAT’S INSIDE

20 09

IoT: Device specific power FEM 04 consumption control 16 modelling

The eWave tablet has gone through several iterations, This article will focus on piezo electricity, structural dynamics and evolving from an awareness-based display to an active acoustics. When combined with signal processing the entire op- power saving home control device. eration of e.g. a measurement system can be simulated, tested and modified before a real life prototype is produced and tested.

Industrial or commercial 06 wireless mesh technologies IoT: Industrial connected Why would you choose an industrial wireless mesh technology 20 things compared to choosing a commercial wireless mesh solution, Are there lessons to be learned from the industry when we and why choose one industrial wireless mesh technology build the Internet of Things for the future? over another industrial wireless mesh technology?

Voltage and current 09 mode control STM32CubeMX code

Control of a PWM converter comes in two flavours, namely 22 generation tool voltage-mode and current-mode. These two control meth- ods have their own sets of advantages and disadvantages Pros and cons of using STM32CubeMX code generation tool which will be presented in this article. instead of manually writing drivers for an ARM Cortex-M microcontroller.

Article series: 13 High density interconnect We take a closer look at high density interconnect (HDI and the use of microvias.)

ARTICLE SERIES: The impact of consumer electronics on development of high-reliability products This issues article: High density interconnect. Next article: LTB - the dreaded Last Time Buy...

2 | Interrupt Inside EDITOR

WELCOME TO INTERRUPT INSIDE

Data Respons’ vision, a smarter solution starts from inside, is our com- pany’s DNA described in one sentence. We truly believe that we can make the world smarter and we think that this starts from the inside - whether it be inside the heads of our specialist engineers or new technology embed- ded into the world’s products and solutions.

IOT – Internet of Things – is one of the megatrends of our times. Everything surrounding us, not only devices and products, but also wearables and buildings, is getting smarter. In addition, modern wireless technology pro- vides the connectivity in a more efficient and cost-effective manner. Many of the media articles about IOT are often related to consumer applications you control via a smartphone. However, IOT is about THINGS, not people. It is about the Industry- and technology companies integrating IOT and the ANALYTICS into their industrial products and applications. This is where Data Respons, our specialist engineers and our customers are meeting the world of IOT and the specific technology challenges.

In this magazine, we want to highlight relevant technology areas and thoughts related to IOT and connectivity. Additionally, this issue continues the series of articles discussing the impact of consumer electronics in de- veloping high reliability products.

Our own specialist engineers and employees write all of the articles. We welcome any feedback and suggestions from our readers. Enjoy the reading!

KENNETH RAGNVALDSEN

Interrupt Inside |3 INTERNET OF THINGS

DEVICE SPECIFIC POWER CONSUMPTION CONTROL

eWave is an energy display which goal is to raise awareness on the amount

of energy spent in a household, given in kWh, currency and CO2 emissions. The original eWave display was a passive display that only displayed the consumption of the main meter, but the latest version of the device can also actively control user-selected devices in a home to reduce unnecessary con- sumption. eWave is a product of the Sandefjord based company eWave Solutions, previously known as Miljøvakt.

FROM AWARENESS TO CONTROLLED device greatly increases awareness compared POWER SAVING with a more abstract application on a smart- eWave started its life as an idea by entrepre- phone. Since the main instrument for energy neur and founder Gunnar Skalberg. Norway reduction in the original eWave was increased is currently among the top ten in the world awareness of the issue, a concrete and visible when it comes to energy consumption per tablet-based display would prove important. BY: Andre Firing capita. The main reason for this is the cold However, the eWave tablet has gone through Data Respons Alumni weather, and the relatively cheap power several iterations, evolving from an awareness- prices. The main source of the power con- based display to an active power saving home sumption in Norway is arguably heating of control device. houses and water, and lighting. Households have been reported to be responsible for SYSTEM AND FUNCTIONS

almost half of the CO2 emissions in the world, The latest version of the eWave tablet is cur- and eWave Solutions’ goal is to reduce this rently capable of controlling switches wirelessly, significantly. and reading temperatures from wireless ther- mometers. It is also possible to use the eWave The eWave tablet started out as a touch dis- display to keep track of power consumption on play, targeted at a scientific test project. The several circuits, which makes the device perfect decision to go against the mainstream app- for tracking how much energy one single oven based energy displays combined with a gate- is using over time, with associated costs in both

way was a conscious choice. Previous studies currency and CO2 emissions. eWave can also conducted in the UK concluded that a physical display the current consumption of any circuit

4 | Interrupt Inside with a high refresh rate. This feature general consumption reduction of up to This simplifies the user experience and gives the user instant feedback when 20%. Some users were also able to use makes the eWave easier to use. they turn on or off an electric device. the eWave tablet to find electrical faults that increased energy consumption in All energy consumption data is stored The eWave tablet includes many fea- their homes. both locally on the tablet, but also syn- tures targeted at reducing energy con- chronized to a server maintained by sumption, including regular savings tips SOFTWARE AND HARDWARE eWave Solutions. This way, all historical and overview of the current and histori- The tablet used for the eWave project is data is safely stored and available if a cal power price from the energy provid- a custom Android based tablet running device needs to be replaced. Having the ers. The tablet can also keep track of on a dual core ARM Cortex-A9 CPU. The consumption data stored on a remote the household consumption. A savings eWave application was developed using server also enables large scale observa- account application is available in the Qt for Android, which was in the early tion of consumer energy consumption tablet, which lets the user set up a saving stages when the project started. Qt was habits. This data can be used as an in- goal per day, and keeps track of how chosen to ensure platform interoper- dication for future improvements in the much money the user saves over time. ability if another OS is chosen at a later power infrastructure, which can be a The user also sets up a yearly saving stage. Using Qt with minimal Android major asset for the power company. The goal, which the tablet uses for feedback support was somewhat of a gamble, but consumption data can also be used for and status reports every day. as the support grew better, the gamble research and commercial purposes. paid off significantly. Qt is now support- Furthermore, eWave Solutions and Data ing Linux, Android, iOS, OSX, Windows, CONTRIBUTIONS Respons is currently working on extend- WinRT, BlackBerry, Sailfish OS and more, Data Respons has been responsible for ing the eWave functionality further into which makes the eWave application the development of the application since the world of home automation with highly portable. December 2012, and is currently work- more smart control of household power ing closely with eWave Solutions’ CTO on consumption. For wireless applications, the eWave de- the home automation extensions for the vices supports both Z-Wave and ZigBee. product. The eWave project has been an HVALER PROJECT The Z-Wave API is currently only target- important project for the R&D depart- In early 2014, eWave partook in a re- ed at energy readings. For ZigBee, the ment in Asker over the past two years, search project in Hvaler organized by tablet supports clusters for switches, with innovative development and excit- Smart Energi Hvaler. The goal of the thermometers, energy readings and ing new technology. With the increasing project was to test out new energy re- a few others, but more clusters will be focus on reduced energy consumption ducing technology and see the effects it supported when needed. The tablet sets and CO2 emissions, the eWave product had on the consumers. eWave proved itself up as a ZigBee network coordina- projects a brighter future that R&D Ser- to be one of the most influential devices tor, and automatically binds to all pre- vices is proud to be a part of. participating in the project, resulting in a viously known devices that are nearby.

Interrupt Inside |5 INDUSTRIAL OR COMMERCIAL WIRELESS MESH TECHNOLOGIES

This article will try to answer two questions: Why would you choose an industrial wireless mesh technology compared to choosing a commercial wireless mesh solution? Secondly, which industrial technology works best for your application?

INDUSTRIAL VERSUS COMMERCIAL MESH NETWORKS WIRELESS MESH TECHNOLOGIES What is wireless mesh compared to Industrial wireless and commercial wire- other wireless topologies? less mesh technologies often use the same radio technology. For instance A star topology is similar to what you Zigbee, 6LoWPAN, WirelessHART, might find in a home network where SmartMesh IP, and ISA100.11a use a every end node is connected to the cen- 2.4GHz radio. This means we practically tralized router. It’s main vulnerability is can use the same radio HW to run them that if the router is disabled, then the BY: Aksel Bondø Senior Development Engineer all. Therefore there is not much gain in whole network collapses. A cluster tree Data Respons using industrial wireless mesh technolo- is similar to the star topology but with gies over commercial solutions HW wise. peripherals connected to the previous end devices (e.g. a DAQ (Data Acquisi- However, an industrial use case may tion) unit connected to a computer con- need higher performance than com- nected to the server). For the DAQ unit mercial cases. For example: to be connected to the rest of the net- work, both the computer and the server • High reliability needs to be operational. However, in the • Low latency (close to real-time) mesh topology every node can be both • Secure systems an end device or a router, meaning that each node has several links to the co- BY: Alexander Svensen This is where the industrial wireless ordinator. This means that if one of the Development Engineer mesh technologies can provide a better routers goes offline, most of the network Data Respons solution than the commercial solutions. is still intact by rerouting through the re- maining routers.

6 | Interrupt Inside DIFFERENT INDUSTRIAL WIRELESS PARAMETERS SMARTMESH WIRELESSHART SMARTMESH IP NIVIS ISA 100.11A MESH TECHNOLOGIES There are three industrial wireless mesh Indoor range 100m 100m 100m technologies that we will go further into details on in this article: Manager price (100+) (LTP5903-WHR) $654.78 (LTC5800IWR- (Custom) $44.1 IPRA#PBF) $97.79 • SmartMesh IP • SmartMesh WirelessHART Maximum number of 23 27 >40 • Nivis ISA100.11a motes at a 1 second interval

SmartMesh IP is the only one of these Maximum number of 48 65 >65 motes at a 2 second that is built for IP compatibility. Howev- interval er, they all provide resilience, reliability, Mote price (100+) (LTP5901IPC-WHMA1A2#PBF) $59.80 (LTC5800IWR- (Custom) $8.12 scalability, security, and are made for IPMA#PBF) $25.30 low power applications. Network Reliability >99.999% >99.999% >99.999% COMPARISON OF TECHNOLOGIES The use case that the comparison is Network-Wide Yes Yes Yes based upon is 40 nodes in each net- Reliability and Power work, measuring environmental data, Optimization and sending data every second. Number of channels 15 15 16

The compared technologies are Smart- Number of nodes 250 100 250 Mesh WirelessHART node and man- ager modules, SmartMesh IP node and Operating frequency 2.4000 - 2.4835 GHz 2.4000 - 2.4835 2.360 GHz to 2.480 manager modules, and a custom HW GHz GHz designed by Data Respons with the Nivis ISA100.11a stack. For SmartMesh Per Transmission Yes Yes Yes IP and SmartMesh WirelessHART, the Frequency Hopping cost is the cost of the modules, while Raw data rate 250 kbps 250 kbps 250 kbps for the custom ISA100.11a solution, the cost is a combination of develop- Redundant Spatially Yes Yes Yes ment cost, stack license cost, radio cer- Diverse Topologies tification cost, support cost, HW compo- nent cost, and PCB manufacture cost. Temperature –40°C to +105°C –40°C to +105°C -40°C to 105°C

MARKET SHARES Time Synchronized Yes Yes Yes Network-Wide According to CDS, the market share be- Scheduling tween WirelessHART and ISA100.11a is Wireless standards IEC 62591 6LoWPAN and 802.15.4-2006, about 50% for each in average consider- 802.15.4e 6LoWPAN ing Asia, US, and Europe. Open source stack No No Yes • In the Asian market ISA100.11a is in favor.

Interrupt Inside |7 The conclusion is therefore that the choice of technology really depends on the scale of your system.

• In the US market ISA100.11a and The reason the SmartMesh IP is more systems you are better off choosing a WirelessHART is split approximately expensive than the ISA100.11a for high custom ISA100.11a. This way you can 50% for each. volumes is due to the number of nodes keep the cost down and still have a large supported, thus needing more manag- network of nodes. Note that this option • In the European market WirelessHART ers. WirelessHART system is the most requires more development cost than is in favor. expensive but the most utilized mesh the other. technology in Europe and the US. SmartMesh IP is a fairly new protocol, so it has no considerable market share yet. The conclusion is therefore that the choice of technology really depends on CONCLUSION the scale of your system. If you are set- As shown in the cost graph in the para- ting up a small system, WirelessHART graph above, the custom ISA100.11a might be the way to go since you get a is cheaper for high volume production well-tested and used system . given the low cost per mote. SmartMesh IP is a valid option up until about 1000 If you are looking at a mid-sized system managers, but has its strength in keep- with up to 500 nodes, SmartMesh IP ing a low cost for the mid sized systems. would be the logical choice. For larger

8 | Interrupt Inside ELECTRONICS

VOLTAGE AND CURRENT MODE CONTROL Switch Mode Power Supplies power-supplies (SMPS) or pulse width modu- lator (PWM) converters have been with us for many years. They came into serious play in the mid-sixties, just after the introduction of practical power . Control of a PWM converter comes in two flavours; namely volt- age-mode and current-mode. These two control methods have their own sets of advantages and disadvantages which will be presented in this article.

witching power-supplies were not yet The next major advancement was a very popular outside military and space legendary IEEE paper by Cecil Deisch in Sapplication when Silicon General intro- 1978, which introduced current-mode duced the first monolithic (IC-based) pulse control in a practical and easy to under- width modulation controller, the SG1524, in stand circuit. This paper was not the first 1975. Other semiconductor companies did publication on current-mode control, not stand still when SG1524 made its debut. but it was the one that made it known Competitors, like Motorola Semiconductors, to industry. It was not until the early and Signetics, quickly re- 1980s, when Unitrode introduced the sponded and offered similar devices to the first PWM controller with current-mode BY: Frode Sørengen Senior Development Engineer market. All these early devices were based on control, that this control method gained Data Respons voltage-mode control. popularity. >>

Interrupt Inside |9 Soon after the introduction of current- mode PWM controllers, the industry Figure 2. adopted it as the preferred method for Main control scheme for controlling PWM-converters. current-mode control.

CONTROL TECHNIQUES OPERATION VOLTAGE MODE CONTROL In the voltage-mode control scheme shown in Figure 1, the converter output voltage is sensed and subtracted from an external reference voltage with an ADVANTAGES AND DISADVANTAGES error amplifier. The error amplifier pro- Figure 3 shows a simplified schematic of duces a control voltage that is compared a buck-converter. The PWM converter to a constant-amplitude sawtooth wave- power stage consists of the Q form. The comparator produces a PWM (the switching element), diode D, induc- signal that is fed to drivers of controlla- tor L and capacitor COUT. For a voltage- ble switches in the dc-dc converter. The Figure 3. mode control, the output has a second- duty cycle of the PWM signal depends Simplified schematic of order low-pass filter characteristics. For on the value of the control voltage. a buck converter using current-mode control, the output has a current-mode control. first-order low-pass filter characteristics.

Figure 1. Main control scheme for voltage-mode control

CONTROL TECHNIQUES - CURRENT- MODE CONTROL The current-mode control scheme is presented in Figure 2. An additional inner control loop feeds back the induc- tor current signal. This current signal is converted into a proportional voltage, and is compared to the control voltage. The inner current loop turns the induc- tor into a voltage-controlled current source, effectively removing the inductor from the outer voltage control loop (see The advantages and disadvantages of CURRENT-MODE ADVANTAGES Figure 3). The great advantage relative to the two PWM operated control modes The most attractive current-mode ad- voltage-mode control is that it removes are closely linked. Therefore, the advan- vantages are listed below. the double pole caused by the interac- tages and disadvantages are only sum- tion between the output capacitor and marised for current-mode control in the #1: Easy Compensation the power stage inductor. With current- following section. The summary for the Voltage-mode frequency control has mode control, the output characteristics two control methods is by no means a sharp phase drop beyond the filter’s are reduced from double-pole to a sin- complete, although the most important resonant frequency (see Figure 4, blue gle-pole which gives a significant stability items should be included. trace) which requires a type three com- improvement. pensator to stabilize the system. Com- pensation is further complicated by the fact that the loop gain varies with input voltage.

VOLTAGE MODE CONTROL CCM AND DCM Current-mode control looks like a sin- OPERATION gle-pole system at low frequencies (see The difference between the de- Figure 4, red trace), since the inductor is controlled by the current loop. This sired and actual output voltag- Continuous-conduction-mode improves the phase margin, makes the es (error) adjusts the duty cycle (CCM) means that the current converter much easier to control, and in the energy transfer induc- to control the voltage applied results in a higher gain bandwidth over a across the inductor. tor never goes to zero between comparable voltage-mode circuit. switching cycles. Figure 4 (next page) compares the CURRENT MODE CONTROL In discontinuous-conduction- power stage gain and phase of voltage- mode (DCM) the current goes mode and current-mode, demonstrat- The difference between the to zero during part of the ing how much easier the current-mode desired and actual output volt- switching cycle. system is to compensate (because of its ages (error) controls the peak single pole characteristic). inductor current.

10 | Interrupt Inside LOOP GAIN DEFINITIONS

Phase margin: Measure of phase angle above -180 degrees when gain cross- es unity (0dB) for the final time. Phase margin is a measure of relative stability. Should be min- imum 50 degrees for power- supply design.

Gain margin: Measure of gain when phase is below -180degrees. Gain margin is a measure of sensi- tivity to parameter variation. Should be at least 10 dB.

Figure 4. Figure 5. Voltage –mode in CCM and DCM Voltage- and current-mode gain COMPENSATION and phase comparison The compensator is normally included in the error ampli- fier: Its function is to shape #4: Fast response to input voltage the error signal to improve the and load changes Current-mode control responds im- closed-loop transfer function mediately to the input voltage changes #2: RHP Zero Converters and overall performance. and offers good line rejection. The fast Boost- and buck-boost-topology and response is also due to the single “pole” all topologies based on these two to- POLES AND ZEROES system (reduction in the converters dy- pologies, including the commonly used namic order). flyback-converter, has a right half-plane Transfer functions poles and (RHP) zero in the transfer function. With zeros are the frequencies for For voltage-mode, the situation is oppo- voltage-mode control, the transfer-func- which the value of the denomi- site since any change in line or load must tion crossover must be well above the nator and numerator of trans- first be sensed as an output change and resonant frequency, or ringing will be fer function becomes zero re- then corrected by the feedback loop, introduced in the filter. In a converter spectively. which usually results in a slow response. where the crossover frequency is re- Note that many modern voltage-mode stricted by the presence of an RHP zero, controllers are implemented with a feed- this is not always possible. With current- RHP ZERO forward technique which eliminates the mode control, it is not a problem to have effect of input voltage variations, but a control loop crossover at or below the The right-half-plane (RHP) zero complicates the circuit analysis. filter resonant frequency. has the same 20 dB/decade rising gain magnitude as a con- #5. Current limiting on every cycle. #3: CCM and DCM Operation ventional zero, but with 90° Current mode control provides inherent When moving from continuous-conduc- phase lag instead of lead. current limiting on a cycle by cycle basis. tion mode (CCM) to discontinuous-con- Current limiting improves system reli- duction mode (DCM), the characteristics ability in response to current transients. with voltage-mode control are drastical- The power component are protected ly different, as shown in Figure 5. It is not from high peak currents due to this. possible to design a compensator with voltage-mode that can provide good #6: Current sharing with parallel performance in both regions. With cur- modules rent-mode control, crossing the bound- A single error voltage can be used to ary between the two types of operation control multiple converters in parallel. is not a problem. The characteristics are This results in the possibility for equal almost constant in crossover region, as current sharing in modular converters. shown in Figure 6. >>

BODE PLOT

A Bode plot is a graph of the gain (in dB) and phase of the transfer function versus log of frequency. Figure 6. Current –mode in CCM and DCM

Interrupt Inside |11 CURRENT-MODE DISADVANTAGES tegrated power supply makers have and cost sensitive markets. Examples The improvements offered by current- reverted back to voltage-mode control. of this could be wearables, building & mode are impressive, but this technol- This approach reintroduces inflexibility home automation, lightning network, ogy also comes with its own unique set and lack of robustness as voltage-mode food production and retail. of problems which must be solved in the converters are more susceptible to com- design process. ponent variation. It is possible to design It is, however, difficult to imagine that a high performance power supply using IoT applications intended for use in the #1: Current Sensing voltage-mode control, although it will automotive or health care industry or Either the switch current or inductor not achieve the same degree of rug- any IoT device operating in harsh envi- current must be sensed accurately. This gedness as using current-mode control. ronments could accept to compromise requires additional circuitry, and may This too requires skill and effort. on ruggedness. Skilled power supply result in power loss. In most isolated power-supplies, the switch current is sensed either with a resistor or current transformer. A wideband current sens- ing is required to accurately reconstruct the current signal. ...it difficult to imagine that IoT applications Voltage-mode only requires voltage sensing which is easier than current intended for use in the automotive or health sensing. This results in advantages as less noise, sometimes less power loss, care industry or any IoT device operating in less cost, and a higher resolution. harsh environments could accept to compro- #2: Sub-harmonic Oscillations Instability mise on ruggedness. Skilled power supply de- Current-mode control may be unstable signers are able to overcome current-mode when the duty cycle of the converter ap- proaches 50%. A compensating ramp is control noise challenges when required. needed to fix the problem which may in turn introduce other complications.

#3: Signal-to-Noise Ratio The main problem in almost every current-mode supplies is noise on the current sense signal. In many power- supplies there is simply not enough signal to control the converter smoothly over the full range of operation. Voltage- mode control has a large-amplitude ramp waveform which provides good noise margin.

#4: Extremely wide input voltage vari- ation may be difficult to support. A wide input voltage range creates design issues because large variations in PWM duty cycle ratios are required, and exceeding 50% duty cycle introduces issues with slope compensation.

Voltage-mode does not have any duty- cycle restriction.

WHEN TO USE VOLTAGE-MODE CONTROL? It may come as a surprise that voltage- mode control is still used in the indus- try when considering all the presented current-mode advantages above. Manufacturers in many segments would designers are able to overcome current- happily trade off robustness for smaller mode control noise challenges when The main downside of current-mode physical size or reduced unit cost. One required. control has always been the difficulty common characteristic of these seg- of implementation, due to the reduced ments is a limited operating tempera- The conclusion is still that current-mode signal-to-noise ratios in the control loop. ture range which eases the burden of control is the first choice if rugged power It is the designer’s job to make sure the designing a fairly robust power supply supply design is priority. current is sensed cleanly and accurately using voltage-mode control. and it requires skill and effort by the de- signer. One hot example is the latest advance- ment of the Internet, namely Internet of Continual efforts to reduce the physi- Things (IoT). Many IoT applications will cal size pushes switching frequencies probably be implemented using voltage- higher which in turn aggravates the mode control. Especially the applica- noise sensitivity problem, so many in- tions intended for use in the commercial

12 | Interrupt Inside MARKET This article is part of a series of articles regarding the impact of consumer electronics on development of high-reliability products. HIGH DENSITY INTERCONNECT

The previous article in this series discussed how a conventional PCB designed to high reliability requirements is incompatible with component packages with very small spacing between solder connections. Ball Grid Arrays (BGA), the dominant package for complex electronic components, feature sub-millimeter pitch driven forth by the consumer segment and their continual need for integration and miniaturization. Feature sizes demanded by high reliability electronic boards (IPC- 6011, class 3) precludes use of packages with pitch smaller than 0.8mm using a conventional fabrication process, while popular components are offered with pitch of 0.65mm, 0.4mm and even less. Achieving Class 3 compliance when using these packages is only possible by extending the conventional fabrication process with features collectively known as High Density Interconnect or HDI.

BY: Haldor Husby Principal Development Engineer Data Respons

n conventional PCB fabrication, a fea- ture called via accomplishes vertical Iconnection between copper layers of the PCB. Vias are formed when holes drilled through a laminated board are copper plated forming a conduc- tive barrel through the drilled hole. DEFINITIONS FOTO: ELMATICA The barrel makes electrical contact to copper pads etched on the various HDI: Printed circuit board with a higher wiring density per layers and assures connection between unit area than conventional printed circuit boards (PCB). them. Mechanically drilled, the holes They have finer lines and spaces (≤ 100 µm), smaller vias (≤ extend through the entire thickness of 150 µm), and capture pads (≤ 400 µm), and higher connec- the board, and there are practical limits tion pad density (>20pads/cm2) than employed in conven- to how small the drill diameter may be. tional PCB technology Hole diameters smaller than 0.3mm be- comes a cost driver. MICROVIA: A blind hole with diameter ( ≤ 150 µm) having HDI CONSTRUCTION TYPES a pad diameter ( ≤ 350 µm) formed by either laser or me- The object of HDI is to achieve higher chanically drilling, wet/dry etching, photo imaging or conduc- wiring density than conventional boards, tive ink formation followed by a plating operation for product and a central feature of the technol- development. ogy is the microvia, blind vias defined by

>> Interrupt Inside |13 hole diameters smaller than150µm and normally drilled by laser. The microvia only extends between two, or at most tree layers, and is usually used in com- bination with buried vias and regular conventional through-hole vias. A prime example of HDI technology is the BGA package itself which is a printed circuit board with extremely small features.

While the fabrication of conventional PCBs are standardized and well known, HDI boards are constructed in a wide variety of ways. IPC’s sectional design standard for HDI (IPC-2226) details 6 general classes of construction from class I where microvias are formed in the surface of a conventional PCB, to type VI in which electrical interconnections and mechanical structure are formed simul- taneously. One of the prevalent struc- HDI TYPE III STRUCTURE tures, type III, is shown in the illustration to the right. A type III HDI structure has two levels of microvias, buried vias and regular through-hole vias. The fabrication process A COST ADDER … AND SAVER In low-volume segments, microvias were starts with a laminated PCB, which includes plated through- often added to a lay-up when routing a hole vias. Additional dielectric layers and copper foils are design using a conventional structure added to the board in sequential lamination cycles. After each proved difficult or impossible. Adding cycle, small holes are laser drilled and plated to form microvias microvias to a given lay-up adds cost, so between pairs of layers. The through hole vias of the original microvias are often regarded as a cost laminated core form the buried vias in the finished structure. driver to be avoided if possible. Howev- er, designers in the consumer segment use HDI and microvias aggressively to achieve cost reductions.

HDI’s cost saving potential stems from before board routing may even start. Large processor chips may pull sev- its efficient use of space and area which The wider variety of construction types eral tens of Amperes and experience in turn results in higher routing density. and methods demands close technical significant load steps. The grid of large The via structure itself has smaller diam- contact with a capable board shop or through-hole vias under dense BGAs eter and consumes less space. The pri- broker up front. often perforate the power and ground mary advantage, however, comes from planes that supply this current to an the small vertical extension of the micro- The board must be designed for the extent where the flow is restricted. Mi- via, which leaves larger routing channels process it will be manufactured with, crovias, with smaller diameter and lim- on other layers. Judiciously employed requiring a far deeper understanding of ited depth, reduces the perforation and it allows a reduction of the number of process and materials on the part of the helps limit ripple and voltage drops to an layers in the board for a given circuit, designer than with conventional boards. acceptable level. which more than offsets the cost added by the inclusion of microvias. SIGNAL AND POWER INTEGRITY STAGGERED AND STACKED Microvias are also used effectively in When a signal must traverse several Published case studies claims PCB cost improving signal and power integrity. levels of microvias, vias on subsequent reductions in the order of 50% by layer Through-hole vias represent small ca- layers may be placed with a small offset, reduction (from 18 layer to 10 in some pacitive loads and stubs which may in a staggered fashion. It is, however, examples), and reduction in overall cause a degradation of high-speed also possible to stack them right on top board area. When shipping millions of signals. Smaller, shorter microvias pre- of each other and also on top of buried boards the savings are well worth the sents reduced parasitic loads and allows vias. Stacking microvias is more space extra effort. for routing without via stubs. Filled and efficient and makes for easier routing, capped microvias placed directly in com- but there is a cost in terms of reliability. None of this comes easy, however. An ponent solder lands reduces inductance entirely different regime is required to in the power distribution network. Mi- A single microvia by itself is the most re- make the right design decisions in terms crovia in pad is advantageous for high liable interconnect structure of all with of construction type, material choice, speed signaling as well. staggered microvias as a close second. lay-up and the use of the chosen build Stacked vias will experience greater

...the wider variety of construction types and methods demands close technical contact with a capable board shop or broker up front.

14 | Interrupt Inside LAYER REDUCTION

The escape routing from large BGAs usually determines the number of routing layers re- quired in a complex PCB. Most connections must be channeled directly to an inner layer to be routed out of the BGA area. With a conventional PCB struc- ture, the result is a dense grid of through-hole vias that obstruct the path for nets to escape. With 1mm pitch, only a single trace may pass between two adjacent vias resulting in a massive growth in the layer count as the array grows. HDI allows for smaller track and space, and with fewer vias extending through the board, broader routing channels may be established. The result is a higher routing density and significant reduction of the number of routing layers required.

Offset stacked layers of microvia thermal stress during the solder reflow process and is generally less reliable than a conventional through-hole via. The buried via is considered the least reliable structure depending on the details of its formation. For high-reliability boards it is NEXT ARTICLE IN THIS SERIES advisable to use staggered structures, and to take great care in specifying the LTB must be the three most dreaded letters amongst buried vias. those who manage electronic products with long market lifespans. The Last Time Buy notice informs USE WITH CARE AND KNOWLEDGE Adding HDI features to a board only after the user of an electronic component that the fabrica- a designer has struggled and failed to tor will not accept order for the component after some route it using a conventional structure specified date in the near future. Before this date the adds cost without benefit. No one will recipients of the notice must determine how many make good design decisions in despera- tion and on overtime. It is smarter to pieces of the component they need for all eternity and assess if a complex design could ben- place their last order. Armed with uncertain forecasts efit from HDI and consider the various they must balance the capital cost of large compo- design options up front. nent stocks with the risk of lost upsides in the future. Realizing the full advantage of HDI tech- Companies with large portfolios receive LTB-notices nology takes careful planning and in- every week and obsolescence management places a depth knowledge of construction tech- heavy burden on the organization. In the next issue niques, processes and materials. And of Interrupt Inside we look at the drivers behind esca- close cooperation with a capable board- shop or broker from the outset is man- lating obsolescence, obsolescence management and datory. design strategies for products with decades of market life using a supply chain geared for product lifespans of two or three years.

Interrupt Inside |15 DESIGN

FEM MODELLING

FEM modelling is an effective tool that reduces develop- ment time and cost. It can be applied to virtually any field of technology and this article will focus on piezoelectricity, structural dynamics and acoustics. When combined with signal processing the entire operation of e.g. a measure- ment system can be simulated, tested and modified before a real life prototype is produced and tested.

EM (Finite Element Method) is a with FEM-modelling in several projects method for solving the differential dealing with various applications such as Fequations that describe e.g. a me- elastic wave propagation in steel bolts, chanical problem by subdividing the acoustic noise pollution in offshore solution into a number of smaller parts. piling, sound propagation in district In modelling this means that an arbi- heating pipes and a fish tag. trary structure is divided into a number of structural elements often shaped as THE SOUND OF ICE rectangles or triangles (two dimensions) Some of us have perhaps noticed the and rectangular boxes or tetrahedrons peculiar and captivating sound that (three dimensions). occurs when we skip a stone over thin, newly formed on a lake. There are a Examples of technology areas where number of videos on Youtube illustrat- FEM-modelling is used are structural ing this phenomenon and the sound the BY: Erik Asplund mechanics, acoustics, fluid dynamics, skipping makes. It is an interesting chal- Principal Development Engineer heat flow, optics and electromagnetic lenge to model the structural dynamic Data Respons fields. Data Respons has contributed

16 | Interrupt Inside The modelled simulation of the “Sound of Ice” can be experienced in the online version of this article at datarespons.com.

A simple structural dynamics FEM- modelling example showing a tuning fork vibrating and producing the musical note A (440 Hz).

and acoustic phenomena that cause the model which greatly reduces the model fascinating sound. complexity compared to a full 3D-model.

To mimic the proper conditions we need It is interesting to notice that a bounce to model an ice sheet of e.g. 2 cm on top from the stone creates an essentially of a water volume. Above the ice is the finite acoustic pulse in the air even It is interesting to notice air conducting the sound to our ears. though the ice sheet vibrates for a rela- that a bounce from the The impact of the stone is modelled as tively long period of time. However the stone creates an essen- a momentary point force acting perpen- sound pulse in the air gets progressively dicular on the ice in the very centre of longer as the distance from the bounc- tially finite acoustic pulse the model. In reality the listener is static ing point increases. The initial part of the in the air even though the and the stone hits the ice at progressively sound is emanating from the ice imme- ice sheet vibrates for a rel- increasing distances from the listener. In diately surrounding the listener while the the model we do the opposite and move later part of the pulse is dominated by atively long period of time. the listener to different positions (radii) the sound that travelled through the air from the pounding stone. This way we can from the point where the stone hit the model the situation as a cylindrical 2D- ice.

>> Interrupt Inside |17 Modelled acoustic pulses at a height of 1.5 m above the ice and at a distance of 10 m (blue) and 40 m (green) from the point where the stone hit the ice. To the human ear, the pulses cre- ated by the model sounds just like the real acoustic pulses.

The picture shows the modelled acoustic pressure field (air cross section) in 5 m (y-axis) of air above the 2 cm ice sheet at 15 ms after the bouncing moment. It is evident from the picture that the sound reaching the human ear located somewhere along the x-axis (radius) is composed of both sound emanating directly from the ice surface beneath and a pulse travelling through Air the air from the point where the stone hit the ice. The sound coming from the ice below is the result of a hori- zontally propagating vertical vibration of the ice acting on the air above. The pitch of the pulses depends on the thickness of the ice. A 5 cm ice sheet results in a frequency peak at approximately 700 Hz and a 2 cm ice sheet results in a peak at approximately 1500 Hz. Ice sheet Water

This picture shows the pulse (acoustic pressure) after 100 ms, propagating from the point of impact in the centre. The top surface of the model is a matched im- pedance surface allowing the sound to properly leave the model at 2 m above the surface of the ice. Below the ice is the water volume and the model is equally good at modelling what a diver in the water would hear from the skipping stone.

ADVANTAGES WITH MODELLING In practical tests and measurements A reduced need for practical tests and there is always noise present, and it is prototypes is not the only advantage sometimes difficult to independently with modelling. It also visualises phe- change a single parameter in order to nomena otherwise impossible to see study its influence on the total system. or measure and thereby increases the In modelling, individual parameters can intuitive understanding of the mod- be altered at will and noise is not pre- elled process. Examples are sound and sent unless it is deliberately added to mechanical stress fields that are made the model. visual by the modelling tool.

18 | Interrupt Inside ULTRASONIC UNDERWATER DATA COMMUNICATION LINK The performance of an ultrasonic un- derwater data communication link de- 24 mm pends on several factors such as the The picture shows a transducer transducer design, form of modulation model complete with piezoelec- and the acoustic propagation situa- tion. The signal processing necessary tric ring and housing. Moulded for the modulation converting data bits plastic covers the piezo ring to acoustic pulses can be modelled in and protects it from the water. Matlab and the performance of the Piezo It is important to get the design transducer together with the acoustic ring correct and use a suitable mate- circumstances can be modelled using Moulded rial to achieve good mechanical FEM. Combined these two tools let us plastic impedance match between the model and fine tune the entire system piezo ring and the surrounding before moving on to prototype develop- ment and practical tests. water.

An ultrasonic transducer is often reso- nant and the efficiency is strongly de- pendant on the frequency of the car- rier chosen for the data modulation. It is thus essential to know the resonance frequency of the transducer and also the sound radiation pattern as the output power varies with the radiation direction. This is a visualisation of the The piezo electric element vibrates and acoustic level field in the water the vibrations spread through the entire surrounding the transducer. transducer structure and perhaps fur- It is obvious that the intensity ther. The acoustic radiation field depend of the sound at 50 kHz varies on the entire mechanical design of the with both the aspect angle and transducer and modelling reveal how distance and that the maxi- different parts of the transducer vibrate mum communication range and affect the emitted field. FEM enable will depend on the orientation us to test and modify the mechani- of the transducer. The colour cal design in order to reach an optimal scale is in dB rel. 1µPa. acoustic output.

The picture shows (greatly exag- gerated) how the entire transducer vibrates when the piezo ring is excited by the electric 50 kHz signal. This Comsol Multiphysics model includes The graph shows the acoustic output level referred to a distance of 1 m in the piezoelectricity, structural dynamics horizontal plane of the transducer. Clearly the transducer is resonant and is and acoustics and thus models the suitable for a carrier frequency of approximately 50 kHz. The model includes the complete chain from electric input to piezoelectric effect and the transducer is excited by 35 Vrms. acoustic output.

Interrupt Inside |19 CONNECTIVITY

INDUSTRIAL CONNECTED THINGS

n the industry, connecting large net- performance and emissions within the works of sensors and actuators with tolerated limits, or to control the charg- Ismart logic is nothing new. While these ing of batteries in hybrid or electric cars. networks are typically not Internet con- In modern ships, we find highly com- nected, they are however networked plex controller networks, so much that “things”. Are there lessons to be learned a modern ship is more like a floating fac- from the industry when we build the In- tory, managing power, controlling ballast ternet of Things for the future? tanks and thrusters based on a number of inputs from the bridge and from sen- In a typical car bought the last decade, sors, and also providing the operator there are over 70 computers connect- on the bridge with crucial information. ed in an internal network. There are The thrusters can be procured by one BY: Kristoffer Koch sensors that sense if you crash, trig- vendor, while the dynamic positioning Senior Development Engineer gering safety mechanism to save your systems can be bought by a different Data Respons life. There is also a network of sensors vendor, without sacrificing interoper- monitoring the engine in order to keep ability.

20 | Interrupt Inside What challenges are there, and how can we meet them?

NETWORK OF THINGS Z-wave takes some of the same design A basis for making secure software for The key to success for these kinds of decisions as industrial standards, and devices is to have a clear and well de- networks is that the machines speak the specifies how different kinds of devices fined communication protocol. Typically same language. Information a sensor should operate in order to be compliant it is seen that proprietary solutions have gathers is typically not displayed directly with the standards. had less scrutiny and discussion than to a human, but must rather be inter- openly developed standards. One inter- preted and “understood” by another CHALLENGES esting case is the industrial bus HART, machine. A climate control system e.g. While industrial networks have typically which have been extended to a wireless needs to know what units temperature been designed with safety and reliability standard, WirelessHART. In this stand- and humidity is measured and how this in mind, security is another issue. Fea- ard, in addition to the more traditional information is encoded on the network. tures such as authentication, authori- reliability and safety concerns, security For this to work, it is important that de- zon and confidentiality are typically not is also addressed, keeping unauthorized vices adheres to standards. subjects that are being addressed by devices out of the network, and keeping industrial standards. If we are going to messages confidential and authenticat- In automotive, cars typically use Con- apply the experiences from industrial ed using encryption. troller Area Network (CAN) for commu- networked devices to the Internet of nication. First, CAN was mostly a com- things, these are issues that needs to But even a good design can have a buggy munication standard defining how raw be addressed. The security expert Bruce implementation. While we have many information should be sent on the wire, Schneier compares the current situa- good practices for achieving high soft- but have later been extended with more tion to the general computer security of ware quality, it is sadly beyond the state standards that defines in detail behavior the mid-90s, when the Internet first saw of the art to implement perfect software of specific applications. The CANOpen widespread adoption, but without soft- without security holes. A device vendor standards provides a wide range of ware or security practices ready for this that ships a product must acknowledge device profiles for a myriad of applica- revolution. this in order to maintain a satisfactory tions, for everything from medical to- level of security. Security, like hygiene in mography to large crane installations. In 2010, security researchers studied a hospital, must be viewed as an always There is also a standard for writing a the tire pressure sensors of a car. Since ongoing process, embracing the whole standard if none of the existing fits your it is hard to make wired connections to lifetime of the products. In 2014, both application. The marine industry have a rotating wheel, the tire sensors were General Motors and Tesla was ordered also extended CANOpen by standard- made wireless, and this was what inter- to do a recall because of a fire hazard izing how high reliability redundant net- ested the security researchers. By forg- when using damaged charging cables. works can be built for ships, maintaining ing malicious data into the wireless re- GM had to physically bring in all the cars control over the ship even in the events ceiver of the car, the researchers where for repair, while Tesla performed an such as fire disabling parts of the ship. able to take full control of the internal over-the-air software update to detect network of the car, and were able to bad cables, and then limit the currents There is a lot of good work that have monitor and control critical subsystems to safe levels. been put into making such standards for such as engine control and braking. That interoperability, but how does it relate to this breach was possible was mainly due NEED FOR EXPERIENCE a smarter and more connected Internet to a design that did not take into account While we are seeing a growth of new de- of Things? Without standards, we risk security attacks of this kind, but a design vices targeted for the consumer market, ending up with an Internet of incom- that was based on the assumption of se- it is not clear how this myriad of devices patible things, or as Jean-Louis Gassée curity by isolation of the network. should be connected in a meaningful from the Apple initial alumni team put way. The industry have been success- it, we end up with a “basket of remotes”. A conceptually similar attack was brought ful in defining standards and protocols Today we often see each Internet of against nuclear enrichment centrifuges for such use, but there is still work to Thing vendor providing their own app in Iran, with the internet worm stuxnet. be done with security before exporting for controlling their devices, but they Even though the enrichment plant was these ideas to the mass market. Also, provide no way to integrate the differ- not connected to the Internet, this worm it is also wise for the industry to try to ent devices into doing new smart things also spread on USB thumb drives, and learn lessons from the development in in a seamless way. However, home au- in the end, the attack succeeded in spin- the consumer market, where the inno- tomation standards such as ZigBee or ning the centrifuges into destruction. vation moves at a even faster pace.

Interrupt Inside |21 22 | Interrupt Inside HARDWARE

PROS & CONS

- OF USING STM32CUBEMX CODE GENERATION TOOL INSTEAD OF MANUALLY WRITING DRIVERS FOR AN ARM CORTEX-M MICRO- CONTROLLER.

A new trend is emerging from several microcontroller manufactur- ers. Driver code can now be configured and generated using provided tools. This article will take a closer look at a tool named STM32Cube- MX (from here on called Cube) from ST Microelectronics. It is made for their STM32, an ARM based family of microcontrollers. Cube is a graphical tool for selecting, configuring and generating project reports and code. It currently supports all STM32 microcontrollers, both the STM32F and STM32L series, but is only available for the Windows operating system so far. It can be run as a stand-alone application or as a plugin for the Eclipse integrated development environment (IDE).

Cube is a great tool for narrowing down the possible choic- es when selecting a microcontroller. It let the user choose a microcontroller based on the required peripherals, family of microcontrollers, package type, flash size, ram size, mini- mum number of input/output pins and so on.

For getting started quick and easy with prototyping, a board support package and a lot of example project are readily available for the three IDEs: Keil uVision, IAR Embedded Workbench and Atollic TrueStudio. BY: Patrick Hisni Brataas Development Engineer Data Respons CONFIGURATION OF DRIVERS After selecting the correct microcontroller for the applica- tion, the user interface has four main views. Following is a brief explanation of these four views.

PINOUT VIEW This view is shown in figure 1 (next page). It includes a visu- alization of the microcontroller and its pins and has a verti- cal side toolbar. This is where the required peripherals are selected. >> Interrupt Inside |23 to this is that some middleware librar- ies can be enabled from this view even though they do not change the pinout. An example of this is FreeRTOS, which is a real-time operating system. More settings related to the peripherals can be chosen in the configuration view.

CONFIGURATION VIEW The configuration view shows all the enabled peripherals and middleware libraries. In addition, it is possible to configure watchdog functionality, DMA transfers, enable the different interrupts and set additional clock and reset be- havior.

In this view, the configuration of the peripherals is done. It is possible to set the baud rate, data size, endianness, prescaler, clock polarity, etc. of the SPI peripherals or the sampling rate, data conversion mode, resolution, etc., of the ADCs. An example is shown in figure 2.

Figure 1

Figure 2.

Selection of drivers can be made by choosing a pin that support the pe- ripheral directly or by selecting the particular peripheral from the toolbar. The tool will automatically assign the pe- ripheral to the appropriate pins. When using the toolbar, it will solve pin con- flicts by moving a conflicted peripheral to unused pins that also support the peripheral. Sometimes this automatic conflict resolver might not be wanted and therefore it is possible to lock a pe- ripheral to a pin if necessary. Both ways of selecting peripherals do not allow a combination that is not supported by the selected microcontroller.

This view has a focus on pinout and therefore only settings related to each pins possible configuration are set. For example, one can choose to enable SPI in either full duplex, receive only or transmit only. The three possible selec- tions all enables the SPI peripheral, but they also have an effect on which pins are utilized. In this view, it is not possible to set the baud rate, data size, endian- ness, prescaler, clock polarity, etc., as they do not affect the pinout. Another example is enabling an ADC and ADC channel in the pinout view. This affects the pinout, but the selected sampling rate, data conversion mode, resolution, etc., does not.

The pinout view lets the developer enable and configure peripherals that affect the pinout. The only exception

24 | Interrupt Inside CLOCK CONFIGURATION VIEW All clock configurations should be done in the clock configuration view. This view is shown in figure 3 and provides a good overview of the clock tree.

This view enables the developer to choose between external and internal clock sources. Clock frequencies in the clock hierarchy are automatically calcu- lated by setting the oscillator frequency used and adjusting the many prescalers and PLLs.

Invalid clock configurations are clearly shown in red, which makes it easy to dis- cover and fix any incompatibilities.

POWER CONSUMPTION CALCULATOR VIEW This view is used to calculate approxi- mately how much current the microcon- troller, with the selected peripherals and settings, will draw in different modes and in average. Control of the current Figure 3. consumption is important for low-power applications and this tool greatly helps In addition, the most regular batteries user-selected label. the developer. can be selected from a list and the ap- • All power consumption calculations proximate battery life can be estimated done in the power consumption The view lets the developer set param- for a full charge. calculator view. eters as supply voltage, clock frequency, run/sleep/standby mode, RAM voltage, GENERATE PROJECT REPORTS CODE GENERATION enabled peripherals, etc. Reports can be created by a single click After selecting the required peripherals and contains much useful information. in the pinout view and configuring the In lower power applications, the mi- clocks and peripherals, it is possible to crocontroller will often sleep most of The generated report contains informa- generate the initialization code. Not only the time, only waking up periodically to tion like: is the code generated, but all necessary check for events or when an interrupt project files for a chosen IDE as well. In occurs. This means that the microcon- • The selected microcontroller. addition to this, template files are pro- troller most likely has at least two modes • What version of Cube and firmware vided in the project, which gives some with very different parameter values. package version that was used to guidance on how one might structure The power consumption view makes generate the code. the code. it possible to add a sequence of steps, • Which compiler is used and what where one step equals a mode for a set version. In the generated files, there are com- time interval. When all the steps corre- • An overview of microcontroller pins as mented sections where the custom sponding to the different modes have shown in the pinout view. code should be inserted. It is very impor- been added, a graphical representation • Pin list with mappings to package tant that the code the developer writes is created. An example of this is shown pin number, internal pin number/ in generated files is written within these in figure 4. port, peripheral active on pin and a sections. Otherwise it will be gone when the project is regenerated. Even a minor change like changing the baud rate for a peripheral is recommended doing in Cube and not in the generated source Figure 4. file itself. Not because this is any faster (or especially slower), but it will prevent unnecessary possible errors and keep the generated documentation updated. In addition, if at a later time more major changes are to be done and the Cube project is not up to date with the gener- ated code, one must remember to add the changes done to the source file. Always keep Cube updated!

Cube uses the STM32 hardware ab- straction layer (HAL) library to create the initialization code, which makes it a lot easier to migrate between STM32 micro- controllers if needed.

By default, all generated code is put in a header and source file. The generated files can be separated into headers and

>>

Interrupt Inside |25 source files for each type of peripheral PROS, CONS AND EXPERIENCES one peripheral or similar can trigger to get a better overview by adjusting the The Cube is a new software with its initial one interrupt, there is already a handler settings in the top toolbar. This does not release in February 2014 and it still has determining where it was called from include middleware libraries. some bugs. Bugs can be something as and the appropriate callback function is trivial as a missing or repeated line in the called. HOW TO USE THE GENERATED CODE generated code or an error in the user AND HAL interface preventing the use of an actual If the macros provided by the HAL li- As mentioned, the STM32 HAL library is valid setting. Despite this, it saves a lot of brary is used, then the data sheet and used. After the code is generated, eve- time. Additionally, six minor version up- reference manual are your friends to rything should be ready to use the HAL dates have been released in one year, so avoid errors. library to control the peripherals. The it is rapidly becoming better. It should be easy to set up the project in syntax of the HAL library is shown in the IDEs other than the three officially sup- table below: It is easy to get a good overview of the ported ones. Atollic TrueStudio uses the peripherals used and which ones are GCC compiler, which is also supported It is the function calls as shown first in still available. Making changes in the pe- by several other IDEs. the table that should be used to control ripheral configuration is fast and easy, the behavior of the peripherals. To start but keeping the default structure gener- Cube currently does not support gener- a basic timer the HAL_TIM_Base_Start() ated by Cube will probably save a lot of ation of flash initialization code for ena- can be called or to send data over UART time when the code has to be regener- bling reading and writing to flash, but it with DMA one could call HAL_UART_ ated. might be supported in the future. Transmit_DMA(). The pinout view automatically checks for conflicts and resolves them if possible. A pin list can be generated that is useful SYNTAX EXPLANATION for hardware developers designing the custom hardware. Even if this tool is not HAL_PERIPHERALTYPE_Function(PERIHERAL) Function call to perform a function on the used for code generation, it is useful for peripheraltypes peripheral. setting the pinout and determine if the __HAL_PERIPHERALTYPE_FUNCTION(PERIPHERAL) Macro to perform some function on the pe- selected combination of peripherals is ripheraltypes peripheral register. valid. __ PERIPHERAL_FUNCTION() Macro to perform some function on a pe- ripheral. The normal workflow is setting the re- quired peripherals, configure the clock and then configure the peripherals. The power consumption calculator is option- al, but if used it should be used when The second line in the table are macros When new code is generated, one everything else is set and configured. that helps the developer change register should check the initialization code that The Cube uses the HAL library and values. The reason to use macros is that has been changed or added. A quick therefore ensures that the code can they are more portable and reduces the look can reveal missing lines or wrong easily be ported to any other STM32 chance of setting the wrong bit. Depend- settings that might otherwise be hard to chip with minor effort, as long as the re- ing on the application, these macros detect. It is possible to add custom code quired hardware functionality is present. must sometimes be used. For example to the initialization code that will not be when changing the ADC sampling rate removed when the code is regenerated. between two frequencies while the ap- This makes it possible to correct many plication is running. code generation errors.

The last line in the table can typically only All necessary callback functions are al- enable and disable clocks to peripherals ready prototyped and only the defini- and functionality related to reset. tions have to be written. If more than

GET EXPERIENCE Add weight to your career by working hands on in exciting and challenging technology projects. R&D SERVICES

26 | Interrupt Inside INSIDE WRITERS

HALDOR AKSEL HUSBY BONDØ Principal Development Engineer Senior Development Engineer Data Respons Data Respons

MASc Electrical Engineering, University of Toronto MSc Systems Engineering, Stevens Institute of Technology Siv.Ing. Electronics, Norwegian University of Science and Technology

FRODE ERIK SØRENGEN ASPLUND Senior Development Engineer Principal Development Engineer Data Respons Data Respons

Siv.Ing. Electronics, Norwegian University of Science and Technology MSc. Electrical Engineering, Royal Institute of Technology (KTH), Stockholm, Sweden.

KRISTOFFER PATRICK HISNI KOCH BRATAAS Senior Development Engineer Development Engineer Data Respons Data Respons

Master of Technology, Electrical Engineering, Digital Design MSc Electronics and Computer Technology, Medical Technology, Norwegian University of Science and Technology (NTNU) University of Oslo.

ALEXANDER ANDRE SVENSEN FIRING Development Engineer Development Engineer Data Respons Data Respons Alumni

MSc Robotics and Intelligent Systems, University of Oslo.

CONTRIBUTORS

BENT FUREVIK GUNNAR ANDREAS SKOGVOLD

Development Engineer Development Engineer Data Respons Data Respons

PUBLISHER: EDITOR-IN-CHIEF: EDITOR: TECHNICAL EDITOR: Data Respons ASA, Kenneth Ragnvaldsen Elisabeth Andenæs, Ivar A. Melhuus Sehm Sandviksveien 26, 1363 Høvik CEO, Data Respons Senior Communications Consultant Director R&D Services, Data Respons Tel: +47 66 11 20 00 Data Respons [email protected] [email protected] Tel: +47 92 20 30 03 Email: [email protected]

Interrupt Inside |27 MARITIME CERTIFIED PANEL PCs

Data Respons’ latest series of rugged Panel PCs designed and tested for maritime and offshore environments.

8” Maritime Panel PC The 8” Maritime Panel PC is a rugged low power multi-touch computer based on a Quad Core ® Atom™ Bay Trail processor and has a fanless, minimalistic design with a 8”panel with multi-touch sensor.

12” Maritime Panel PC The 12” Bay Trail Maritime Panel PC is based on a Quad Core Intel® Atom™ Bay Trail processor with low power consumption and has a fanless, minimalistic design with a 12” panel with multi-touch sensor

24” Maritime Panel PC The 24” panel multi-touch computer is based on an Intel® Core™ i5 (optional Core i7) Ultra Low Voltage CPU, SSD storage with no rotational parts and up to 16GB DDR3 memory.

datarespons.com