Tag Archives: MCUs

The ATmega32 WAV player

A Maker by the name of Vinod Stanur has created a WAV audio player powered by Atmel’s ATmega32 microcontroller (MCU). 

As the folks at Hack A Day explain, Stanur originally started development using a PIC microcontroller, although the component ultimately lacked sufficient SRAM to effectively act as a playback buffer.

“When he got his hands on an ATmega32 his mind turned back to the project and he saw it through to the end,” explained Hack A Day’s Mike Szczys. “He takes advantage of what he learned on several earlier builds. He’s using a TV remote as input, just like his Snake game did.”

In the most recent iteration of the project, storage is provided by an MMC card. In place of a FAT  (File Allocation Table) library, Stanur uses his own code to read the linked-list for sector addresses. The WAV header is subsequently parsed and the file processed accordingly.

“Playback uses two 512 byte buffers,” added Szczy. “One is feeding the output while the other is being populated from the memory card. When the output buffer is exhausted the two are swapped and the process continues.”

According to Stanur, the ATmega32 WAV player is capable of outputting both mono and stereo of maximum bitrate of 160KHz and 96KHz, respectively. Additional information about Stanur’s ATmega32 WAV player can be found here.

The Atmel-ARM connection

Atmel currently offers the broadest portfolio of MCUs (microcontroller units) based on the two most popular 8- and 32-bit architectures – AVR and ARM. 

“Flexible, highly integrated Atmel ARM-based MCUs are designed to optimize system control, user interface (UI) management and ease of use,” Atmel Digital Marketing Manager Tom Vu told Bits & Pieces.

atmelarm1

“Indeed, the ARM Cortex-M3 and M4 based architectures share a single integrated development platform (IDP)—Atmel Studio 6. This platform provides time-saving source code with more than 2,000 example projects, access to debuggers/simulators, integration with Atmel QTouch tools for capacitive touch applications and access to the Atmel Gallery online apps store for embedded software or extensions.”

Vu also noted that Atmel’s ARM-based MPUs range from entry-level devices to advanced integrated devices with extensive connectivity, refined interfaces and a plethora of security options.

“Whether you are working on new, existing or legacy designs, a wide range of Atmel ARM-based devices provides the latest features and functionality. These devices also feature the lowest power consumption, a comprehensive set of integrated peripherals and high-speed connectivity,” he added.

As previously discussed on Bits & Pieces, Atmel’s SAM4 and SAMA5D3 ARM-based MCUs are used to power a number of industrial and consumer devices including thermostats, remote process control nodes, smart glucose meters, gateway concentrators, bar-code scanners and portable outdoor equipment.

atmel1

Earlier this week, Atmel rolled out its SAM D20 MCU, 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 and 8-bit AVR for ease of use – enabling Atmel to reach new markets.

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.

atmel4

“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.”

Bits & Pieces also asked Andreas Eieland, Atmel Sr. Product Marketing Manager, to describe his favorite SAM D20 features.

“Personally, I like the Peripheral Touch Controller and SERCOM. The PTC is by far the easiest way to add capacitive buttons, sliders wheels and proximity to an application. Plus, there is no need for external components and very little SW overhead, as the module is self calibrating – supporting up to 256 channels,” said Eieland.

“Previously, if you wanted 4 UARTs you had to buy a device equipped with 4SPIs and 4 I2Cs. However, the SAM D20’s SERCOM module allows users to configure the SERCOMs to what they need, meaning devs no longer have to pay for serial interfaces they do not use. Lastly, the SERCOM module is fitted with a multiplexer, offering flexibility in regards to what pin different signals are outputted on, thereby simplifying board layout and reducing board area.”

Meanwhile, Brian Hammill, Atmel Sr. Staff Field Applications Engineer, said he most appreciates the SAM D20’s high end analog to digital converter feature.

“The hardware averaging feature facilitates oversampling, making high resolution at sample rates that apply to many real-world sensor requirements reality without extra software overhead,” he explained,

atmel3

“Sensor nodes in the Internet of Things (IoT) collectively generate a tremendous amount of data. When you’ve got that much data, it had better be good. And reducing the CPU cycles cuts energy use, especially important in applications that use energy harvesting or are battery powered.”

Bump up your Atmel Studio

Written by Johannes Bauer, ARM

With Atmel Studio, Atmel has one of the best free development tools for ARM-based microcontrollers on the market.

