Tag Archives: AVR XMEGA

ChipWhisperer-Lite is an educational board for embedded security

ChipWhisperer is the first open-source toolchain for embedded hardware security research including side-channel power analysis and glitching.

Side-channel power analysis refers to a method of breaking implementations of completely secure algorithms such as AES-256. Such capabilities have been known for a long time – the attack was first published in 1998. But even today many consider side-channel attacks exotic, and don’t take them seriously when designing secure systems. That is why Canadian startup NewAE Technology has launched a new project to help inform designers that they need to take these threats seriously, by teaching them how the attacks work!


Recently debuted on Kickstarter, the aptly named ChipWhisperer-Lite is essentially an educational tool, designed to introduce embedded enthusiasts to the area of side-channel power analysis. You may also recall the project from last year’s Hackaday Prize, where it garnered second place accolades.

Side-channel attacks aren’t magic; in fact, it is possible to design systems which are resistant to them. For instance, Atmel has a line of secure processors which would have encryption peripherals which cannot easily be attacked. Another example is the ATAES132 device – again this has resistance against side-channel attacks, so you could be more confident in the security of that device, compared to a generic microcontroller with an AES hardware peripheral (such as the AVR XMEGA). It’s all about managing the risk!


Additionally, the ChipWhisperer-Lite required a high-speed USB interface, and so, the NewAE Technology team turned to the Atmel | SMART SAM3U2C to accomplish this feat.

“While a number of systems are designed around generic interface chips, using a high-speed USB microcontroller gave me a lot more flexibility. In addition the cost of the microcontroller chip was cheaper than the stand-alone interface chip I would have used, so all these benefits came at no penalty to the BOM cost,” writes company co-founder Colin O’Flynn.

This shows the basic connections between the SAM3U2C and the FPGA. The external memory interface on the SAM3U2C is used to simplify data and control transfer to and from the FPGA.

This shows the basic connections between the SAM3U2C and the FPGA. The external memory interface on the SAM3U2C is used to simplify data and control transfer to and from the FPGA.

According to O’Flynn, the SAM3U family was selected based on set of criteria:

  • High-speed USB 2.0 interface
  • External memory interface with programmable timing parameters
  • TQFP Package (as he wanted people to be able to build this project themselves)
  • Lower cost than standalone interface chip (he had been looking for roughly $3-$4 in a quantity of 1,000)
  • ROM-resident USB bootloader (so that people building their own don’t need a programmer, and makes the board unbrickable)

“The external memory interface is actually critical to achieving a simple FPGA interface. This allows me to memory-map sections of the FPGA right into the SAM3U processor memory. If transferring data over USB to the FPGA, I can point the USB code from the Atmel Software Framework (ASF) to the location in the FPGA I want the data to go,” O’Flynn adds. “This means no need to copy the data multiple times between buffers, or use some specialized protocol to transfer data from the microcontroller to the FPGA.”

Beyond that, the SAM3U2C simplifies system management. Meeting USB sleep mode current limits (2.5 mA) means shutting off the FPGA and analog portions of the board. Standalone interface chips provide a ‘SUSPEND’ output which you can use, but having the microcontroller offered much more control, which ChipWhisperer-Lite’s creators were able to use for meeting inrush current limits.

The USB standard has limits on the inrush current; this current occurs when the USB device is plugged in and all the capacitors start charging. To avoid exceeding these currents most boards need a ‘soft-start,’ where power supplies are turned on after some delay (or after the USB device finishes enumerating).

“Putting this in the microcontroller gives me control over that delay if fine-tuning is needed, or even having the option of adding multiple switches or slower ramps using a PWM output,” says O’Flynn.

This shows the switch for the FPGA and analog power supplies. Depending on the total load, an RC filter can be added to slow the turn-on speed of the FETs.

This shows the switch for the FPGA and analog power supplies. Depending on the total load, an RC filter can be added to slow the turn-on speed of the FETs.

Using the SAM3U2C also provided a nice set of peripherals to use, too. The ChipWhisperer-Lite required a ‘target’ device that the user (i.e. student) programs with their algorithm of interest. For this case, the team selected an XMEGA MCU to serve as a programmable target for the student.

