Tag Archives: AVR MCUs

Introducing the new Power Debugger


Atmel has unveiled a new high-performance debugging tool with advanced power visualization for ultra-low-power designs.


If you’re seeking a high-accuracy debugging tool that lets you visualize the power usage of your product during development, you’re in luck. That’s because Atmel has unveiled a new Power Debugger, the latest dev tool for debugging and programming both Atmel | SMART Cortex-M–based and AVR MCUs that use JTAG, SWD, PDI, debugWIRE, aWire, TPI or SPI target interfaces.

CQPjArgUsAAyDyt-1

With ultra-low power being such a critical factor in next-generation IoT, wearable and battery-operated devices, having the ability to locate code where power spikes occur is crucial. The Power Debugger features two independent current-sensing channels for collecting power measurements during application execution (one high resolution channel that can measure 100nA to 100mA and one lower resolution channel that can measure 1mA to 1A), and streams such collected measurements to the Atmel Data Visualizer — available in the Atmel Studio 7 IDE — for real-time analysis and display. The program graphs power usage and utilizes this data to estimate application battery life. What’s more, the Data Visualizer allows developers to correlate power samples with the code that was executing when the sample was taken, greatly reducing the time required to identify “hot spots” in the developers’ application.

“Lowering overall power consumption is key to many customer designs and essential for battery-operated and wearable designs,” explains Steve Pancoast, Atmel Vice President of Software Development, Applications and Tools. “Atmel provides cost-effective, easy-to-use tools that make it possible for our developers to profile the power usage of applications running on their own hardware as part of the standard development cycle. The Power Debugger is part of Atmel’s pledge to bring the latest tools to market, enabling developers to quickly get their prototype to production with the lowest power consumption.”

The Power Debugger is now available on Atmel’s online store and and through a variety of distributors. Each kit consists of a main unit with plastic back-plate, two USB cables, a 10-lead squid cable, a flat cable (10-pin 50mil connector and 6-pin 100mil connector), an adapter board (20-pin 100mil connector, 6-pin 50mil connector and 10-pin 100mil connector) and a 20-pin 100mil jumper cable.

Video: Vegard Wollan reflects on life and innovation

In the final segment of my interview with AVR microcontroller creator Vegard Wollan, I asked about his background and innovation at Atmel.

In response to my question of how he views his expertise, Vegard noted that he started out as a computer architect and digital designer. It’s simple to see the ease-of-use DNA in the AVR product line when Vegard then noted that he soon saw himself as someone that could make life easy for embedded designers. I think this focus on the customer pervades all of Atmel to this day.

Vegard-Wollen_innovation-at-Atmel

Vegard Wollan reflects on his history of innovation at Atmel.

I went on to ask Vegard what he does in his spare time. His response? Exercising and boating off the beautiful, dramatic Norwegian coastline. I think physical activity is a key thing. In fact, I wish someone had warned me as a young man that engineering has an occupational hazard. You can make a good living sitting at a desk. This was less true when I was an automotive engineer, as I had to go the experimental garage and walk around Ford’s giant complex in Dearborn, Michigan. Nowadays, we all seem chained to a computer, and stuck in a chair all daylong. So, exercise and boating sounds like a great way to stay active and balance our lives a little bit!

As I pictured Vegard sailing around Norway looking at beautiful sunsets, I wondered if that was inspired him to be so innovative. He responded that the primary source of innovation at Atmel is working with a team of creative innovative people. I think this is true in most human endeavors. When I asked my dad why some restaurants had really good service, he noted that good people like to work with other good people. That is why Vegard is spot-on, and quite humble in noting that innovation comes from a team, not any single person.

Want to learn more about the backstory of AVR? You can tune-in to the entire 14-part series here.

Tutorial: Building cool projects with MCUs (Part 2)

I’ve always found microcontrollers really cool. After learning how to use MCUs, along with a few other electronics skills – I can’t really think of anything I am NOT able to build.

Okay, maybe not a time machine…

But when it comes to the electronics part of a project, knowing microcontrollers gives you the ability to build A LOT of different things.

Microcontroller circuit

In the previous part of this tutorial, we looked into the basics, and we established that a microcontroller is kind of like a tiny computer. You can connect things like a display, buttons or Wi-Fi, not to mention put programs onto it and run them.

In this segment, we are going to choose the microcontroller to use in our circuit. There are a gazillion options, so we’re going to use a tool to make things easier. But first, we need to figure out our requirements. Choosing a microcontroller becomes much easier once we know what we actually need.

Differences Between Microcontrollers

8-bit, 16-bit and 32-bit

A microcontroller comes in several bit sizes. You can find microcontrollers with 8-, 16- and 32-bit. This size refers to the size of the databus. With a larger databus, you can do more heavy calculations. In the hobbyist world, the 8-bit microcontroller is probably the most common of them all.

Usually, the 8-bit MCUs have fewer pins, and is therefore easier to solder onto a circuit board. In this microcontroller tutorial series, we’ll be keeping it as simple as possible, so we’re going to use an 8-bit.

Memory, Pins and Peripherals

Even an 8-bit microcontroller comes in a lot of different versions. Some have more memory. Some have more input and output pins. Some have USB interface. Some have analog to digital conversion. Some have SPI communication.

These extra functions – like USB or SPI – are called peripherals.

Chip on finger

Finding a Microcontroller for Our Circuit

My goal with this tutorial is to show you how to build a super simple microcontroller circuit.

