Tag Archives: ADC

The smart router is ready for IoT play

The evolution of router has reached the IoT’s doorsteps, and it raises some interesting prospects for industrial and smart home markets.

The router used to be largely a dumb device. Not anymore in the Internet of Things arena where node intelligence is imperative to make a play of the sheer amount of data acquired from sensors, machines and other ‘things.’ The IoT router marks a new era of network intelligence — but what makes a router smart?


For starters, it employs embedded hardware platforms with DIY capabilities while balancing the performance and power consumption requirements. Next, an IoT router provides the operational status on an LCD screen while manipulating the data from different interfaces. In human machine interface (HMI) applications, for example, a smart router offers LCD and touch screen interfaces on expansion I/Os.

Take the case of the DAB-OWRT-53 smart router, which is developed by the Belgian design house DAB-Embedded. The sub-100 euro device — based on Atmel’s SAMA5D36 processor and OpenWRT router hardware platform — is mainly targeted at smart home and industrial IoT applications.

The smart router of DAB-Embedded

The IoT router supports popular wireless interfaces such as Wi-Fi, ZigBee and Z-Wave, as well as a diverse number of wired interfaces including Ethernet, USB, CAN 2.0A/B, KNX and RS-232. And all the data from these interfaces can be stored in either microSD card or NAND flash.

Anatomy of Smart Router

The Atmel | SMART SAMA5D36 is at the heart of the smart router design. First and foremost, it optimizes power consumption in the battery-operated router that features 3.7V lithium polymer battery support with charging capability over a microUSB connector. The router boasts eight hours of battery lifetime while being in full ON mode with Wi-Fi communications.

Second, the ARM Cortex-A5 processor shows a robust performance in the communications domain. For instance, the SAMA5D36 implements routing functionality to transfer data from one Ethernet port to another in a way that router designers don’t require an external hardware hub or switch. Moreover, Atmel’s MPU offers greater flexibility to run a lot of embedded software packages such as OpenZWave and LinuxMCE.

Third, the SAMA5D36-based IoT router offers users the ability to manipulate firewall settings, Disable PING, Telnet, SSH and UPnP features. Furthermore, the hardware security block in SAMA5D3 processor allows the use of CryptoDev Linux drivers to speed up the OpenSSL implementation. The Wi-Fi module — powered by Atmel’s WILC3000 single-chip solution — also supports the IEEE 802.11 WEP, WPA and WPA2 security mechanisms.

The smart router of DAB-Embedded employs Active-Semi’s ACT8945AQJ305-T power management IC, but the real surprise is Altera’s MAX 10 FPGA with an integrated analog-to-digital converter (ADC). That brings the additional flexibility for the main CPU: Atmel’s SAMA5D36.

The FPGA is connected to the 16-bit external bus interface (EBI) so that IoT developers can put any IP core in FPGA for communication with external sensors. All data is converted inside the FPGA to a specific format by using NIOS II’s soft CPU in FPGA. Next, the SAMA5D36 processor reads this data by employing DMA channel over the high-speed mezzanine card (HSMC) bus.

An FPGA has enough cells to start even two soft cores for data preprocessing. Case in point: A weather station with 8-channel external ADC managing light sensors, temperature sensors, pressure sensors and more. It’s connected to the FPGA together with PPS signal from GPS for correct time synchronization of each measurement.


OpenWRT Framework

The SAMA5D36 embedded processor enables DAB’s smart router design to customize free OpenWRT Linux firmware according to the specific IoT application needs. The OpenWRT framework facilitates an easy way to set up router-like devices equipped with communications interfaces such as dual-port Ethernet and Wi-Fi connection.

What’s more, by using the OpenWRT framework, an IoT developer can add now his or her own application (C/C++) to exchange data with a KNX or Z-Wave transceiver. OpenWRT even supports the Lua embedded interpreter.

Next, while DAB-Embedded has built its smart router using the embedded Linux with OpenWRT framework, Belgium’s design house also offers a board support package (BSP) based on the Windows Embedded Compact 2013 software. That’s for IoT developers who have invested in Windows applications and want to use them on the new hardware: the DAB-OWRT-53 smart router.

