AVR Microcontrollers Get MPLAB X IDE Support

Designers who have traditionally used Microchip’s PIC microcontrollers and developed with the MPLAB ecosystem can now easily evaluate and incorporate AVR MCUs into their applications. The majority of AVR MCUs are now beta supported with the release of MPLAB X Integrated Development Environment (IDE) version 5.05, available now from Microchip Technology. Support for additional AVR MCUs and enhancements will be added in future MPLAB versions. AVR support will continue to be added to Atmel Studio 7 and Atmel START for current and future AVR devices.

MPLAB X IDE version 5.05 provides a unified development experience that is both cross-platform and scalable with compatibility on Windows, macOS and Linux operating systems, allowing designers to develop with AVR MCUs on their hardware system of choice. The tool chain has been enhanced with support for Microchip’s code configuration tool, MPLAB Code Configurator (MCC), making it easy for developers to configure software components and device settings such as clocks, peripherals and pin layout with the tools’ menu-driven interface. MCC can also generate code for specific development boards, such as Microchip’s Curiosity ATmega4809 Nano (DM320115) development board and existing AVR Xplained development boards.

More compiler choices and debugger/programmer options are also available when compiling and programming AVR MCUs using MPLAB X IDE 5.05. Compiler choices include the AVR MCU GNU Compiler Collection (GCC) or the MPLAB XC8 C Compiler, providing developers with additional advanced software optimization techniques to reduce code size. Designers can also accelerate debugging and programming using MPLAB PICki 4 programmer/debugger tool or the newly released MPLAB Snap programmer/debugger tool.

The majority of development boards available to evaluate and program AVR MCUs are supported by the MPLAB ecosystem and MCC. Xplained development boards are compatible with START and are now compatible with MPLAB X IDE. Xplained development boards are cost-effective, fully integrated MCU development platforms targeted at first-time users, makers, and those seeking a feature-rich rapid prototyping board. The Xplained platform includes an integrated programmer/debugger and requires no additional hardware to get started.

MPLAB X IDE version 5.05, MPLAB XC8 C Compiler and AVR MCU GCC are available for free on Microchip’s website. The MPLAB PICkit 4 (PG164140) development tool is available today for $47.95. The MPLAB Snap (PG164100) is available today for $14.95. The ATmega4809 Curiosity Nano board (DM320115) is available today for $10.00.

Microchip Technology | www.microchip.com

MCUs Provide Inductive Sensing Solution

Cypress Semiconductor has announced production availability of the PSoC 4700S series of microcontrollers that use MagSense inductive sensing technology for contactless metal sensing. The series also incorporates Cypress’ industry-leading CapSense capacitive-sensing technology, empowering consumer, industrial, and automotive product developers to create sleek, state-of-the-art designs using metals and other materials. The highly-integrated MCUs enable cost-efficient system designs by reducing bill-of-material costs and provide superior noise immunity for reliable operation, even in extreme environmental conditions.
Cypress also announced availability of the new CY8CKIT-148 PSoC 4700S Inductive Sensing Evaluation Kit, a low-cost hardware platform that enables design and debug of the MCUs. The kit includes MagSense inductive-sensing buttons and a proximity sensor, as well as an FPC connector to evaluate various coils, such as a rotary encoder. The PSoC 4700S series is supported in Cypress’ PSoC Creator Integrated Design Environment (IDE), which allows users to drag and drop production-ready hardware blocks, including the MagSense inductive sensing capability, into a design and configure them easily via a simple graphical user interface.

The PSoC 4700S MCUs integrate:

  • A 32-bit Arm Cortex-M0+ core
  • Up to 32 KB Flash and 4 KB SRAM
  • 36 GPIOs
  • 7 programmable analog blocks
  • 7 programmable digital blocks

Support for up to 16 sensors, enabling implementation of buttons, linear and rotary encoders, and proximity sensing.

The CY8CKIT-148 PSoC 4700S Inductive Sensing Evaluation Kit is available for $49 at the Cypress online store and from select distributors.

Cypress Semiconductor | www.cypress.com

Firms Team to Teach Implementing Power Supplies on STM32 MCUs

STMicroelectronics and Biricha Digital Power, an industrial training and consultancy company focused on switched power design and EMC, have developed a workshop to show power-supply engineers why and how to quickly move to a digital implementation. The workshop, aimed at analog PSU (Power Supply Unit) designers and embedded-system engineers who need to build high-performance, stable digital power supplies and Digital PFCs (Power Factor Corrections), will be based on a complementary portfolio of tailored hardware, software, tools, labs and detailed training documentation.

This includes the STM32F334 product line (with its high-resolution timer – 217 ps), a member of ST’s STM32 family of more than 800 MCUs covering the full spectrum from ultra-low power to high performance and supporting ecosystem, combined with Biricha’s Power Supply and PFC design software.

Key sessions will demonstrate how to quickly design digital power supplies and power factor correction from scratch, and how to design stable digital control loops for both voltage and current mode DC/DC and PFC applications. Workshop participants will get a chance to design, code, implement, and test several digital power supplies. The first workshop, an all-inclusive 4-day course hosted by Future Electronics, is scheduled for November 27-30, 2018 in Munich, Germany.

Biricha Digital Power | www.biricha.com

STMicroelectronics | www.st.com

MCU-Based Project Enhances Dance Game

Using Wavelet Transform