The XMEGA device can easily be programmed with only two wires (PDI), and this is generated by one of the SPI modules in the SAM3U. O’Flynn also used a USART module to communicate with the XMEGA, and finally another SPI module to download configuration data to the FPGA.

“While generic interface chips often have support for serial protocols (such as SPI or USARTs), the problem is they are normally limited in the number of channels offered, or I couldn’t use the serial-interface mode at the same time as high-speed parallel interface mode.”

In addition the details of the protocol (such as the low-level PDI programming protocol for the XMEGA) go into the firmware on the SAM3U2C, simplifying the higher-layer USB interface.


“I find it easier to develop those low-level protocols on an embedded system from within Atmel Studio 6.2, compared to trying to send timing-specific information across the USB bus to be processed by the interface chip! Anytime you can avoid USB debugging is time well spent in my books,” O’Flynn emphasizes. “Using an ASF application example as a starting point for the whole application let me rocket through development, with satisfyingly few moments of pounding my head against the desk figuring out why things weren’t working!”

A final nicety of the design was the ability to use the unique ID programmed into the SAM3U2C as part of the USB device serial number. In other words, the NewAE Technology crew could generate unique serial numbers for each device without requiring any special manufacturing step – every device is loaded with the same binary firmware yet still has a unique serial number. As an end-user, having unique USB serial numbers improves the experience since otherwise Windows will reload the driver when you change the USB port the device is plugged into.

“We’re eliminating the problem for good by making the tools open-source. Because this whole area is an active research area, the tools need to be open-source. This isn’t a case of attempting to seem sexy by adding the word ‘open-source’, but placing something of commercial value into the open-source domain, in the hope it spurs a larger community. This includes hours of tutorials on this area, more than just a few board files and some source code.”

Indeed, this project was devised as a fairly advanced piece of test equipment for well-seasoned Makers, embedded developers and computer engineers. That being said, it is important to note that it is not Arduino-compatible, nor does it work with Raspberry Pi or BeagleBone. However, O’Flynn does reveal that an Arduino-compatible, ATmega328P based target board is in the works. Impressively, ChipWhisperer-Lite also enables users to snap off the ‘target board,’ giving them both a main measurement tool and a target device.


Interested in learning more? You can head over to its official Kickstarter page, where the team is well on its way to achieving its $50,000 goal. Pending all goes to plan, shipment is slated for August 2015.

XMEGA powers this spook-tacular haunted house

Die-hard Halloweenie Shelby Merrick recently transformed his home into one of the most spook-tacular haunted houses we’ve ever seen. The home’s exterior is embellished with a full-out audio/visual installation powered by what the Maker calls FloodBrain — a custom-built lighting system entailing 12 10W RGB floodlights driven by an ATxmega8E5 — providing neighbors with an impressive display of multi-colored effects in coordination with a Walking Dead mix sound sequence.


You can get the full experience by watching the video below!


15-year-old Angad Daryani builds 3D printers

A 15-year-old home-schooled teenager is single-handedly changing the way India looks at 3D printing. Indeed, Angad Daryani runs his own company and sells a variety of DIY kits, ranging from portable speakers to Atmel-powered ReRap printers

“I had no satisfaction that I knew things, I couldn’t apply anything I had learned to real life,” Daryani recently told DNA India. “I quit the formal pattern of studying and am now being home-schooled.”

Daryani says he built his first humanoid robot at 8, along with a remote controlled hovercraft he made in sixth grade by watching YouTube videos. He has also designed an e-book reader for the visually impaired (the Virtual Brailler), which converts written text to braille as it scans across a text.

Daryani’s latest project is the modded RepRap SharkBot, which he describes as “the fastest and most robust desktop 3D printer that can print any material except metal.”

The young Maker said he was inspired to design his own 3D printer, slated to launch in January 2014, after noticing that DIY Makers and engineers were importing printers for desktop use. In the meantime, Daryani continues to offer standard DIY RepRap kits.

“We are wasting foreign currency by importing these things. I want to change that,” Daryani explained. “There’s a movement called Rep Rap which allows people to build [an Atmel-based] 3D printer using stuff they can find at a hardware store. I sell the RepRap Prusa i3.”