Later, the embedded design firm plans to release smart router hardware based on the Windows 10 IoT software and Atmel’s SAMA5D family of embedded processors. The Belgian developer of IoT products has vowed to release the second version of its router board based on Atmel’s SAMA5D4 embedded processor and WILC3000 chipset that comes integrated with power amplifier, LNA, switch and power management. Atmel’s WILC3000 single-chip solution boasts IEEE 802.11 b/g/n RF/baseband/MAC link controller and Bluetooth 4.0 connection.

Majeed Ahmad is the author of books Smartphone: Mobile Revolution at the Crossroads of Communications, Computing and Consumer Electronics and The Next Web of 50 Billion Devices: Mobile Internet’s Past, Present and Future.

Linduino is a USB-isolated Arduino

My pals over at Linear Technology have developed the Linduino board to drive their ADCs (analog to digital converters) and DACs (digital to analog converters) as well as temp sensors and other devices. The board is not a clone of an Arduino, that would be pointless for them. Linear Tech sells analog chips, not Maker boards.


The Linear Technology Linduino board uses the same Atmel chip as a Arduino Uno, but has isoalted USB and more dc power.

So the first and most essential difference is that in addition to the normal shield headers on an Arduino, there is a header that Linear Tech has used for years to drive their demo boards. This computer interface function used to be done with their DC590 interface board. Indeed, the firmware that comes shipped with the Linduino emulates that board, so you can run the original Linear Tech interface program on your PC, and it can’t tell if its the old board or a Linduino.


The Linduino board will accept all the Shield mezzanine boards for Arduino, but has this extra header to control Linear Tech demo boards as well.

But wait, there is more. So much more. Linear tech also used one of their USB isolators on the Linduino board. This means that the board and what you plug into it are galvanically isolated from the computer you have the USB plugged into. This means you can measure things off a car or an audio system without worrying about ground loops polluting the measurement. Its as handy as a hand-held DVM (digital voltmeter). My former employer Analog Devices also makes bidirectional USB isolators and there may be others that have come to market. You might make your own isolator, but the great thing about the Linduino is that all the system engineering is done for you and the firmware works.


The Linduino has a LMT2884Y-USB isolator module on it so your PC is not electrically connected to the Linuduino or its Shields or Linear Tech demo boards.

Since Linear Tech is also a power supply chip company, they beefed up the power supply on the board, using a switching regulator to replace the linear regulator on the Arduino. This means you can get 750mA out of the power system. Since a USB can’t supply this much power, that means you have to feed the board with an external wall wart. Now you have the power to drive actuators or other heavy loads.


Linear Tech also beefed up the power system with a 750mA switching regulator that will not get hot even at full load while dropping for a high input voltage.

Dan Eddelman worked on the Linduino as did Mark Thoren, my pal from Linear Tech. Tomorrow I will plug in the beast and  show how to get it working. I did have a few glitches the first time.


Mark Thoren, shown here giving his daughter some STEM instruction at the Silicon Valley eFlea, helped develop the Linduino.

Just like Atmel’s demo boards, Linear Tech is selling the Linduino pretty much at cost. This can give you a great foundation to build an isolated data acquisition and control system for cheap. And don’t forget, all the Arduino shields plug into the board and work with the existing libraries and firmware and available open source code. Linear Tech used the same Atmel chip as the Arduino, so this is not just “shield compatible,” is is truly compatible with an Arduino.

Designing UL/IEC/EN60730-compliant appliances with Atmel

UL/IEC/EN60730 are a comprehensive set of safety standards for various household appliances, such as washing machines, stoves and refrigerators.

On a hardware level, key design considerations for UL/IEC/EN60730-compliant appliances include POR, BOD, RAM, Flash, EEPROM, WDT, ADC, clock/zero cross detector as well as immunity from noise, EMC and humidity. Software features typically comprise a 60730 code library, spread spectrum and FMEA (Failure Mode and Effects Analysis).