Microcontrollers are perfect for systems that need to process analog signals such as audio and do real-time digital control in conjunction with those signals. Along just those lines, learn how these two Cornell students recreated the classic arcade game “Dance Dance Revolution” using a Microchip PIC32 MCU. Their version performs wavelet transforms to detect beats from an audio signal to synthesize dance move instructions in real time without preprocessing.

By Michael Solomentsev and Drew Dunne

We designed a version of the traditional arcade game, “Dance Dance Revolution,” that synthesizes dance instructions from any audio source using the PIC32 MCU. Unlike the original game, in which users must choose from a pre-selected list of songs, our system allows users to plug in their audio device and play songs of their choice. The dance move instructions are then generated in real time by buffering the audio and processing it, using the discrete wavelet transform.

We were inspired by a mutual desire to work on a music-related project, and both of us had fond memories of playing this kind of game. We also wanted to add some sort of novel, interesting component, so we brainstormed the idea of allowing the player to play whatever song he or she wanted. The game is much more fun when the song playing is your favorite tune. All versions of the commercial game have pre-programmed song libraries, so replay value is limited. Our version has no such limitation. The discrete wavelet transform was selected as a processing method because we needed both time and frequency resolution. We also needed a computationally efficient algorithm.

The system requires two kinds of user input: an audio source and button presses from the dance mat floor tiles. The audio input must be processed, so it needs to be delayed or buffered until the processing is complete. Another reason for the delay of the audio output is to give ample time for the user to react to the instructions created from processing the audio. In contrast, the user input needs to be in real time. We use two PIC32s to do the input processing—one detects beats and reads the dance mat input, while the other buffers audio. We use a macOS application to display the beats and handle scoring.

Figure 1
Overview of our entire “Dance Dance Evolution” project fully set up

We built a custom dance mat for the game, consisting of five individual tiles that could each detect when players put their weight on it (Figure 1). They needed to be both durable and sensitive to pressure. To achieve this, we used force sensitive resistors wired in parallel. These were polled at approximately 20 Hz for changes in resistance. These resistors were placed directly between the tiles—which were made out of canvas covered boards—and the supports that raised them off the ground.

Hardware Design

We used a PIC32 development board designed by Sean Carroll, with an DAC socket and GPIO pins brought out, to provide flexibility for development [1]. We also used a second PIC32 on a smaller development board, with connections to the floor tiles and the Serial to USB cable. The floor tiles were wired underneath to a protoboard, and all-important signals were fed up to our main protoboard using a ribbon cable. Figure 2 shows the schematic of the system, incorporating Sean Carroll’s full-size and small PIC32 development boards.

Figure 2
Shown here is the schematic of the system, incorporating Sean Carroll’s full-size and small PIC32 development boards.

We soldered our audio circuitry on a protoboard to make it easier to debug and to reduce noise. Our audio input jack fed into a 500 µF capacitor to cut out any DC component, then we fed it into an offset circuit, such that the ADCs could read it with no clipping. The DAC output was fed directly to an audio jack and speakers.

Another PIC32 MCU handled audio buffering, because SPI communication with both a 128 KB serial SRAM and DAC took too many cycles to perform the necessary signal processing simultaneously. We used our professor Bruce Land’s code for the SRAM chip for reading and writing to the SRAM and writing to the DAC [2]. His code included some read/write methods, and handled the SPI setup and mode changes. We had to add code to read from the ADC in a timer interrupt at 40 kHz, write to a location in the SRAM, and finally read from a different location and write that value to the DAC. The locations written to and read from were incremented each time, to create a loop around the SRAM memory locations. To change how long we wanted to buffer the audio, we just needed to change the values of MAX_ADDR and MIN_ADDR. The closer together they were, the smaller the range of the SRAM we used. This was important, because using the entire SRAM gave us a buffer of about 3.3 seconds, and we wanted only about 2.5 seconds.

The major consideration that affected our tile construction was a desire for resiliency. Because users would probably stomp on each of the tiles fairly hard, we wanted to make sure that our press detection system could withstand a lot of force. We also wanted a simple, easy solution to mock-up and build.

Initially we looked into using strain gauges, but they would require mounting to a base plate and the tile to be pushed. Traditional buttons did not seem like a robust enough option. Instead, we decided to use force sensitive resistors (FSRs). Initial testing revealed that the unpressed FSRs had resistance of approximately 6 MΩ. When pressed, it was approximately 1 kΩ. This huge discrepancy made it easy to probe it for a press. We thank Interlink Electronics, who were gracious enough to donate 10 FSR402s for use in our project. ..

Read the full article in the November 340 issue of Circuit Cellar

Don’t miss out on upcoming issues of Circuit Cellar. Subscribe today!

Note: We’ve made the October 2017 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

IAR Updates Dev Tools for Renesas Automotive MCUs

IAR Systems has announced a major update of its development tools for Renesas automotive-focused RH850 microcontrollers. The latest version of the complete C/C++ compiler and debugger toolchain IAR Embedded Workbench for Renesas RH850 offers boosted user experience and extended capabilities through a number of new features.

IAR Embedded Workbench for Renesas RH850 incorporates a compiler, a debugger, an assembler and a linker in one integrated development environment. It is available in several editions to suit different company needs, including a functional safety edition certified by TÜV SÜD according to IEC 61508, ISO 26262 and EN 50128. Renesas Electronics’ RH850 automotive MCU family includes rich functional safety and embedded security features needed for advanced automotive applications.
Version 2.10 of IAR Embedded Workbench for Renesas RH850 adds compliance with the latest C language standard ISO/IEC 9899:2011 and the latest C++ standard ISO/IEC 14882:2014, ensuring high-quality, future-proof code. Renowned for producing very efficient code, the IAR C/C++ Compiler™ in IAR Embedded Workbench for Renesas RH850 now supports stack protection and stack usage analysis functionality. Available as an add-on for the toolchain is the static analysis tool C-STAT, which is now updated with a number of new checks. With these additions, developers building RH850-based applications are able to further strengthen code quality, stability and reliability in their embedded applications.

