Tag Archives: Atmel AVR

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!


Let Arduino control your dishwasher or washing machine

My buddy Rob works over at Brocade in the IT department. He is not an engineer, but he loves technology. So I was delighted when he asked me if I had ever heard of Arduino. I gleefully told him that the Arduino Uno was built around an Atmel AVR chip and was loved by Makers and Hobbyists and Engineers the world over.

What Rob is interested in is hacking on his dishwasher so he can control it with an Arduino.


Arduino aficionado Unaclocker is adapting an Arduino to run his dishwasher.

Rob’s source has a great story. The controller on his dishwasher failed. The repairman wanted $150 just the board. So in the true Maker spirit, the “Unaclocker” decided it would be easier, cheaper, and more satisfying to build his own controller using an Arduino. The best part is that now he can control water times to insure that the temperature in the dishwasher gets high enough to really clean and disinfect the dishes.

So Rob went out and bought and Arduino kit, and is starting to play with it. Being a curious fellow, it didn’t take Rob long to find another whitegoods application, this time with the Arduino controlling a washing machine (pdf). This is courtesy of the fine folks at the Gokaraju Rangaraju Institute of Engineering and Technology over in Hyderabad.

You can easily see that the whole world is embracing using the Arduino as a control system building block. You can also see that many companies are using the Arduino as a component in their products, like this commercial printer.

AVR XMEGA-A3BU Xplained demo board unboxing

So we cleaned out a storage area and lo and behold, there was an XMEGA Xplained demo board. So I scrounged up a USB cable and plugged it into my computer. I don’t have Studio 6 installed yet, but I thought it would be fun to just un-box it. This is what happened:


You can get your very own XMEGA Xplained eval board for on $29. The LCD alone is worth that.


What a score, the seals are still on the box. I think this was used in FAE training in May.


This is what is inside. There is that great LCD, a CR1225 battery for the real-time-clock (RTC), 3 tact switches and a touch switch, a temp sensor, a light sensor, all the signals on headers, and a JTAG port so you can hang a Dragon on it and see inside the chip while it executes. Sweet.


Here is a close-up. Oh, there is a non-volatile serial memory chip too. Needless to say, I have not read any manuals or paperwork yet, heck I am a man, like my buddy Tim who didn’t read the manual on his $60,000 Cadillac before he drove it to San Diego.


On the backside, you can see the 2010 date, but it turned out the board was way newer, stay tuned. You can see the flux residue where they hand-soldered the LCD. You can’t send an LCD through an IR reflow oven.


I stick a USB cable on it, and wow, it has a backlight on the LCD. It was obvious that the welcome screen here is telling you how to navigate the pre-installed program. That is not a touch-screen, it is telling you the tact switches and the one touch pad on bottom left are your navigation buttons.


Here is the screen with a flash picture—you can read the LCD either way. You can bet I am thinking how to mount this on my Harley and make a voltmeter/ammeter, temp sensor system out of it.


This is what you see if you press “Enter” (the top left button). It’s a sub-menu that displays the temperature, the light intensity, or the production date.


Here is the production date screen.


It took me a while to figure out that there was a touch-pad on the bottom left instead of a tact switch. This is how you go back up the menu tree.


Here is the temperature display. It seems pretty accurate, despite the board saying “NTC SENSOR”. I assume there is a linearization program, negative temperature coefficient sensors are notoriously non linear. This is reading hot since I put my finger on the sensor to see it work.


The top menu had more items and would scroll. This is the page for setting date and time. It was set to Norway time, but the date was right after 6 months.


This is a menu choice that shows how long the board has had its real-time clock powered.


When you stick in the USB the computer prompts you to add a driver. I don’t think that is a good idea. The way this is meant to be used is that you install Studio 6 or use some other IDE or the Atmel Software Framework (ASF) and that has the driver the card needs. So I cancelled. We have all been burned installing things on Windows.

Well this got me pretty fired up. It never occurred to me one of our demo boards would have such a nice program on it pre-loaded. I guess it’s time to install Studio 6. I have been avoiding it, since I am an assembly language dinosaur, and I am sure all this code is in C. After all that is one of the coolest things about AVRs, they were designed to run C and run it well.

In addition to installing our free Studio 6, I will hang a Dragon debugger/emulator onto the card. Thata is another cheap purchase from Atmel, about 50 bucks. There were a couple of those in the storage room too. With a Dragon I can see inside the chip as it runs, single step programs, and read the registers and memory locations.

ECO 1 (engineering change order). Let’s make that navigation screen show more representative symbols for the tact switches, and the touch pad. And let’s move the symbols to the outside corner of the screen, like they are on the PCB (printed circuit board).