A number of current-gen Atmel components can be used to design UL/IEC/EN60730-compliant appliances, including ATxmega MCUs, AT42QT14811, AT42QT1244/1245, AT42QT2640 and UL/IEC/EN60730 certified touch controllers.

“Simply put, megaAVR and AVR XMEGA – with application notes (AVR998 and AVR1610) – provide proven solutions to address household appliance design requirements,” an Atmel engineering rep told Bits & Pieces.

“An Atmel-powered platform offers developers access to the most efficient 8-bit microcontroller core; POR, BOD and watchdog with an independent oscillator; integrated RC oscillators, RTC, EEPROM, ADC Converter/Comparator; 25×4 and 40×4 segment LCD driver options, as well as certification of the XMEGA code library.”


In terms of electrical performance, Atmel offers a high current sink and source for GPIO, temperature range from 850C up to 1500C and EMC robustness (low emissions). On the touch side, Atmel provides pre-certified capacitive touch controllers and Failure Mode Effects Analysis (FMEA) module for improved safety.

As noted above, devs can access Atmel application notes for AVR998 and certified AVR1610, including safety related code. Last but certainly not least, manufacturers have easy access to Atmel Studio 6 and its Integrated Development Environment (IDE).

Interested in learning more about designing UL/IEC/EN60730-compliant appliances with Atmel? Be sure to check out the following links below:

32-bit AVR MCUs for automotive applications (Part 2)

In the first part of this series, we took a closer look at how Atmel’s AVR low-power 32-bit microcontrollers (MCUs) help enable the implementation of various product-differentiating features, including advanced control algorithms, voice control and capacitive touch sensing.

We also discussed powering Atmel’s AVR UC3C 32-bit automotive-grade microcontrollers with either a 3.3V or a 5V supply (generally supporting 5V I/O). This has been achieved by moving to a modified 0.18-micron process technology, which supports higher I/O voltage levels in a reliable and cost-effective manner without any complex and expensive voltage conversion. In addition to supporting 5V I/O, the UC3C has been designed to support a wide range of high-performance peripherals required by automotive applications, including:

  • ADC: 16 channels with 12-bit resolution at up to 1.5M samples/second; dual sample and hold capabilities; built-in calibration; internal and external reference voltages.
  • DAC:  Four outputs (2 x 2 channels) with 12-bit resolution; up to 1M sample/second conversion rate with 1us settling time; flexible conversion range; one continuous or two sample/hold outputs per channel.
  • Analog comparator:  Four channels with selectable power vs. speed; selectable hysteresis (0.20mV and 50mV); flexible input selections and interrupts; window compare function by combining two comparators.
  • Timer/Counter: multiple clock sources (five internal and three external); rich feature set (counter, capture, up/down, PWM); two input/output signals per channel; global start control for synchronized operation.
  • Quadrature decoder: Integrated decoder supports direct motor rotation detection.
  • Multiple interfaces: includes a two-channel, two-wire interface (TWI), master/slave SPI, and full-featured USART that can be used as an SPI or LIN.
  • Fully integrated USB:  built-in USB 2.0 transceivers support low (1.5Mbps), full (12Mbps) and on-the-go modes; included in the AVR Software Framework are production-ready drivers for various USB devices (mass storage, HID, CDC, audio), hosts (mass storage, HID, CDC) and combined function devices.

Atmel’s AVR UC3C 32-bit automotive-grade microcontrollers are also designed to achieve higher system throughput with our Peripheral Event System.

“Managing peripherals by the CPU can become a major system bottleneck, especially as the number of peripherals and their operating frequencies increase. With high sampling rates across multiple channels, interrupt overhead and data processing can consume a large percentage of the processor’s available clock cycles,” an Atmel engineering rep told Bits & Pieces. “If the CPU load needs to manage a single SPI port even at a low data rate of 1.2Mbps, this would require 53% of the processor’s capacity. In addition, the interrupt latency increases and introduces jitter.”