Automotive embedded applications are growing in complexity, which means it can be challenging to make a correct setup of peripherals from scratch. The Renesas Smart Configurator is a tool for combining software, automatically generating control programs for peripheral modules, and pin setting from the GUI with built-in cross-checks to avoid potential contention with multiplexed functions. In version 2.10 of IAR Embedded Workbench for Renesas RH850, automated code generation from Renesas Smart Configurator is made possible through the straight-forward project connection functionality.

IAR Systems | www.iar.com

Fog-Detection Audio Project

Using Arduino UNO

Fog reduces visibility, sometimes down to a few feet. That’s why fog horns are so important. In this article, Jeff embarks on a project that makes use of humidity sensors to detect fog, and automatically plays an audio response when fog is detected. Aside from the sensors, his project also makes use of Arduino hardware and software.

By Jeff Bachiochi

Pea soup. Not one of my favorite dishes. I just can’t see green soup. All that said, as a consistency descriptor, “pea soup” is spot on for describing fog. You don’t have to live in San Francisco to appreciate the alien qualities of the scene in Figure 1. This phenomenon is commonplace to those who reside in London, Seattle, on any lake or in any valley. All we need is the right combination of temperature and humidity, and the clouds of heaven will visit us here on Earth.

Fog consists of visible water droplets suspended in the air at or near the Earth’s surface. This moisture is often generated locally from a nearby body of water, and forms when the difference between air temperature and dew point is less than about 4°F. The dew point is the temperature at which the water vapor in air (at constant barometric pressure) condenses into liquid water on tiny particles in the air, at the same rate at which it evaporates—forming fog. A change in temperature affects the relative humidity. As the dew point goes up, so does the relative humidity, creating a smaller differential between actual temperature and dew point temperature until fog forms.

The maximum amount of water vapor that can be held in a given volume of air (saturation) varies greatly by temperature. Cold air can hold less mass of water per unit volume than hot air. Relative humidity is the percentage of water found relative to the maximum possible, at a particular temperature.

Most of us have experienced the relationship between temperature and relative humidity firsthand. When the air temperature is high, our bodies use the evaporation of sweat to cool down. The cooling effect is directly related to how fast the perspiration evaporates. The rate of evaporation depends on how much moisture is already in the air and how much moisture the air can hold. If the air is already saturated with moisture (high humidity) perspiration will not evaporate, and we remain hot and uncomfortable. Discomfort can also exist when the humidity is low. The drier air can cause our skin to crack and tends to dry out the airways.

Measuring Relative Humidity

A hygrometer is an instrument used for measuring the humidity and water vapor content of the atmosphere, the soil and confined spaces. An instrument that measures humidity usually relies on the detection of some other quantity—such as temperature, pressure, mass or a mechanical or electrical change in a substance as moisture is absorbed. Today we use the electrical change of capacitance or resistance to calculate humidity.

Humidity measurement is among the more difficult problems in basic meteorology. Most hygrometers sense relative humidity rather than the absolute amount of water present. Because relative humidity is a function of both temperature and absolute moisture content, a small temperature change will translate into a change in relative humidity.

Some materials’ properties allow humidity levels to be determined based on a change in their capacitance, resistance, thermal conductivity or mass. Many humidity sensors include a temperature sensor, which allows them to approach 2-3% accuracy in a changing temperature environment. Table 1 shows several common humidity sensors. Many of them are available on some tiny PCB modules for easy interfacing.

Table 1
These are some popular humidity sensors with similar specifications.

I’ve used both the Honeywell HIH-5031 (with a Texas Instruments TMP102 temperature sensor) and a Silicon Labs Si7021 for measuring humidity in this project. The The Honeywell sensor has analog output, whereas the TI temperature sensor and Silicon Labs humidity/temperature sensor both use I2C to communicate. If you feel uneasy writing a function to perform the process, Arduino libraries are available for many sensors. This is an advantage for newbies, because you can get a program working with a library and often a sample program to get you started. Then you can go back and write the function yourself as a learning experience.

I don’t want to base the project totally on humidity, so I have added an ultrasonic distance measuring device to the project. Because fog forms as the air becomes supersaturated with water, this should mean that the humidity has reached 100% and water droplets in the air should begin to look solid. I’m hoping ultrasonics will be reflected by the droplets and cause a normal non-returned ping to be received. The combination of these two sensors exceeding some predetermined limits will satisfy my conditions to determine the presence of “fog.”

Avast, Ye Landlubber!

In a previous article (March 2011, Circuit Cellar 248), I presented the Microchip Technology (formerly Supertex) SR10, an inductorless switching power supply controller intended for operation directly from a rectified 120/240 VAC line. This was presented in support of creating a 5 V supply for a lighthouse fixture designed using LEDs. This month’s project will build upon that 5 V light, and will add audio to protect and guide boaters who find themsleves out on a lake under foggy conditions.

Figure 2
The schematic shows the connections made between the Arduino Uno headers and the sensor/module connectors mounted on an Arduino prototyping board. The finished board is shown in Figure 4.