ECO 2. Lets add a menu pick to read analog voltages—hang on—holy cow, this thing not only has two 12-bit ADCs, it has 4 comparators. I can see there is a lot to love. And get this—6, count ‘em, 6 USARTs. That will satisfy my buddy Dave who insists on one dedicated UART just for software debug. Sure you can use the debugger when it is hooked to Studio 6 or your IDE, but it is also nice to have a port you can query or that spits out status when the system is deployed in production.

Stay tuned, I will be hooking up one of those Dragons and installing Studio 6 next. Just remember the first rule, never keep a handgun in the same desk you have a computer on. I do expect to be frustrated, it’s been 12 years since I programmed in assembly, and never have used C, but let’s take this little adventure together and see what happens.

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

Atmel’s AVR low-power 32-bit microcontrollers (MCUs) provide higher processing performance, improved accuracy and optimized power efficiency for automotive applications. This facilitates implementation of new product-differentiating features such as advanced control algorithms, voice control and capacitive touch sensing.

More specifically, Atmel’s AVR UC3C 32-bit microcontroller (MCU) include a peripheral event system, precision clocking, and high-performance peripherals. Integrated features – such as secure Flash memory, hardware-based safety mechanisms, the ability to interface directly with analog sensors, and a configurable software framework. All of the above helps to significantly accelerate application development.

“Simply put, the difference in efficiency between 32- and 8-/16-bit systems is substantial: a generic 32-bit multiple/accumulate requires four multiplications and four additions on a 16-bit processor with additional overhead for data accessing,” an Atmel engineering rep told Bits & Pieces.

“Thus, a single 32-bit multiplication could require about 20-40 cycles on a 16-bit processor. On a 32-bit UC3C processor this operation requires only a single cycle supported with a 32-bit pipeline for rapid data access. The availability of an integrated FPU also simplifies application development. The implementation of complex algorithms in particular requires less effort and the wider dynamic range maintains the highest precision.”

According to the engineering rep, implementing complex algorithms using 32-bit floating-point instructions not only increases system accuracy and efficiency, but also helps accelerate the development cycle. Indeed, a wide variety of applications can benefit from the use of a floating-point unit, including motor control and audio applications.


“Atmel’s UC3C 32-bit microcontroller instruction set is an efficient mix of 16- and 32-bit instructions that allows C compilers to balance performance and code density. Its architecture has been optimized for managing real-time events common to embedded systems while minimizing processing latency,” the engineering rep continued. “The UC3C microcontroller also includes a wide variety of state-of-the-art peripherals and interfaces – such as CAN and LIN – required by automotive control modules (ECU), while also ensuring reliable operation across the entire automotive temperature range in compliance with the AECQ100 specification.”

Atmel AVR UC3C 32-bit automotive-grade microcontrollers can be powered either by a 3.3V or a 5V supply and generally support 5V I/O. This has been achieved by moving to a modified 0.18-micron process technology, which can support 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 with a wide range of high-performance peripherals required by automotive applications, which will we discuss in-depth during part two of this series. Interested in learning more about 32-bit AVR MCUs for automotive applications? Be sure to check out part onetwothree and four of this series.

In-circuit emulation for AVR and ARM SAM D20 chips

You can do a firmware upgrade on your JTAGICE3 and it will work with the ARM M0+ based SAM D20. If you don’t want to use a separate emulator, there is also a debugger on the $39 SAM D20 Xplained Pro eval board. Atmel has a long history of providing inexpensive development tools. The $49 “Butterfly” eval board and $200 STK200 in-circuit emulator (ICE) was what got me to switch to Atmel micros back in 2000. These days we have three in-circuit emulators, sometimes called debuggers. The $49 Dragon is low cost and does all AVR chips, even the 32-bit AVR chips. The AVR ONE! is much more expensive, about 500 bucks, but it does have trace. That means you can go back and see where your program went as it executed. This can be worth every penny if you have complicated program flows with internal and external interrupts.

Most engineers like the JTAGICE3 emulator Atmel offers for only $99. Like the JTAGICE2, that predates it, the JTAGICE Mark3 can do all the AVR chips, including the newest XMEGA families. The great news is that Studio 6, the integrated development environment (IDE) program Atmel gives away for free, can do a firmware upgrade on your JTAGICE3 so it can work with the new SAM D20 ARM chip Atmel just released.  From the news bulletin:

Atmel Studio 6.1 SP2 includes a firmware update for the JTAGICE3 which adds programming and debugging support for the SAM D20 devices. The JTAGICE3 firmware will be automatically updated when a programming or debugging session is started in Atmel Studio 6.1 SP2.

Atmel Studio 6 users who want to take advantage of this firmware update will have to upgrade to Atmel Studio 6.1 SP2, which will be available for download at http://www.atmel.com/tools/atmelstudio.aspx starting August 15th.