And that is why AVR UC3C architecture utilizes Atmel’s peripheral event system, which allows CPU-independent handling of inter-peripheral signaling through an internal communication fabric that interconnects all peripherals. Rather than triggering an interrupt to tell the CPU to read a peripheral or port, the peripheral instead manages itself by directly transferring data to the SRAM for storage – all without requiring any action by the CPU.

“From a power perspective, only those blocks that are part of the conversion are active. The CPU is free to execute application code or conserve power in idle mode during the entire event,” the Atmel engineering rep continued. “In addition, the peripheral event controller allows a more deterministic response compared to a CPU-based, interruptdriven event controller, because the latency is fixed to 3 cycles, i.e., 33ns when operating at 66MHz. This enables precise timing of events without jitter, resulting in constant sample rates for ADCs and DACs.”

Interested in learning more about 32-bit AVR MCUs for automotive applications? Be sure to check out part three of this series which details how Atmel MCUs can be used to help protect IP and bolster system safety. Interested in learning more about 32-bit AVR MCUs for automotive applications? Be sure to check out part onetwothree and four of this series.

Francis Lau and Wayne Yamaguchi on ADC tips

My buddies Francis Lau and Wayne Yamaguchi read my recent article about the 12-bit ADCs in the new Atmel SAM D20 ARM chip.


Wayne Yamaguchi (left) and Francis Lau admire the CNC milling machine in Wayne’s garage.


They both had some good tips. Francis has worked for a famous Silicon Valley brain-wave sensor company. He writes:

I was trying to squeeze out more resolution out of a 10-bit adc on an Atmel AVR in the brainwave sensing module. Along with power synchronization you can do couple other firmware level tricks. One thing is to over sample and then do a simple average. You could do curve fitting but then that’ll take more computing power rather than just drop some bits. If the signal is repeating, you can also just sample it multiple times over different cycles and average those.

The Atmel datasheet also tell you that in order to get those 10-bits rather than the 7.5bits ENOB (effective number of bits) you typically get, you really need to turn off the other digital clocks in the chip and let it rest a bit before doing the acquisition. I tried this and it does make these little 2 bits of noise quiet down.

My buddy Wayne, who I met at HP years ago before they split off Agilent, has worked on all kinds of analog signal chains. He designs LED lighting that is controlled by Atmel AVR parts. Wayne writes:

For the ATtiny series the A/D resolution is not that bad and noise in general should not be an issue.  I have several boards that the uP is on the bottom side or adjacent to the DC/DC driver that drives up to 3A to the LED off a battery pack.

Of special note is the bit resolution.  If you use the internal 1.1V reference, then the resolution is 1.1V/1024 or approximately 1mV.  By using a precision voltage reference for VCC of the MCU you can use the supply as the A/D reference instead of the internal reference.  A 2.5V reference changes the bit resolution to 2.5mV and is less noise sensitive.  I have tested the single reading under these conditions and have found that the voltage read back is very stable with just one reading with the DC-DC converter running.  On my GDuP board the uP is directly under the converter and switching inductor.  The converter is on the top side of the board (components) and the bottom side components are for the uP.  The board is 0.55″ round and can drive up to 1.5A constant current to the LED.  The GDuP is a 2 layer board with standard 1 oz copper foil.  Of course the final code does not rely on a single reading. Personally, I typically average 4 readings. For one customer I was consulting for, I had to increase the resolution to monitor the battery drain more accurately. There I averaged more readings to extend the range to 12 bits.

So there you have some good examples from experienced engineers who battle such analog issues every day. The important thing to remember is that if you really want 10 or 12 bits, you have to do the system design to remove noise, and maybe oversample or average or dither or a bunch of tricks to get the nominal bit depth of the ADC. Please understand, Atmel and our competitors are not lying when we say we have 10 bit ADCs yet they only give 7.5 ENOB. You really do get 10 bits at low sample rates under noise-free conditions. We cannot estimate how fast you are sampling in your particular system nor how much noise you have in your environment. All a chip manufacturer can do is measure the performance under ideal conditions, both at DC and at a sample rate where we can tell you the ENOB. It is up to you to make sure you design has the margins and error budget to deliver the accuracy you need. Remember, the rated ADC bit are a resolution, not an accuracy. It is not trivial to insure a measurement accuracy, just read the Keithley low-level measurement handbook.