Its slick IDE and the smooth integration of the Atmel Software Framework (ASF) makes it a good choice for users of the SAM3, SAM4, and the brand-new SAM D20 devices. One thing some might be missing, though, is a top-notch compiler.

Thankfully, there is a solution in the Atmel Gallery – the Keil MDK-ARM Toolchain extension. It allows Atmel Studio to use the highly optimizing ARM Compiler with its best-in-class code density and high performance for a wide range of applications. The extension requires an installation of Keil MDK-ARM, but makes the integrated compiler available transparently in Atmel Studio.

The ARM Compiler provides two run-time C/C++ library variants: a full ANSI compliant library and a Microlib for utmost code density on small microcontrollers like the Cortex-M0+ based SAM D20. You can give it a spin and see how your code size improves.

As a perfect match for the extension, ARM has recently introduced the MDK-ARM Atmel Edition, or MDK-Atmel for short. This special edition of the industry-standard Keil MDK supports compiling and debugging for ARM-based Atmel MCUs and is available at a reduced price compared to the full version of MDK. Of course you can also use MDK-Atmel stand-alone without Atmel Studio if you prefer that.

Together, the ARM development tools and Atmel software and hardware make a good combination for developers, no matter which environment they work in.

Atmel’s SAM D20 can power this next-gen appliance UI control unit

An appliance user interface (UI) enables easy control of items such as washing machines and dishwashers, while providing visual and audio feedback in real-time. The UI accomplishes this by communicating with various subsystems, including motor controllers and wireless modules.

samd20appliancecontroller

Key design considerations of a next-gen UI include capacitive touch, as well as full compliance with safety and energy standards such as EMC, IEC 60730 Class B, FMEA and EnergyStar.

As noted above, the UI is in constant communication with multiple subsystems such as dedicated modules that control motor tasks like drum rotation and compressor drives – or modules that offer wireless capabilities for linking home automation, remote control units and diagnostic tools.

A number of Atmel components can be used as a platform to help power a next-gen appliance UI control unit – supporting all of the above-mentioned features. These include the SAM D20 ARM Cortex-M0+based MCU, 86RF233 or AT86RF212 IEEE802.15.4 ZigBee radios, various MCUs for motor control, SHA204 Authentication IC for security, 30TS temperature sensor and AT24/AT25 Serial EEPROM.

“The SAM D20 offers an integrated UI, eases standards compliance and supports multiple communications interfaces, which reduces BOM cost and board space, increasing system reliability,” Atmel engineering rep Bob Martin told Bits & Pieces.

“In addition, there is hardware support for self and mutual-capacitive touch interfaces with up to 16×16 channels requiring virtually no external components. All of this enables quick response to touches in all power modes with high button count panels.”

Martin also noted that hardware-based 32-bit Cyclic Redundancy Check (CRC) and Memory BIST help customers achieve IEC 60730 Class B compliance, with EMC compliance eased by flexible PCB routing from SERCOM modules and integrated touch control. Plus, each of the 6 SERCOM interfaces can be configured as a USART, I2C or SPI to more efficiently communicate with multiple subsystems.

On the software side, the SAM D20 boasts an extensive development ecosystem, including Atmel Studio 6 (free IDE with compiler), free SW libraries of production-ready source code, a gallery open to extensions via Atmel’s app store and the SAM D20 Xplained Pro Kit – which offers an integrated programmer and debugger with connectors for expansion wings.

Additional information about the SAMD20 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.

samd20

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.

Modding a wireless rover ‘bot with Atmel’s ATmega128 MCU

Maker Radu Motisan has created a wireless rover ‘bot powered by Atmel’s ATmega128 MCU. As the folks at Hack A Day note, the latest ‘bot is actually the successor to an autonomous follower project started by Motisan a few years back.

“The final goal [was] to have to robot following its user. Putting the rover together was easy except for the tires,” Motisan explained in an article posted on PocketMagic.

“[Atmel’s] Atmega128 wins here with its 128KB flash memory, 16MHz max operating frequency and a multitude of IO ports.”

Radu kicked off his latest project by purchasing the chassis, which included the gear-head motors, tires and control board. He then removed the default chassis control board in favor of an AVR ATmega128 development board and his own motor controller.

Additional key hardware components installed by Radu include a metal bracket system to secure the battery pack, Bluetooth and GPS modules, five ultrasonic sensors, a character display, as well as head and tail lights.