I’m centering this project around the Arduino UNO. While I built the prototype interface (Figure 2) using the Arduino MEGA, it only uses the pins native to the UNO. The sensors/modules that are interfaced in this project are shown in Table 2.

Table 2
Each sensor/module will add some current draw to the project. Although current can be minimized in some cases while it is not active, this all becomes important if the project will run on batteries.

Because the UNO has only a single hardware serial port, I set up two additional software serial ports—one to talk with the DRPlayer and one to the optional LCD (output only). The main port and optional LCD don’t have to be used in the final project, but there is code written to display progress on each of these devices for seeing debugging information.  .  …

Read the full article in the October 339 issue of Circuit Cellar

Don’t miss out on upcoming issues of Circuit Cellar. Subscribe today!

Note: We’ve made the October 2017 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

November Circuit Cellar: Sneak Preview

The November issue of Circuit Cellar magazine is coming soon. Clear your decks for a new stack of in-depth embedded electronics articles prepared for you to enjoy.

Not a Circuit Cellar subscriber?  Don’t be left out! Sign up today:


Here’s a sneak preview of November 2018 Circuit Cellar:


3D Printing for Embedded Systems
Although 3D printing for prototyping has existed for decades, it’s only in recent years that it’s become a mainstream tool for embedded systems development. Today the ease of use of these systems has reached new levels and the types of materials that can be used continues to expand. This article by Circuit Cellar’s Editor-in-Chief, Jeff Child looks at the technology and products available today that enable 3D printing for embedded systems.

Add GPS to Your Embedded System
We certainly depend on GPS technology a lot these days, and technology advances have brought fairly powerful GPS functionally into our pockets. Today’s miniaturization of GPS receivers enables you to purchase an inexpensive but capable GPS module that you can add to your embedded system designs. In this article, Stuart Ball shows how to do this and take advantage of the GPS functionality.

FCL for Servo Drives
Servo drives are a key part of many factory automation systems. Improving their precision and speed requires attention to fast-current loops and related functions. In his article, Texas Instruments’ Ramesh Ramamoorthy gives an overview of the functional behavior of the servo loops using fast current loop algorithms in terms of bandwidth and phase margin.


Analog and Mixed-Signal ICs
Analog and mixed-signal ICs play important roles in a variety of applications. These applications depend heavily on all kinds of interfacing between real-world analog signals and the digital realm of processing and control. Circuit Cellar’s Editor-in-Chief, Jeff Child, dives into the latest technology trends and product developments in analog and mixed-signal chips.

Sleeping Electronics
Many of today’s electronic devices are never truly “off.” Even when a device is in sleep mode, it draws some amount of power—and drains batteries. Could this power drain be reduced? In this project article, Jeff Bachiochi addresses this question by looking at more efficient ways to for a system to “play dead” and regulate power.


Easing into the IoT Cloud (Part 1)
There’s a lot of advantages for the control/monitoring of devices to communicate indirectly with the user interface for those devices—using some form of “always-on” server. When this server is something beyond one in your home, it’s called the “cloud.” Today it’s not that difficult to use an external cloud service to act as the “middleman” in your system design. In this article, Brian Millier looks at the technologies and services available today enabling you to ease in to the IoT cloud.

Sensors at the Intelligent IoT Edge
A new breed of intelligent sensors has emerged aimed squarely at IoT edge subsystems. In this article, Mentor Graphics’ Greg Lebsack explores what defines a sensor as intelligent and steps through the unique design flow issues that surround these kinds of devices.


MCU-Based Project Enhances Dance Game
Microcontrollers are perfect for systems that need to process analog signals such as audio and do real-time digital control in conjunction with those signals. Along just those lines, learn how two Cornell students Michael Solomentsev and Drew Dunne recreated the classic arcade game “Dance Dance Revolution” using a Microchip Technology PIC32 MCU. Their version performs wavelet transforms to detect beats from an audio signal to synthesize dance move instructions in real-time without preprocessing.

Building an Autopilot Robot (Part 2)
In part 1 of this two-part article series, Pedro Bertoleti laid the groundwork for his autopiloted four-wheeled robot project by exploring the concept of speed estimation and speed control. In part 2, he dives into the actual building of the robot. The project provides insight to the control and sensing functions of autonomous electrical vehicles.


Embedded System Security: Live from Las Vegas
This month Colin O’Flynn summarizes a few interesting presentations from the Black Hat conference in Las Vegas. He walks you through some attacks on bitcoin wallets, x86 backdoors and side channel analysis work—these and other interesting presentations from Black Hat.

Highly Accelerated Product Testing
It’s a fact of life that every electronic system eventually fails. Manufacturers use various methods to weed out most of the initial failures before shipping their product. In this article, George Novacek discusses engineering attempts to bring some predictability into the reliability and life expectancy of electronic systems. In particular, he focuses on Highly Accelerated Lifetime Testing (HALT) and Highly Accelerated Stress Screening (HASS).

MPU Targets AI-Based Imaging Processing