Technical details can be found at http://www.atmel.no/webdoc/jtagice3/jtagice3.whats_new.html.

This is just too cool. Studio 6 has always supported code development of Atmel’s ARM MCU (microcontroller) chips, the ones with internal flash. Now you can debug the M0+ ARM-based SAM D20 with the same JTAGICE3 you use for AVR and AVR-32 chips.

I have to laugh when my buddies say Atmel tries to make money on our eval boards and emulators. We don’t look to make any appreciable profit on the tools. We give away Studio 6 for crying out loud, and anyone that has done product design knows what a cheap deal the eval boards and these emulators are. Atmel sells chips and touchscreens (XSense). That is where we make our money. So you folks that have bought a JTAGICE3, celebrate, you can now debug our great SAM D20 with it. Like I said, “Friends don’t let friends go without a debugger.

Atmel builds a world of touch for the IoT

It is rather difficult to imagine life without touch in an age characterized by the rapidly evolving Internet of Things (IoT). If you think about it, the digital world today seems centuries away from the 80’s when desktop PCs reigned supreme with limited input peripherals such as noisy clicking keyboards, wired mice, and cumbersome joysticks.

Photo Credit: Engelbert Reineke (Wikipedia)

Fast forward to 2013. Instead of PCs monopolizing entire desks and racking up huge electric bills, our world today is ruled by a plethora of touch-enabled mobile devices like smartphones and tablets. Atmel CEO Steve Laub probably put it best when he told the Wall Street Transcript that touch is generally considered to be the preferred method for current-generation consumers to interface or interact with electronic devices.

“For the last three years, [Atmel has] been the world’s leading provider of mobile touch solutions, so our technology and products are changing the way people use and interact with electronic [devices],” Mr. Laub explained. “Our technology is also changing how they view the world and the ability to interact with the world.”

So let’s take a quick look at Atmel’s expansive touch portfolio. Our lineup of touch-based products is headed up by maXTouch microcontrollers – the direct culmination of touchscreen engineering efforts spanning more than 15 years. Our international team of engineers have produced an optimal and scalable capacitive touchscreen architecture virtually unrivaled when it comes to sensing a user’s input, whether on a tablet, smartphone, meter, control panel (both for industrial applications and consumer appliances) or inside a vehicle.

Unlimited-touch options facilitate a wide range of new possibilities for interface designers. By recognizing as many touches as people have fingers, the technology can support a variety of multitouch gestures anywhere on the surface. In addition, unlimited touch makes it possible for the device to detect and ignore unintended touches, such as the pressure of the user’s ear, cheek or hand grip.

The latest development is XSense touch sensors. These provide a highly flexible, high-performance alternative to traditional touch sensors – allowing engineers to develop light, sleek touch-based designs that are edgeless or wrap around an edge, have narrow borders, and boast curved surfaces. XSense is an exciting new extension of printable electronics, where a microscopic copper mesh provides better performance and clearer displays than legacy ITO (indium tin oxide) touch screens.

Lastly, Atmel’s buttons, sliders and wheels boast excellent precision and reliability on any touch-sensitive device, as the solution is designed to support simple configurations of 1 to10 buttons and scanned-matrix configurations of up to 48 buttons.

To sum it up, Atmel’s maXTouch family of touchscreen controllers offer superior performance and low-power consumption in a single integrated circuit. Our capacitive touch technology and algorithms, combined with an optimized and touch-sensing enabled Atmel AVR microcontroller, provide an unlimited number of touches, fast response time, stylus support and low power consumption.

These capabilities significantly enhance the consumer experience, changing the way the world interacts with electronic products. And best of all, it provides our customers with a leading edge, comprehensive multi-touch solution for a wide range of new applications in smartphones, tablets, notebooks, gaming consoles, GPS, POS terminals and multi-functional peripherals.

Accessing your vehicle with Atmel

The automotive industry has certainly come a long way since Henry Ford’s Model T first rolled off the assembly line in 1908. To be sure, car (access) keys have radically evolved from the simple, unassuming steel key of yore to acting as the human interface to a vehicle.

Photographed at the Bay State Antique Automobile Club’s July 10, 2005 show at the Endicott Estate in Dedham, MA by Sfoskett

Similarly, Atmel’s automotive portfolio has also rapidly evolved since 1997 when we introduced our very first dedicated car access transmitter.

Indeed, Atmel now offers a wide range of car access devices that are ideal for developing complete system solutions with the highest levels of security and convenience, supporting remote keyless entry, immobilizer, passive entry/go or combi key applications.

“Remember, providing a high level of security is a must for car access applications, something which is also required by insurance companies worldwide,” an Atmel automotive engineering rep told Bits & Pieces.