As we’ve previously discussed on Bits & Pieces, Atmel AVR XMEGA and megaAVR MCUs can be found in the majority of 3D printers on the market, including the popular MakerBot and RepRap. It should also be noted that the lucrative 3D printing space is set for “explosive growth” in 2014 and 2015. To be sure, Gartner analysts expect worldwide shipments of 3D printers to increase by 75 percent in 2014, followed by a near doubling of unit shipments in 2015.

EDN: Atmel powers the majority of 3D printers

Writing for EDN, Suzanne Deffree confirms that 3D printing is set for “explosive growth” in 2014 and 2015. Indeed, analysts at Gartner expect worldwide shipments of 3D printers to increase 75 percent in 2014, followed by a near doubling of unit shipments in 2015.

“Atmel is one of the hardware makers answering the 3D-printer market call,” writes Deffree. “Atmel AVR XMEGA and megaAVR MCUs can be found in the majority of 3D printers on the market, including the popular MakerBot and RepRap rapid prototyping system brands.”

Andreas Eieland, Atmel’s senior product marketing manager for Flash microcontrollers, says printers like MakerBot and RepRap enable anyone, whether a DIY Maker or professional engineer, to create 3D objects.

“There are now two or three 3D printer companies that have a product that you don’t need to be an engineer at heart to make them work. They are so easy anyone can have them up and running in a few hours,” he explains.

“We have this huge development on the low-end side where for a couple hundred dollars you can build something yourself. [However], on the high end, 3D printers need to find a way to start printing harder materials, like metals. On the low end, the price still needs to come down for professional solutions.”

Nevertheless, emphasizes Deffree, 3D printing technology is reaching new heights and is now light years beyond the creation of simple Yoda busts.

“[This includes] everything from creating replacement parts for personal furnishings and gadgets, to replicating vital organs, making their way into space for use on the International Space Station [and] offering new home construction techniques. The possibilities for the near-term future are endless,” she adds.

Eieland concurs.

“I hope people realize the potential of 3D printing. It’s more than toys and a small version of their own heads. There’s huge potential here in reducing the waste and turnover of products we have in our houses. At the same time there’s an even bigger opportunity in developing something – whatever they need so they can stick with what they have.”

Atmel MCUs: High performance for the IoT

Atmel microcontrollers (MCUs) are designed to deliver maximum performance and meet the requirements of advanced applications. That is why our MCUs offer highly integrated architecture optimized for high-speed connectivity, optimal data bandwidth and rich interface support – making them ideal for powering the smart, connected products at the heart of The Internet of Things (IoT).

Essentially, the Internet of Things (IoT) refers to a future world where all types of electronic devices link to each other via the Internet. Today, it’s estimated that there are nearly 10 billion devices in the world connected to the Internet, a figure expected to triple to nearly 30 billion by 2020.

“As applications become more interconnected and user interfaces become richer, microcontrollers must handle and transfer ever-growing levels of data,” an Atmel engineering rep told Bits & Pieces. “To boost performance for these smart, connected applications, Atmel’s 8-bit Flash MCUs integrate a wide range of classic communication peripherals, such as UART, SPI and I2C. Plus, our higher-performance 32-bit MCUs and embedded MPUs (eMPUs) feature Ethernet and full-speed and high-speed USB, while also providing extension ports for external communication modules such as WiFi or cellular modems.”

More specifically, Atmel’s ARM-based SAM9G45 eMPU  boasts high-speed 480 Mbps USB Host and Device Ports with on-chip transceivers, Ethernet MAC and SDIO/SD Card/MMC interfaces – offering developers an easy way to manage large amounts of data and interconnection both between systems and printed circuit boards (PCBs) inside a system. Indeed, the SAM9G45 eMPU is fully compliant with both EHCI and OHCI standards, enabling easy porting of USB host drivers to the SAM9G45.

Similarly, Atmel’s 32-bit AVR and AT91SAM devices are also well-suited for a wide range of standards-based high-speed USB applications. To be sure, the peripheral DMA controller found in the AVR XMEGA and AVR UC3 facilitates efficient data transfers between peripherals and memories with minimal CPU intervention. This eliminates CPU bottlenecks, allowing AVR microcontrollers to achieve transfer rates of up to 33 MBit/s per SPI and USART port with only a 15 percent load on the CPU.