“For the autonomous, human following software I improved the ultrasonic detection algorithm and the movement logic. Now the robot will follow a user more precisely and the speed will vary with the detected signal. [Meaning], if the robots sees the user at a greater distance, [it] will engage with a greater speed. If closer to the user, [the ‘bot] will proceed with smaller steps,” Radu added.

“For the remote control software, where the user controls the robot using a phone, the rover now reports its frontal sensor readings (that show the proximity in centimeters to any detected obstacle) to the smartphone. So the movement commands go from phone to robot – [while] the sensor readings go the opposite way, from robot to phone. [Plus], the software allows the user to turn the lights on/off. Using the frontal distance sensor, a red line is drawn, showing the proximity to an obstacle.”

As previously discussed on Bits & Pieces, Atmel’s high-performance, low-power 8-bit AVR RISC-based ATmega128 microcontroller combines 128KB of programmable flash memory, 4KB SRAM, a 4KB EEPROM, an 8-channel 10-bit A/D converter and a JTAG interface for on-chip debugging. The device supports throughput of 16 MIPS at 16 MHz and operates between 4.5-5.5 volts. By executing instructions in a single clock cycle, the ATmega 128 achieves throughputs approaching 1 MIPS per MHz, balancing power consumption and processing speed.

Additional data about Atmel’s ATmega128 can be found here, while more information on Radu’s ‘bot project is available here.

Building a DIY open source PLC with Atmel’s SAM7S MCU

A Programmable Logic Controller (PLC) can best be described as a specially designed computer used to automate electromechanical processes, including control of machinery on factory assembly lines, amusement rides or light fixtures.

Unlike a typical, general-purpose computer, the PLC is designed for multiple inputs and output scenarios, varying temperature ranges, immunity to electrical noise, as well as resistance to vibration and impact.

It probably goes without saying that most industrial-ready PLCs aren’t exactly cheap for the masses – but what if someone wanted to make a DIY version for their own amusement or to automate basic tasks? Well, that is exactly Warwick did, building a pair of PLCs powered by Atmel’s SAM7S ARM chip (running at a cool 48 MHz).

As the Hack A Day crew notes, the smaller device boasts 10 digital inputs, 4 analog inputs, and 8 digital outputs, while the larger PLC is equipped with 22 digital ins, 6 analog ins and 16 digital outputs. In addition, the two DIY PLCs offer users a number of connectivity options, with USB, RS-232 and RS-485 ports.

In the videos above and below, you can see the large PLC tasked with operating as a bardcode scanner and as a device to continuously levitate a ping-pong ball. Meanwhile, the smaller PLC is used to light up LEDs.

Additional information about the DIY PLC hack can be found here with more data on Atmel’s SAM7S available here.

Atmel’s ATSAM4LC4CA Cortex-M4 based MCU can power this thermostat

A mid-range thermostat facilitates basic climate control with additional sensing, control and interface capabilities. Key design considerations for next-gen thermostats include a backlit touchscreen display, wireless connectivity, low power sipping, air quality monitoring and an accurate clock-calendar.

Atmel’s ATSAM4LC4CA (ARM) Cortex-M4 based MCU, paired with an AT86RF212/AT86RF231 RF transceiver, can be used to build a reliable mid-range thermostat incorporating the above-mentioned features.

atmelthermostat

“The SAM4LC offers a highly integrated device with rich embedded peripherals to simplify product design as well as BOM cost. Key low-power sipping features include 90mA/MHz Active Mode Current and 0.7mA Back-Up Mode with RTC, while SleepWalking and Peripheral Event System further reduce consumption by monitoring environment without waking the CPU,” an Atmel engineer explained.

“Beyond temperature control, the SAM4LC boasts SPI, 12-Bit ADC, I2C, USB and USARTS for interfacing with RF transceivers, communications modules, sensors and battery monitors. Plus, it supports low-power capacitive touch and proximity detection.”

Additional key hardware specs include an asynchronous timer with real-time clock, alarm and calendar mode; an advanced display and user interface (UI); and an integrated segment LCD controller which supports a number of functions such as automatic scrolling, animation, segment blink and blank display.

On the software side, the SAM4L offers full support for Atmel’s Studio 6 IDE (Integrated
Development Environment) for developing and debugging Atmel ARM Cortex-M and AVR microcontroller-based applications. The MCU also supports in-house and third-party supplied modules, kits, OS/RTOS/Middleware and various UI Solutions, while the SAM4L-EK evaluation kit enables rapid code development of apps running on SAM4L devices.