“And that is why Remote Keyless Entry (RKE) systems combined with immobilizers are standard in nearly all cars today, while passive Entry/Go (PEG) applications offer the ultimate convenience for car users and are well-established in current luxury vehicles.”

Unsurprisingly, such features are increasingly making their way into medium-class cars. To meet these demands, developers require cost-efficient electronic system solutions that support a high level of integration.

As such, Atmel offers a comprehensive line of ICs (RF, LF, Atmel AVR microcontrollers) to create complete car access and remote start systems, along with dedicated RF transmitters, receivers and transceivers, as well as microcontrollers.


In addition, Atmel enables a uni-directional RF link for the keyless entry function to open or lock the doors. The immobilizer system is built with a bi-directional LF link operating with the AUT64 crypto algorithm.

And last, but certainly not least, Atmel supports a bi-directional RF link for the RKE function as well as for the extremely secure duplex RF link in a Passive Entry Go system. The lF link is used for the wake- up channel in a PEG system and the immobilizer function to start the RF communication.


Interested in learning more about Atmel’s expansive automotive portfolio? Be sure to check out some of our related blog posts from earlier this week, including “A closer look at Atmel’s vehicle portfolio,” “Atmel expands MaXTouch auto lineup,” and “LIN networking for the automotive masses.”

Up close and personal with Protostack’s ATmega32 Development Kit

Protostack has introduced a development kit for Atmel’s ATmega32 MCU. The kit – which measures 5″ x 3.7″ (127 x 93.98mm) – is made of 1.6mm FR4 and boasts clean routed edges.

As expected, Protostack’s ATmega32 dev kit conforms to the full size protostack form factor, allowing it to be stacked with other full size and half size protostack boards. The silicon also includes a 40 pin AVR development board, ATmega32A-PU microcontroller and power supply components.

Recently, the folks at TronixStuff had a chance to review the kit and came away with a positive impression overall.

“As you can see from the images below, there’s plenty of prototyping space and power/GND rails. The [packaged] parts allow you to add a power supply, polyfuse, smoothing capacitors for the power, programmer socket, external 16 MHz crystal, a DC socket, IC socket, a lonely LED and the ATmega32A (which is a lower-power version of the ATmega32),” the TronixStuff crew explained.

“You can download the user guide from the product page, which details the board layout, schematic and so on. When soldering the parts in, just start with the smallest-profile parts first and work your way up. There’s a few clever design points, such as power regulator – there’s four holes so you can use both ‘in-GND-output’ and ‘GND-output-input’ types.”

In addition, says TronixStuff, the layout of the prototyping areas resemble that of a solderless breadboard with the power/GND rails snaking all around – so transferring projects won’t be difficult at all. Plus, if you need to connect the AVcc to Vcc, the components and board space are included for a low-pass filter.

“It’s a solid kit, the PCB is solid as a rock, and it worked. However it could really have used some spacers or small rubber feet to keep the board off the bench. Otherwise the kit is excellent, and offers a great prototyping area to work with your projects,” TronixStuff concluded.

Interested? The ATMEGA32A Development Kit can be purchased here on ProtoStack for $23.

8 MHz AVR MCU controls WS2811 LED driver at 800kHz

Yes, it is definitely possible to drive WS2811 LED strip controllers at 800 kHz with an 8 MHz Atmel AVR – sans an external 16 Mhz oscillator.

As the Hack A Day crew notes, this was recently proven by a Maker named Danny who wrote Assembly code to handle pairs of binary bit values.

“With a code block for each of the four possible combinations in hand he had to find a way to craft the conditional jumps to preserve accurate timing. After hitting the wall trying to solve this puzzle by hand he wrote a C++ program to solve it for home,” the Hack A Day team explained.

“The proof is in this video which shows one chip driving multiple Larson scanners on a single strip.”

According to Danny, the exercise taught him that extremely time-critical code can be solved with a number of techniques.

“[The first is] unrolling loops. It is not a new technique, but in this case it not only saves on the number of test-and-jump-to-the-starts (the normal reason to unroll a loop), but also decreases the number of other tests and allows me to sweep a few precious left-over clock cycles into contiguous blocks,” Danny wrote on his Wiki page.

“[Also], when code is ‘phase critical’ abandon the idea of a list-of-instructions and organize the code inphase aligned side-by-side blocks, where a jump is most often a jump ‘to the right’ or ‘left.’ [Finally], use software to optimize code layout in memory. [While] I am not aware of any assembler that will automatically do this when jump labels are out of reach, I [do] know I have wished for it more than once.”

Additional information about Danny’s hack can be found here on the project’s official Wiki page.

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.


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