“In addition, Atmel offers a complete line of IEEE 802.15.4-compliant, IPv6/6LoWPAN based, ZigBee certified wireless solutions,” the engineering rep continued. “They are based on our extensive family of RF transceivers, 8-bit and 32-bit AVR, and ARM microcontrollers. As expected, to ease development and speed time to market, Atmel offers a variety of free software stacks, reference designs, wireless modules and development kits.”

In terms of ensuring sufficient data bandwidth, Atmel’s 32-bit MCUs and eMPUs contains a set of parallel data buses where each bus master controls its own dedicated bus connected to all the slaves. This lets the devices support tremendous data bandwidth and removes processing bottlenecks. Atmel 400 MHz eMPUs also feature a high data speedway architecture based on a peripheral DMA (direct memory access) and distributed memory architecture that, together with a multi-layer bus matrix, enables multiple simultaneous data transfers between memories, peripherals and external interfaces without consuming CPU clock cycles.

Meanwhile, select models of Atmel’s 32-bit microcontrollers feature additional SRAM blocks connected to the multi-layer databus or tightly-coupled with the CPU, enabling devices with multiple high-speed communication interfaces to transfer more data by allowing each peripheral to use all of the available bandwidth of any one of the SRAMs. Combined with the peripheral DMA controller, this allows large blocks of data to be transferred with minimal load on the CPU.

It should also be noted that Atmel’s versatile and expansive MCU portfolio can be used to power a wide range of sophisticated interfaces. Examples include industrial applications, such as home and commercial building automation, data loggers, point-of-sale terminals and cash registers, in-house displays for energy metering, alarm systems and medical equipment – all are joining the “smart” revolution currently enjoyed by portable media player and smartphone markets.

So in addition to ubiquitous Internet connectivity, a central aspect of The Internet of Things, the way in which individuals interface and interact with equipment is fundamentally changing. This is prompting hardware designers to increase the processor performance to several 100 MIPS, the peripheral data rates to tens of Mbps and on and off-chip bandwidth to Gbps. As such, the memory size scales with the software to several Mbytes in cases of an RTOS-based implementation or tens of Mbytes for Linux or Microsoft Embedded CE.

Last, but certainly not least, videos are replacing static images. To address this demand, the Atmel SAM9M10 eMPU embeds a high-performance hardware video decoder and 2D accelerator, delivering a high-quality user experience, all while preserving the full processing power of the central processing unit for the application.

“Simply put, we are continuing to build on its legacy of innovation and highly integrated designs, to deliver a solid combination of performance, flexibility and efficiency to support the machine-to-machine (M2M) communications and evolution of the ‘industrial Internet,'” the engineering rep added.

tinyAVR: Balancing performance and efficiency in a small package

The AVR tour continues! Our first stop? Atmel’s AVR UC3, an MCU built around high-performance 32-bit AVR architecture and optimized for highly integrated applications. Next up? The AVR XMEGA, an MCU designed for real-time performance, high integration and ultra-low power. Our third stop was Atmel’s stalwart megaAVR, which neatly balances both capacity and performance.

And today we are getting up close and personal with Atmel’s tinyAVR lineup. As one can infer from its name, the tinyAVR series is optimized for applications requiring performance, power efficiency and ease of use in a small package – with the smallest tinyAVR measuring only 1.5mm x 1.4mm. As expected, all tinyAVR devices are based on the same architecture and compatible with other AVR devices. Engineers can employ the tinyAVR as a single chip solution in small systems – or use them to deliver glue logic and distributed intelligence in larger systems.

“Integrated ADC, EEPROM memory and brown-out detector allows devs to build applications without adding external components, while tinyAVR offers flash memory and on-chip debug for fast, secure, cost-effective in-circuit upgrades that significantly cuts product time to market,” an Atmel engineering rep told Bits & Pieces. “Simply put, the tinyAVR offers an optimized combination of miniaturization, processing power, analog performance and system-level integration.”