Renesas Electronics has now developed a new RZ/A2M microprocessor (MPU) to expand the use of artificial intelligence (e-AI) solutions to high-end applications. The new MPU delivers 10 times the image processing performance of its predecessor, the RZ/A1, and incorporates Renesas’ exclusive Dynamically Reconfigurable Processor (DRP), which achieves real-time image processing at low power consumption. This allows applications incorporating embedded devices–such as smart appliances, service robots, and compact industrial machinery–to carry out image recognition employing cameras and other AI functions while maintaining low power consumption, and accelerating the realization of intelligent endpoints.
Currently, there are several challenges to using AI in the operational technology (OT) field, such as difficulty transferring large amounts of sensor data to the cloud for processing, and delays waiting for AI judgments to be transferred back from the cloud. Renesas already offers AI unit solutions that can detect previously invisible faults in real time by minutely analyzing oscillation waveforms from motors or machines. To accelerate the adoption of AI in the OT field, Renesas has developed the RZ/A2M with DRP, which makes possible image-based AI functionality requiring larger volumes of data and more powerful processing performance than achievable with waveform measurement and analysis.

Since real-time image processing can be accomplished while consuming very little power, battery-powered devices can perform tasks such as real-time image recognition based on camera input, biometric authentication using fingerprints or iris scans, and high-speed scanning by handheld scanners. This solves several issues associated with cloud-based approaches, such as the difficulty of achieving real-time performance, assuring privacy and maintaining security.

The RZ/A2M with DRP is a new addition to the RZ/A Series lineup of MPUs equipped with large capacity on-chip RAM, which eliminates the need for external DRAM. The RZ/A Series MPUs address applications employing human-machine interface (HMI) functionality, and the RZ/A2M adds to this capability with features ideal for applications using cameras. It supports the MIPI camera interface, widely used in mobile devices, and is equipped with a DRP for high-speed image processing.

Renesas has also boosted network functionality with the addition of two-channel Ethernet support, and enhanced secure functionality with an on-chip hardware encryption accelerator. These features enable safe and secure network connectivity, making the new RZ/A2M best suited for a wide range of systems employing image recognition, from home appliances to industrial machinery.

Samples of the RZ/A2M with DRP are available now. The RZ/A2M MPUs are offered with a development board, reference software, and DRP image-processing library, allowing customers to begin evaluating HMI function and image processing performance. Mass production is scheduled to start in the first quarter of 2019, and monthly production volume for all RZ/A2M versions is anticipated to reach a combined 400,000 units by 2021.

Renesas Electronics | www.renesas.com

NXP i.MX RT1060 Crossover Processors Released

First announced in February at Embedded World 2018, NXP Semiconductors has released its i.MX RT1060 Crossover processor, with the company claiming a mere ten months from concept to market launch.

The i.MX RT1060 is the latest addition to what NXP calls a crossover processor series and expands the i.MX RT series to three scalable families. The i.MX RT1060 doubles the On-Chip SRAM to 1 MB while keeping pin-to-pin compatibility with i.MX RT1050. This new series introduces additional features ideal for real-time applications such as High-Speed GPIO, CAN-FD, and synchronous parallel NAND/NOR/PSRAM controller. The i.MX RT1060 runs on the Arm Cortex-M7 core at 600 MHz.

This device is fully supported by NXP’s MCUXpresso Software and Tools, a comprehensive and cohesive set of free software development tools for Kinetis, LPC and i.MX RT microcontrollers. MCUXpresso SDK also includes project files for Keil MDK and IAR EWARM.

The i.MX RT crossover are designed to bridge the gap between high-performance and integration while minimizing costs to meet today’s need for high performance embedded processing at the edge node. According to NXP the series were designed to combine high performance MCU processing with the functionality of applications processors, at reduced costs, thereby enabling advanced computation and machine learning capabilities in millions of connected edge devices. The i.MX RT1060 is available now, and is priced at $3.48 (10,000s).

NXP Semiconductors | www.nxp.com

Security Takes Center Stage for MCUs

Enabling Secure IoT

Embedded systems face security challenges unlike those in the IT realm. To meet those needs, microcontroller vendors continue to add ever-more sophisticated security features to their devices—both on their own and via partnerships with security specialists.

By Jeff Child, Editor-in-Chief

For embedded systems, there is no one piece of technology that can take on all the security responsibilities of a system on their own. Indeed, everything from application software to firmware to data storage has a role to play in security. That said, microcontollers have been trending toward assuming a central role in embedded security. One driving factor for this is the Internet-of-Things (IoT). As the IoT era moves into full gear, all kinds of devices are getting more connected. And because MCUs are a key component in those connected systems, MCUs have evolved in recent years to include more robust security features on chip.

That trend has continued over the last 12 months, with the leading MCU vendors ramping up those embedded security capabilities in a variety of ways—some on their own and some by teaming up with hardware and software security specialists.

Built for IoT Security

Exemplifying these trends, Microchip Technology in June released its SAM L10 and SAM L11 MCU families (Figure 1). The devices were designed to address the increasing risks of exposing intellectual property (IP) and sensitive information in IoT-based embedded systems. The MCU families are based on the Arm Cortex-M23 core, with the SAM L11 featuring Arm TrustZone for Armv8-M, a programmable environment that provides hardware isolation between certified libraries, IP and application code. Security features on the MCUs include tamper resistance, secure boot and secure key storage. These, combined with TrustZone technology, protect applications from both remote and physical attacks.

Figure 1
The SAM L10 and SAM L11 MCU families provide TrustZone for Armv8-M hardware isolation between certified libraries, IP and application code. The MCUs also feature tamper resistance, secure boot and secure key storage.

In addition to TrustZone technology, the SAM L11 security features include an on-board cryptographic module supporting Advanced Encryption Standard (AES), Galois Counter Mode (GCM) and Secure Hash Algorithm (SHA). The secure boot and secure key storage with tamper detection capabilities establish a hardware root of trust. It also offers a secure bootloader for secure firmware upgrades.