A closer look at Atmel’s Peripheral Event System

As previously discussed on Bits & Pieces, Atmel recently introduced the SAM D20 MCU, an extensive product lineup based on ARM’s Cortex -M0+.

The SAM D20 boasts a number of power-saving techniques, including an event system that allows peripherals to communicate directly with each other without involving the CPU or bus resources. This is known as the Peripheral Event System.

According to Andreas Eieland, Sr. Product Marketing Manager at Atmel, the Peripheral Event System can best be described as a routing network independent of the traditional data bus paths. Meaning, different triggers at the peripheral level can result in an event, like a timer tick triggering a reaction in another peripheral.

“Comprising 8 independent channels, the Event System offers a fixed latency of 2 cycles. Without any jitter it is a 100% deterministic method and a perfect fit for real-time applications,” Eieland explained.

“No events are lost and they are handled at a peripheral level in two cycles, even if the CPU is performing a non maskable interrupt. Traditionally the way of handling actions for a low power application would be through the use of interrupts, although they wake up the CPU.”


To better illustrate the advantages of an Event System, Eieland cited an example of a motor drive application using PWM.

“To detect erroneous situations, many motor applications use an analog comparator or ADC to measure the current going into the motor drive, in an over current situation you want to shut down the PWM channels driving the motor as soon as you can to prevent permanent damage to the circuit and for safety reasons,” he said.

“Without an Event System the overcurrent situation will trigger an interrupt, but the interrupt service request might be delayed if the CPU is performing other higher priority tasks. Using the Event System you can connect the analog comparator or ADC directly to the timer and always shut down the timer in two cycles, regardless of what the rest of the MCU is doing.”

Although Peripheral Event capabilities are useful on many different levels, the primary advantages of such a feature include minimizing power consumption, optimizing the off-loading of routine tasks from the CPU and achieving a totally predictable reaction time.

Additional information about Atmel’s Peripheral Event System can be found here.

A closer look at Atmel’s picoPower technology

We briefly touched on Atmel’s picoPower technology this morning in the context of Samsung’s Galaxy S4 smartphone, which is equipped with Atmel’s sensor hub management MCU (microcontroller unit). The MCU collects and processes data from all connected sensors in real-time, optimizing multiple user experiences, such as gaming, navigation and virtual reality.

Atmel’s sensor hub MCU also lowers the overall system power consumption via picoPower technology to prevent drain and enable longer battery life. In a broader sense, it is important to note that all Atmel AVR picoPower devices are designed from the ground up for low power consumption utilizing the company’s proprietary low leakage processes and libraries to provide minimal power sipping in all sleep modes.

“An easy way to reduce power consumption in any design is to lower the operating voltage. But this would be mostly useless if analog performance was compromised,” an Atmel engineering rep told us. “Central to the AVR picoPower technology are carefully designed analog functions that continue to operate all the way down to 1.62V.”

To be sure, the various features of a microcontroller traditionally become unstable or even unusable at different voltage levels, as inaccuracies in analog peripherals, limited operation or an inability to write to non-volatile memory prevents designs from running at lower voltages. This leads to shorter battery life, larger and more expensive batteries, or a lot time spent trying to find workarounds for something that should be addressed by the microcontroller to begin with.

As such, Atmel AVR microcontrollers offer true 1.62 V operation, including all analog modules, oscillators, and flash and EEPROM programming. Meaning, various microcontroller features will not shut down one by one as the voltage drops.

“You can run the same application at different voltages without making comprises. All peripherals are available regardless of supply voltage,” the engineering rep continued. “The ADC, for example, can be used to measure the supply voltage as the cutoff voltage is approached, and when detected, it enables the application to store vital information and ensure a safe shutdown, enabling a glitch-free restart after changing batteries.”