It should be noted that the tinyAVR is the most compact device in the AVR family and the only device capable of operating at just 0.7V. Whereas most microcontrollers require 1.8V or more to operate, the tinyAVR (with boost regulator) boosts the voltage from a single AA or AAA battery into a stable 3V supply to power an entire application. Plus, tinyAVR designs can be coupled with Atmel’s CryptoAuthentication device for an added level of security against hackers and cloners.

Additional key features include:

  • Capacitive Touch – Atmel’s QTouch Library makes it easier for engineers to embed capacitive-touch button, slider and wheel functionality into general-purpose Atmel AVR microcontroller applications. The royalty-free QTouch Library provides several library files for each device and supports different numbers of touch channels, enabling both flexibility and efficiency in touch application.
  • Fast and code efficient – The AVR CPU gives the tinyAVR devices the same high performance as Atmel’s larger AVR devices and several times the processing power of any similarly-sized competitor. Flexible and versatile, they feature high code efficiency that allows them fit a broad range of applications.
  • High integration – Each pin has multiple uses as I/O, ADC and PWM. Even the reset pin can be reconfigured as an I/O pin. tinyAVR also features a Universal Serial Interface (USI) which can be used as SPI, UART or TWI.

Interested in learning more? Be sure to check out our full tinyAVR portfolio here.

Capacity and performance characterize Atmel’s megaAVR

Our ongoing coverage of Atmel’s comprehensive AVR portfolio has taken readers on a detailed MCU (microcontroller) tour this month. First, Bits & Pieces dove into the guts of Atmel’s AVR UC3 which is built around high-performance 32-bit AVR architecture and optimized for highly integrated applications.

We then spent some time with Atmel’s AVR XMEGA, an MCU designed for real-time performance, high integration and ultra-low power. And today we want to properly acquaint our readers with Atmel’s megaAVR microcontroller, which is well known for both capacity and performance.

“When your designs need some extra muscle, you need the megaAVR. Ideal for applications requiring large amounts of code, the megaAVR offers substantial program and data memories with performance up to 20 MIPS, with picoPower technology minimizing power consumption,” an Atmel engineering rep told Bits & Pieces. “All megaAVRs offer self-programmability for fast, secure, cost-effective in-circuit upgrades. You can even upgrade the flash while running your application.”

Indeed, the megaAVR family offers Atmel’s widest selection of devices in terms of memories, pin counts and peripherals. Meaning, engineers can choose from general-purpose devices to models with specialized peripherals like USB, or LCD controllers, or CAN, LIN and Power Stage Controllers.

More specifically, Atmel’s megaAVR family is equipped with on-chip flash, SRAM, internal EEPROM, SPI, TWI, USART, USB, CAN, LIN, watchdog timer, a choice of internal or external precision oscillator and general purpose I/O pins.

In terms of analog functions, the megaAVR boasts advanced analog capabilities, such as ADC, DAC, built-in temperature sensor and internal voltage reference, brown out detector, a fast analog comparator and a programmable analog gain amplifier. Simply put, the high level of integration allows designs with fewer external analog components.

And last, but certainly not least, megaAVR microcontrollers help accelerate the development process with advanced in-system programming and on-chip debug, while in-system programming works to simplify production line programming and field upgrades.

Interested in learning more? A full breakdown of our AVR portfolio is available here.

Atmel MCUs for fire and security

Atmel’s versatile MCUs power a number of fire and security applications – allowing vendors to design advanced systems that effectively safeguard people, property and business resources.

“Atmel offers a wide range of ARM-based AT91SAM and AVR 32-bit microcontrollers for such applications,” an Atmel engineering rep told Bits & Pieces. “More specifically, the SAM3 family and AVR UC3 families support entry-level systems, while advanced controllers with Ethernet connectivity are based on the SAM9 and AVR UC3 families.”

Backup mode and diverse connectivity options include an embedded soft modem, Wi-Fi extension board, Ethernet and RS485 connectivity, with Atmel CryptoAuthentication enabling node authentication and secure communication. Top-level security can be provided by AVR XMEGA hardware AES/DES crypto module and AES/DES bootloaders for megaAVR, tinyAVR and AVR XMEGA.