Microchip has partnered with Trustonic, a member of Microchip’s Security Design Partner Program, to offer a comprehensive security solution framework that simplifies implementation of security and enables customers to introduce end products faster. Microchip has also partnered with Secure Thingz and Data I/O Corporation to offer secure provisioning services for SAM L11 customers that have a proven security framework.

Wireless MCU

Likewise focusing on IoT security, NXP Semiconductor in February announced its K32W0x wireless MCU platform. According to NXP, it’s the first single-chip device with a dual-core architecture and embedded multi-protocol radio. It provides a solution for miniaturizing sophisticated applications that typically require a larger, more costly two-chip solution. Examples include consumer devices such as wearables, smart door locks, thermostats and other smart home devices.

The K32W0x embeds a dual-core architecture comprised of an Arm Cortex-M4 core for high performance application processing and a Cortex-M0+ core for low-power connectivity and sensor processing. Memory on chip includes 1.25 MB of flash and 384 KB of SRAM. Its multi-protocol radio supports Bluetooth 5 and IEEE 802.15.4 including the Thread IP-based mesh networking stack and the Zigbee 3.0 mesh networking stack.

Figure 2
Security features of the K32W0x MCU include a cryptographic sub-system that has a dedicated core, dedicated instruction and data memory for encryption, signing and hashing algorithms including AES, DES, SHA, RSA and ECC.

Features of the K32W0x’s security system include a cryptographic sub-system that has a dedicated core, dedicated instruction and data memory for encryption, signing and hashing algorithms including AES, DES, SHA, RSA and ECC. Secure key management is provided for storing and protecting sensitive security keys (Figure 2). Support is enabled for erasing the cryptographic sub-system memory, including security keys, upon sensing a security breach or physical tamper event. The device has a Resource Domain Controller for access control, system memory protection and peripheral isolation. Built-in secure boot and secure over-the-air programming is supported to assure only authorized and authenticated code runs in the device.

To extend the on-chip security features of the K32W0x MCU platform, NXP has collaborated with B-Secur, an expert in biometric authentication, to develop a system that uses an individual’s unique heart pattern (electrocardiogram/ECG) to validate identity, making systems more secure than using an individual’s fingerprint or voice.

IP Boosts Security

For its part, Renesas Electronics addressed the IoT security challenge late last year when it expanded its RX65N/RX651 Group MCU lineup.  …

Read the full article in the October 339 issue of Circuit Cellar

Don’t miss out on upcoming issues of Circuit Cellar. Subscribe today!

Note: We’ve made the October 2017 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

ST and TomTom Team Up for Geolocation Tool Solution

STMicroelectronics and TomTom, a location technology specialist, have  announced a package of development tools in the STM32 Open Development Environment that connect directly to TomTom Maps APIs (Application Programming Interfaces) for location, tracking and mapping data services. It is aimed at accelerating product development and reducing time-to-market and development costs for developers.

This development package consists of an STM32 Discovery host board for 2G/3G cellular-to-cloud connectivity (shown), a GNSS expansion board based on ST’s Teseo satellite navigation technology, and a software Function Pack that connects your Internet-of-Things (IoT) node via a cellular network to a range of TomTom Maps APIs. With this hardware and software package and a TomTom developer account, developers can quickly add location-based services to their IoT and Smart City applications. Among these services are the translation of GPS coordinates into a street address inside a map (Reverse Geocoding), retrieval of nearby point of interests, and the production of accurate navigation directions.

In addition to the STM32 family of Arm Cortex-M core microcontrollers, the development tools leverage ST’s multi-constellation Teseo positioning-receiver technology to perform all positioning operations including tracking, acquisition, navigation and data output.

For mapping data and services, technology companies, geographical information systems (GIS) providers, government bodies, and traffic-management institutions across the globe rely on TomTom to deliver industry-leading mapping products that create location-enabled applications.

STMicroelectronics | www.st.com

Build a Persistence-of-Vision Display

Using LEDs and PIC32

Learn how these two Cornell University students created a persistence-of-vision (POV) display. They found a way to fit an LED strip onto the mechanically rigid base of a box window fan. The POV display creates the illusion of an image and show anything from an analog clock to ASCII text and complex images.

By Han Li and Emily Sun

Visual feedback is a key aspect of human interaction in everyday life. With technology, the beauty of the visual world can be preserved with images and videos. We set out to create a persistence-of-vision (POV) display that is both multifunctional and easy to use, through the use of a large box fan. Box fans are often found by the window on hot summer days, and can be quite unique with the integration of a “cool” POV display. For our project, we found a way to fit a DotStar LED strip onto the mechanically rigid box base of a box fan. As such, the box fan serves as an ideal platform for a POV display, without needing to construct a well-calibrated rotating setup with a DC motor. The box fan also has preset settings for speed which is convenient for testing.

The novelty of this POV display makes it a good conversation starter, and it can be easily assembled and customized. The display creates an illusion of an image and shows anything from an analog clock to ASCII text and complex images.

In designing our POV fan display, the first thing we measured was the fan’s speed of rotation. This was calculated by flashing a blinking strobe light through the fan blades. On the slowest setting, the fan rotates at approximately 7 Hz, which is equivalent to 143 ms per rotation around the circular radius of the spinning fan. The angle resolution of the image generator of the POV display is limited by time constraints, so we defined 100 tick locations around the peripheral of the fan. Since the LEDs are programmed to light up twice per rotation, the images can be rendered twice as fast, thus increasing the refresh rate of the display to around 14 Hz—each pixel is blinking 14 times per second. For the human eye, the POV effect is achieved around 15 Hz, which means we are getting a decent result with our setup.