Additional information about Atmel’s ATSAM4LC4CA ARM Cortex-M4 based MCU can be found here.

Atmel licenses Sensinode’s 6LoWPAN software stack

Atmel has inked a deal with Sensinode to license the latter company’s 6LoWPAN software stack. According to Magnus Pedersen, Director of Wireless Solutions at Atmel, 6LoWPAN will facilitate the rapid development of smart, connected wireless devices that help make up The Internet of Things (IoT).

“Teaming with Sensinode is another key step Atmel has taken to ensure designers can quickly bring their smart, connected devices faster to market,” said Pedersen. “With this license agreement, designers now have all the necessary hardware and software elements at their fingertips to build products that require connectivity for the IoT.”

As noted above, Sensinode is licensing its 6LoWPAN stack and router solutions, the NanoStack 2.0 and NanoRouter 3.0 – all to be paired with Atmel’s ultra-low-power wireless hardware platforms for the design of power-efficient IPv6-based embedded wireless products.

Specifically, Sensinode’s NanoStack 2.0 will be used with Atmel’s ATmega256RFR2 wireless MCU, while the NanoRouter 3.0 is slated to support Atmel’s SAM4E Cortex-M4 flash-based MCU and AT86RF231 or AT86RF233 ultra low power IEEE 802.15.4 RF transceivers.

As previously discussed on Bits & Pieces, the Internet of Things is a rapidly evolving and growing market. Indeed, there are nearly 10 billion devices connected to the Internet – a figure expected to neatly triple when it hits approximately 30 billion devices by 2020.

“The IoT represents perhaps the greatest potential growth market for semiconductors over the next several years. What people want is WiFi capability along with very low power, because most of these smart devices are battery-powered,” Atmel President and CEO Steve Laub told the Wall Street Transcript during a recent interview.

“This is advantageous [for] Atmel, because we have both ultra low-power WiFi capability, and the microcontroller device, which when combined with WiFi, makes these devices intelligent and connected. This is a great opportunity for us, and we are very excited by the potential future growth of this technology and its business for us.”

DIY farming with Arduino and Atmel

Steve Spence – an organic aquaponic farmer living in South Carolina – uses pond water to irrigate his vegetables. Monitoring the delicate balance between water and soil is absolutely critical, and often requires real-time readings.

So Spence decided to build custom sensors based on Arduino boards to keep an eye on the water’s pH, temperature and ammonia levels – along with soil temperature, moisture
levels and barometric pressure.

Photo Credit: ModernFarmer.com

“From aquaponics to weather stations, farmers are starting to embrace the modern trends of DIY tech,” writes Caleb Garling of the Modern Farmer. “Arduino boards are creeping into amateur and professional agriculture to streamline and cheapen operations.”

Indeed, Spence is hardly alone in employing a DIY tech strategy for agriculture, amateur or otherwise. For example, Luke Iseman of San Francisco designed a “growerbot,” a sensor array that monitors a garden’s health and updates followers via Twitter. Meanwhile, Ben Shute, who runs Hearty Roots Community Farm, worked with a Boston-based engineer to build an Arduino-based sensor system dubbed “Fido” which sends text message whenever greenhouse temperatures hit dangerous thresholds. Inspired by the success of Fido, Shute founded Farm Hack in an effort to meld farming and engineering – with Arduino as a common denominator.

“Sharing data from DIY sensors can also add real value to the overall farming community,” notes Garling.

Photo Credit: Scott Bauer, Wikipedia

“Websites like OpenWeatherMap.org and HabitatMap.org have taken [this] on, dedicating themselves to aggregating information so farmers — or anyone for that matter — can drill down to the weather patterns for their tiny corner of the world for future planting and harvesting.”

As we’ve previously discussed on Bits and Pieces, the Maker Movement is steadily growing and making its mark on business, the economy and everyday life. The fundamentally social nature of the Maker space is inspiring individuals to launch innovative products easily and cheaply. In so doing, it is empowering a new generation of small/medium businesses and entrepreneurs – with Arduino capturing the hearts and minds of people all over the world.

Atmel microcontrollers are the chips of choice for the Arduino platform, both in their AVR flavor and ARM varieties. Clearly, Arduino has democratized hardware in a way that allows anyone – young or old, engineer or not, rich or poor – to design anything they can imagine. As Arduino’s founder, Massimo Banzi puts it, “You don’t need anyone’s permission to create something great.”