“It should also be noted that low-power 8-bit microcontrollers minimizes power consumption, with Atmel’s ATmega128RFA1 single-chip, allowing devs to design ZigBee smoke and motion detectors with extremely low power consumption,” the engineering rep continued. “Plus, Atmel’s XMEGA analog delivers optimal performance with 12-bit ADC resolution up to 2Msps with internal gain stage (up to X64), while optimizing BOM by removing its external gain stage.”

So let’s look at some specific example of how Atmel MCUs can be used to power a wide range of fire and security devices:

  • Control Panels – The primary point of contact for home and building automation consumers. Atmel’s portfolio supports a wide range of designs, meeting simple or complex needs.
  • Detectors – Known as the eyes and ears of fire and security solutions. Our low-power solutions are capable of supporting motion detectors, smoke detectors, sounders and glass break detectors based on the Atmel tinyAVR, megaAVR, AVR XMEGA and MCU Wireless (single-chip microcontroller +RF) families.
  • PIR (Camera) Detector – Atmel’s AVR picoPower technology significantly improves detector battery life, delivering the reliability that Passive Infrared (PIR) camera-based detectors require.

“Flexible connectivity is key for home gateway and control panel applications. That is why Atmel’s microcontrollers (MCUs) help vendors achieve a rapid time-to-market by providing validated connectivity via Ethernet, USB, soft modem (PSTN), Wireless LAN and RS-485 interfaces with backup mode,” the engineering rep added. “In the event the main power supply cut off, the control panel can automatically switch to battery operating mode to maintain connectivity.”

Interested in learning more? Additional information about Atmel’s extensive fire and security portfolio can be found here.

Atmel’s SAM D20 MCU goes live

Atmel has introduced the SAM D20, a comprehensive product lineup based on ARM’s Cortex -M0+. Essentially, the new microcontroller series combines the performance and energy efficiency of an ARM Cortex-M0+ based MCU with an optimized architecture and peripheral set.


According to Atmel engineering manager Bob Martin, the SAM D20 offers a “truly differentiated” general-purpose lineup that is ideal for a wide range of low-power, cost-sensitive devices, including GPS trackers, appliance controllers, intelligent remotes and optical transceivers.

“The SAM D20’s power-saving techniques include an event system that allows peripherals to communicate directly with each other without involving the CPU, while SleepWalking peripherals wake up the CPU only upon a pre-qualified event, reducing overall power consumption,” Martin told Bits & Pieces.

“In terms of peripheral flexibility, a serial communication module (SERCOM) is fully software configurable to handle I2C, USART/UART and SPI communications. Meaning, with multiple SERCOM modules on a device, designers can precisely tailor the peripheral mix to their applications.”

Meanwhile, the SAM D20’s QTouch Peripheral Touch Controller offers integrated hardware support for buttons, sliders, wheels and proximity – as well as supporting both mutual and self-capacitive touch (without the need for external components), along with noise tolerance and self-calibration.

Additional key hardware specs include high-precision, 12-bit analog and internal oscillators; 8 16-bit timer/counters; 32-bit real time clock and calendar; real-time performance; peripheral event system, as well as flexible clocking options and sleep modes.

As noted above, the SAM D20 lineup boasts 6 serial communication modules (SERCOM) that can be configured to act as an USART, UART, SPI or I2C. On the scalability side, Flash memory densities range from 16KB to 256KB, with devices available in 32-, 48- and 64-pin QFP and QFN package options. BGA and WLCSP options will be offered at a later date.

“In a nutshell, the SAM D20 family extends the lower end Atmel Cortex portfolio, closing the gap between the AVR XMEGA and the Cortex-M3 and Cortex-M4 products,” Martin explained.

“The SAM D20 – the first series in this new family – offers 48MHz operation (1.77 CoreMark/MHz), single-cycle IO access and supports a pin-toggling frequency up to 24MHz along with an 8-channel event system. In terms of low-power sipping, we’re looking at <150µA/MHz, ~2µA RAM retention and RTC as well as options between internal and external oscillators and on-the-fly clock switching.”

Additional information about Atmels’ s SAMD20 MCU series can be found here.