One thing that affects how simple it is going to be is the programming method. How are we going to get the program we make onto the chip?

Often times, people use an external programmer or debugger that they connect to their microcontroller circuit, but I don’t want you to have to buy an extra tool for this. I want us to be able to just connect the circuit to a USB port on a computer and program it directly.

This leaves us with the following requirements:

  • Can be programmed through USB
  • Few components necessary
  • Possible to solder at home

We can make our circuit programmable through USB in a few different ways. For example, we can do this by adding a USB-to-serial chip onto our circuit – like they do on some of the Arduino boards.

However, since this will increase the number of components, a better solution is to find an MCU with USB interface included. It would also need a bootloader that can accept programming through USB.

Conveniently, some of Atmel’s microcontrollers come pre-loaded with a bootloader called USB DFU Bootloader.

To be able to solder the circuit at home, we want a chip with few pins. The fewer pins a microcontroller has, the easier it is to solder it. So let’s look for a chip with as few pins as possible.

The Microcontroller Selector

With our requirements in place, we can start looking for the perfect microcontroller. The Microcontroller Selector is a very useful tool that Atmel made to help you choose a microcontroller.

Using this tool, we can select what we need from our microcontroller, and it will show us which models that fit our criteria.

Using the Microcontroller Selector

We decided earlier to use an 8-bit MCU, so we select «8-bit AVR» under the «CPU» option.

Also, we want a USB interface. Specifically, we want a USB device interface. So under «USB» we select all the options that include «device».

Since we also want as few pins as possible, we’ll sort the results by number of pins.

Microcontroller Selector Tool

Doing this leaves us with five options that have 32 pins. No microcontroller matching our criteria has fewer than 32 pins., while a few options have more than 32 pins, so we can discard those.

One more criteria we are seeking is if the chip comes preloaded with the DFU bootloader. Unfortunately, we can’t select this criteria in the tool; yet, by looking into the documentation for the DFU bootloader, we can find a list of which microcontrollers are preloaded with this feature.

Here, we can see that one of our options, the ATmega8U2, does not have the bootloader. That leaves us with 4 options:

All of these match our requirements, so let’s just choose the one with the most amount of flash. The more flash we have, the bigger programs we can load onto the chip.

So, we’ll choose the ATmega32U2.

Designing the Circuit

Next, we will be designing the circuit. With the chip selected, I believe this will be pretty straightforward. Not too many components are necessary. Nevertheless, I am writing this as I am doing it – and I’ve never used this chip before – so there is always a chance of some surprises..

Stay tuned for Parts 3-5 in the coming days…

Vegard Wollan talks about the history of AVR

We were lucky enough to drag Vegard Wollan into the Atmel Studio while he was visiting headquarters from Norway a few weeks ago. For those of you who may not know, Vegard is commonly believed to be the “V” in AVR. After having spent hours in the Studio, we decided to break the film into separate segments — this one is about the history of the AVR. And, what better day to recount the earliest days of the revolutionary microcontroller than Throwback Thursday?

You young whippersnappers might not realize it, but Atmel started life as a memory company. We made EEPROM memory, and soon branched into Flash memory. Vegard and his pal Alf Bogen (the “A” in AVR) met on computer forums while students at Norges teknisk-naturvitenskapelige universitet, also called NTNU, or the Norwegian University of Science and Technology. They saw the need for a microcontroller based on Flash memory, which you could reprogram as many times as needed, even when it was in-circuit.

Vegard-Wollen_holding-AVR-Masters-thesis

AVR inventor Vegard Wollan holds his Master’s thesis from college that began the AVR MCU architecture.

This was at the time where development engineers had to buy expensive ceramic package microcontrollers with a quartz window. You would program the part with your Data IO programmer, and when you had to make any change, you took the part out of its socket and put it in an ultraviolet eraser for 20 minutes. Savagery.

So Vegard and Alf pitched their MCU design to Atmel, who immediately saw the great potential in it. Atmel had already started to make 8051-style MCUs in the Colorado fab facility, which we had just purchased from Honeywell. One great thing about those parts was most instructions executed in one cycle instead of the 4 to 12 that the original 8051 needed.

So when Vegard explained the AVR was a RISC (reduced instruction set) machine designed to execute instruction in one cycle, it was music to Atmel’s ears. You could say that AVR was RISC before RISC was cool. And, it explains why AVR has passionate followers just like ARM-core RISC chips also have passionate followers… I guess that explains why Atmel makes 8- and 32-bit AVR chips, as well as a whole line of Atmel | SMART ARM-based chips.

The other cool thing that this video touches upon is how AVR chips were designed to run C programs well. You might remember the early days, when Intel would make whatever hardware people thought was cool and Microsoft would program in ways that software people thought was cool. Things didn’t always line up. I remember how you had to do a software reboot to take a 80286 out of protected mode, or that “thunking” in Win 95 to switch between 16- and 32-bit.

Vegard is a Renaissance Man that understood the hardware implications of good software design. So he made sure that C code would compile superbly into AVR assembly language. My buddy Wayne Yamaguchi routinely writes C programs for AVR that compile down into a few hundred bytes. AVR is one of those magnificent examples of computer science, not computer “slap this together and push this out so we can sell it”.

Like all Norwegians, Vegard is incredibly modest about his contribution. He credits his co-founder, and the team at Atmel that developed the AVR. But you just have to look at the billions of AVR chips that Atmel has sold to see what a remarkable thing Vegard created. Check out the video and stay tuned for the next installment.