Remember, power consumption is proportional to supply voltage, so running at as low a supply voltage as possible saves power. For battery operated devices, the Atmel AVR microcontroller can make use of the remaining power available at lower battery voltage levels as the battery depletes.

In addition to true 1.62 V operation, Atmel’s AVR peripherals with picoPower are capable of determining if incoming data requires use of the CPU or not. This feature is aptly dubbed SleepWalking, as it allows the CPU to sleep peacefully until an important event occurs, eliminating millions of false CPU wakeups. This means the CPU is no longer required to check whether or not a specific condition is present, such as an address match condition on the TWI (I2C) interface, or a sensor connected to an ADC that has exceeded a specific threshold.

Of course, entering sleep mode shuts down parts of the microcontroller to save power. Most oscillators and clocks consume a considerable amount of power when in use, and when waking up from sleep modes, these clocks need to be stable before they can be used. Waiting a long time for the clocks to be available and stable results in wasted power.

However, the Atmel AVR microcontroller is capable of waking up from sleep mode in 8 clock cycles when running from the internal RC oscillator. Moreover, a digital frequency locked loop (DFLL) replaces the traditional phase locked loop (PLL) to provide a programmable internal oscillator that is much faster and accurate.

It can also eliminate external components, which reduces the total system power consumption even more. When in sleep mode with the synchronous clocks turned off, the microcontroller can still wake up from asynchronous events such as a pin change, data received or even an I2C bus address match – enabling multiple wake-up sources from even the deepest sleep modes.

As noted above, the benefits of picoPower are clearly illustrated by Samsung’s decision to equip its flagship Galaxy S4 smartphone with Atmel’s sensor hub MCU which features picoPower tech.

“Atmel allows Galaxy S4 users the ability to enjoy applications requiring real-time motion sensing, without ever compromising battery life,” said Ingar Fredriksen, Senior Director of Flash-based Microcontrollers, Atmel Corporation. “ We look forward to teaming with Samsung on future designs.”

SleepWalking Helps Conserve Energy

Imagine you are the sole care-provider for a household full of babies all under the age of 3.  Each and every single one of them requires you to tend their needs and desires.  From feeding to going to the bathroom, from burping to changing their diapers, from bathing to putting them to nap/sleep to keeping them entertained, you are needed every single step of the way.  Isn’t that just exhausting?  Fast forward by a decade when they are grow to become teenagers – autonomy and self-sufficiency – in which they can all satisfy their own basic needs without your help, unless it’s an urgent matter.  Now you have much more free time to read a book, surf the net, get a job, or take a nap.

In essence, this is what SleepWalking is all about in the realm of an Atmel MCU.  Traditionally a technology found in the AVR architecture only, it is now incorporated into the ARM architecture as well.  It is a feature that extends the concept of autonomous peripherals (babies) that operate independently of the CPU core (a parent or care-provider) during active mode, to actually keeping the peripherals functional when the system clock has been stopped. This is achieved by clocking the peripherals using the real‐time clock (RTC), instead of the system clock.

sleepwalking explained

In the SAM4L, SleepWalking has been integrated into many of the peripherals, including the analog comparator, the ADC, the I2C, UART and the capacitive touch interface. It is then the peripheral that decides whether to wake the system, instead of the CPU waking periodically to carry out an interrupt service routine.  With this feature, the need to wake the CPU reduces significantly thus allowing it to stay inactive for longer and more frequent and thereby conserving more energy.

For more information, check out this video for a more detailed explanation on SleepWalking.  Please note: despite the AVR UC3 being used as an example in the video, the underlying fundamentals of how SleepWalking works and its benefits are the same as in the ARM SAM4L.

Developing a Low-Power, Multi-Channel Voltmeter with a Microcontroller

With a microcontroller, a multi-channel ADC and a LCD display, you can create a low-power, multi-channel, standalone digital voltmeter. This design uses an Atmel ATmega8-16AC and a 12-bt ADC. Get the schematic and design details here.