With an interrupt time of approximately 1 ms, and through the use of the Hall effect sensor that updates the period on each rotation, the positioning of displayed elements on the fan varies to at most 2.5 degrees. During testing, there are no observations of rotational jittering greater than 2.5 degrees with 100 display angles.


The hardware components are a box fan, DotStar LED strip, tri-state buffer, Hall effect sensor, 5 V battery bank, 9 V battery, a piece of 0.635 cm × 2.54 cm × 50 cm plywood and a Microchip Technology PIC32 microcontroller on a custom PCB [1].

Figure 1
Hardware setup with a closeup of Hall effect sensor and magnet placement

The custom PCB with the mounted PIC32 is secured onto the protoboard above a piece of Styrofoam to prevent short-circuiting (Figure 1). The protoboard itself contains the necessary power distribution and level shifting required for the LED strip. The DotStar LED strip must be driven at 5 V and takes about 60 mA per LED at full intensity. Because of the PIC32’s 3.3 V output, an ON Semiconductor 74LS125 tri-state buffer [2] is used as a level shifter. This is done by shorting the gate on the tri-state buffer to ground and powering the buffer with the 5 V rail (Figure 2). The 9 V battery is then connected directly to the custom PCB with the adapter, and the 5 V battery pack is connected to the power rail on the protoboard (Figure 1).

Figure 2
Schematic of hardware setup

In terms of mechanical setup, the front-facing grill on the box fan is removed for easy access. A piece of plywood is mounted onto the fan with two wood screws on the opposite side of the fan’s plastic centerpiece. The DotStar LED strip is secured to the plywood with zip ties. The metal ridges that secure the front facing grills are bent outward to allow for smooth rotation of the mounted plywood piece.  …

Read the full article in the October 339 issue of Circuit Cellar

Don’t miss out on upcoming issues of Circuit Cellar. Subscribe today!

Note: We’ve made the October 2017 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

Mouser Stocking Microchip’s MPLAB Snap Development Tool

Global distributor Mouser Electronics is now stocking the MPLAB Snap in-circuit debugger and programmer from Microchip Technology. The MPLAB Snap provides affordable, fast, and easy debugging and programming of most PIC, AVR and SAM flash microcontrollers and dsPIC digital signal controllers (DSCs), using the powerful graphical user interface of MPLAB X integrated development environment (IDE).
The Microchip MPLAB Snap board, available from Mouser Electronics, features a powerful 32-bit 300 MHz SAM E70 Arm Cortex-M7 based microcontroller for quicker debug iterations. The debugger system executes code, like an actual device, because it uses the target device’s built-in emulation circuitry, instead of a special debugger chip. All available features of the device are accessible interactively and can be set and modified by the MPLAB X IDE interface. Additionally, the board matches the silicon clocking speed of the target device, allowing engineers to run programs at the device’s maximum speed.

The board connects to a computer via high-speed USB 2.0 interface and can be connected to the target device through an 8-pin single in-line (SIL) header. The connector uses two device input/output (I/O) pins and the reset line to implement in-circuit debugging and In-Circuit Serial Programming (ICSP™) capability. Along with its support for a wide target voltage range of 1.20 V to 5.5 V, the MPLAB Snap supports advanced interfaces such as 4-wire JTAG and Serial Wire Debug with streaming data gateway. It is also backward compatible for demo boards, headers and target systems using 2-wire JTAG and ICSP.

Microchip Technology | www.microchip.com

Mouser Electronics | www.mouser.com

LIDAR 3D Imaging on a Budget

PIC-32-Based Design

Demand is on the rise for 3D image data in a variety of applications. That has spurred research into LIDAR systems capable of keeping pace. Learn how this Cornell student leveraged inexpensive LIDAR sensors to build a 3D imaging system—all within a budget of around $200.

By Chris Graef

There’s a growing demand for 3D image data in a variety of applications, from autonomous cars to military base security. This has prompted research into high precision LIDAR systems capable of creating extremely clear 3D images to meet this demand. While these high-end systems can produce accurate and precise images, they can cost on the order of multiple thousands to tens of thousands of dollars. A side effect of this research, however, is the increasing availability of LIDAR devices at a cost much more affordable for tinkerers, students, hobbyists and budget-constrained embedded system developers. Using this new supply of inexpensive LIDAR sensors, I was able to build a 3D imaging system with a budget of around $200. The major parts used for the system can be seen in Table 1.

Table 1 Shown here are the cost and quantity of the major components used in the project. Not included are some smaller components such as wires, resistors and op amps.

At a glance, my LIDAR scanner works by turning a single-point LIDAR range finder through a scan pattern. I use a Microchip PIC32 microcontroller to control two analog feedback servos—one setting azimuth angle and one setting altitude angle—to move a mounted LIDAR distance sensor through a scan pattern. By synchronizing the feedback data of these two servos with the distance readings from the LIDAR sensor, the system defines one point in 3D space in a spherical coordinate format. After allowing the system time to create 10,000 to 20,000 points, the result is a 3D image made up of distinct spatial points. These points are stored in a point cloud data file format, which can be displayed by graphing software such as MATLAB.


A CAD model of the imaging system is shown in Figure 1. The servos are shown in blue, the LIDAR is shown in red and the 3D printed mounts are shown in gray. All the components are connected using nuts and machine screws. The lower (azimuth) servo rotates the entire apparatus above it. The upper (altitude) servo rotates just the LIDAR sensor. The combined motion of the two servos results in the scan pattern of the system.

Figure 1
A CAD model of the LIDAR sensor and servo mounting. The LIDAR sensor is shown in red, the servos are shown in blue and the mounting brackets are shown in gray.

One thing to note in this design are the slots used on the mounting brackets to fasten both the altitude servo and the LIDAR sensor. One of the biggest requirements for the mechanical design of this project was to ensure that the center of rotation for the LIDAR sensor was in the center of the scanner. If the LIDAR sensor is positioned away from either axis of rotation, error gets introduced into the system. Here’s why this occurs: When converting raw data to cartesian points, we assume that the LIDAR sensor is giving us the distance to a point in 3D space from the origin of our spherical coordinate space. Deviation from the center of rotation for the azimuth or altitude angle would mean that we are recording a distance from somewhere else in our geometric plane.

It’s still possible to get accurate 3D points if the LIDAR sensor is not at the center of rotation, but this requires precise measurement of where the LIDAR sensor actually is in our coordinate space, and the use of complex mathematics to transform the measured data into accurate 3D position points. I thought that adding a couple of slots to a 3D bracket would be slightly easier and more effective. These slots allow for micro adjustments to be made in two dimensions, so that the LIDAR sensor lies in the direct center of both axes of rotation.


There are two main electrical circuits in this design: The power/servo control circuit and the feedback amplifier circuit.The power/servo control circuit shown in Figure 2 was designed to allow the PIC32 MCU to send a pulse width modulation (PWM) signal to the servos, while protecting the MCU from possibly harmful electrical noise made by the servo motors. The first step to reduce noise was to use an opto-isolator as a switch for the servo motors control pin. By driving pins RPB9 and RPB7 high, the MCU connects the servo motors’ control pin to the 5-V source. This converts the PIC32’s 3.3-V PWM output into a 5-V PWM usable by the two servos, while isolating the PIC32’s output pin from any electrical noise.

Figure 2
Shown here is the circuit of the power supply module. The servos are shown as motors. The RPB9 and the RPB7 are wires connected to output pins on the PIC32.

If the servos were the only things that needed to be connected to the MCUs, then the opto-isolator configuration would have been enough to protect the PIC32 from the servo motors’ electrical noise. However, the MCU must share a common ground with the LIDAR sensor, to be able to read the sensor’s analog output. This means electrical noise on the power/servo controller circuit can travel to the PIC32 through this common ground. To reduce the chance of electrical damage, two capacitors—one ceramic and one electrolytic—were connected across the 5-V source and the ground. The smaller ceramic capacitor attenuates any smaller amplitude, high frequency noise and the larger electrolytic capacitor is used to attenuate the lower frequency noise. The combination of these two capacitors ideally stops any damaging noise from travelling through the power connection by shunting the noise to ground instead.  …

Read the full article in the September 338 issue of Circuit Cellar

Don’t miss out on upcoming issues of Circuit Cellar. Subscribe today!

Note: We’ve made the October 2017 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

3D Gesture Recognition Controller for Cars

Microchip Technology has announced a new 3D gesture recognition controller that offers the lowest system cost in the automotive industry, providing a durable single-chip solution for advanced automotive HMI designs. The MGC3140 joins Microchip’s family of easy-to-use 3D gesture controllers as the first qualified for automotive use.

Suited for a range for applications that limit driver distraction and add convenience to vehicles, Microchip’s new capacitive technology-based air gesture controller is ideal for navigating infotainment systems, sun shade operation, interior lighting and other applications. The technology also supports the opening of foot-activated rear liftgates and any other features a manufacturer wishes to incorporate with a simple gesture action.
The MGC3140 is Automotive Electronics Council AEC-Q100 qualified with an operating temperature range of -40°C to +125°C, and it meets the strict electromagnetic interference (EMI) and electromagnetic compatibility (EMC) requirements of automotive system designs. Each 3D gesture system consists of a sensor that can be constructed from any conductive material, as well as the Microchip gesture controller tuned for each individual application.

Car manufacturers are increasingly seeking ways to reduce driver distraction through implementing functional safety technology in vehicles. Many Human Machine Interface (HMI) designers are turning to gesture recognition as a solution to improve driver and vehicle safety without sacrificing interior design, adding features that allow drivers to easily control everything from switching on lights to answering phone calls while focusing on the road.

While existing solutions such as infrared and time-of-flight technologies can be costly and operate poorly in bright or direct sunlight, the MGC3140 offers reliable sensing in full sunlight and harsh environments. Other solutions on the market also come with physical constraints and require significant infrastructure and space to be integrated in a vehicle. The MGC3140 is compatible with ergonomic interior designs and enables HMI designers to innovate with fewer physical constraints, as the sensor can be any conductive material and hidden from view.

The Emerald evaluation kit provides a convenient evaluation platform for the 3D gesture recognition controller. The kit includes a reference PCB with the MGC3140 controller, a PCB-based sensor to recognize gestures, as well as all needed cables, software and documentation to support an easy-to-use user experience. All parts are compatible with Microchip’s Aurea software development environment which supports all Microchip 3D gesture controllers.

The MGC3140 is available now in sampling and volume production quantities.

Microchip Technology | www.microchip.com