Tag Archives: Atmel AVR

Getting up close and personal with Atmel’s tinyAVR

So Atmel’s tinyAVR tech has been in the news lately, popping up in the Agent smart watch which recently debuted on Kickstarter and the uber-cool ShuttAVR mod for cameras.

As previously reported on Bits & Pieces, the Agent smart watch combines the SAM4S and tinyAVR MCUs to provide extended battery life – consuming less than half the power of competing platforms. Essentially, the tinyAVR MCU handles maintenance tasks and events while the ARM-based SAM4S deals with the operating system and related apps. This combination optimizes power use and enables the larger SAM4S microcontroller to remain in sleep mode for as long as possible.

Meanwhile, “balthamos89” used the versatile AVR ATtiny25 to help build the ShuttAVR,  a device which allows cameras to snap pictures at precisely defined intervals.

“I happened to have some AVR ATtiny25′s lying around, so I popped open the IR remote for the camera and poked around a bit. Though, I poked around a bit too much and ended up with a broken IR remote,” he explained.

“Determined, I ripped out the old chip and soldered a new switch. I had to add in code for handling the IR signaling, but I ended up with a functioning remote. Not only that, but it had intervalometer capabilities as well.”

So let’s take a closer look at Atmel’s tinyAVR technology which resides under the hood of a growing number of cool devices these days.

First off, all tinyAVRs are based on the same architecture and compatible with other AVR devices. Features like integrated ADC, EEPROM memory and brownout detectors allow users to design applications without adding external components. tinyaAVR also offers up flash memory and on-chip debug for fast, secure, cost-effective in-circuit upgrades.

“The tinyAVR offers an advanced combination of miniaturization, processing power, analog performance and system-level integration,” an Atmel engineer explained. “Simply put, the tinyAVR is the most compact device in the AVR family and the only device capable of operating at just 0.7V. And there’s nothing really tiny about that. Plus, tinyAVR designs can be coupled with Atmel’s CryptoAuthentication tech for an extra level of security against hackers and cloners.”

It should also be noted that the smallest tinyAVR measures only 1.5mm x 1.4mm. This  means makers, modders and engineers can all employ the tinyAVR as a single chip solution in small systems – or use it to deliver glue logic and distributed intelligence in larger systems.

“The AVR CPU gives the tinyAVR devices the same high performance as our larger AVR devices,” the engineer continued. “Flexible and versatile, they feature high code efficiency that lets them fit a broad range of applications.”

As expected, tinyAVR offers a high level of integration, with each ping boasting multiple uses as I/O, ADC, and PWM. To be sure, even the reset pin can be reconfigured as an I/O pin. Oh, and yes, the tinyAVR also features a Universal Serial Interface (USI) which can be used as SPI, UART or TWI.

On the power side, where most microcontrollers require 1.8V or more to operate, the tinyAVR boosts the voltage from a single AA or AAA battery into a stable 3V supply to power an entire application.

So if you do use tinyAVR tech in your next maker, hacked, modded or industrial project, be sure to drop us a line and let us know! In the meantime, additional information about Atmel’s extensive tinyAVR lineup can be be found here.

KLBasic for Atmel AVR MCUs

Like many of you, I have fond memories of BASIC, a nifty acronym for Beginner’s All-purpose Symbolic Instruction Code. Back in the early 90’s I wrote a couple of RPG fantasy text games in the language on my (286) PC, complete with color changes (on a black background) and rudimentary speaker beeps. Ah, those were certainly the good old days, well, at least for me.

But I digress. Yes, BASIC has been around for a long time and doesn’t appear to be going anywhere due to its rather obvious nostalgia factor. Recent versions (and there are many) include QB64, Bywater BASIC, Gambas, FreeBASIC, PureBasic, Power BASIC, RealBasic, True BASIC, Quite BASIC, Small Basic, RFO BASIC and Mintoris Basic.

Unsurprisingly, there is even an iteration of the wildly popular language – dubbed KLBasic and written in C – for Atmel AVR microcontrollers.

“My BASIC is a C rewrite of Gordon Doughman’s assembly language program. When I started work on KLBasic, I was trying to solve what I saw as a long-standing problem. I did not have a target-resident tool for working with MCUs that provided immediate feedback and interaction with the low-level parts of the device,” explained KLBASIC creator Karl Lunt.

“There are variants of Forth, of course, and I have done some work with amforth for the AVRs. Very much low-level, but I also wanted a tool that was friendly for beginners, and Forth can have a steep learning curve. Frankly, I have very fond memories of tools from decades ago, such as TinyBasic, Radio Shack’s TRS-80 Model 100, and QuickBasic. Those tools started my interest in microcontrollers, which has not slackened yet. Perhaps KLBasic or some variant of it will inspire a new generation of kids to get started with MCUs.”

According to Lunt, the goal of KLBASIC is to hand the community the source code for a working, target-resident interpreter/compiler for a simple language. Lunt also said he hopes others will build on his work, taking the design in new directions and adding new features along with improvements.

Interested? You can find the source files for the core (target-independent) routines here and the source files for AVR target implementation here.

Oh, and yes, you may also want to check out this Arduino-BASIC interpreter created by Usmar A. Padow, which includes an LCD, (PS/2) keyboard and SD card.

Running a GUI window manager on an ATMega1284p microcontroller

I have a confession to make. Yes, I must admit that I’ve never thought of running a home-coded GUI window manager on an ATMega1284p microcontroller.

But that’s exactly what Andrew Rossignol did when he designed a Window Manager for an AVR microcontroller.

“I have been experimenting with a uVGA-II VGA controller for the past couple of weeks. It is an amusing piece of hardware that is capable of drawing graphics onto a VGA framebuffer,” Rossignol explained in a recent blog post.

“The VGA controller takes care of line drawing algorithms and helps to hardware accelerate the drawing of geometric primitives (squares, circles, triangles, polygons, lines). Once I realized the power of this hardware I decided to implement a window manager like you would expect on any standard desktop PC, [running] a mouse for user input to the system.”

At this point in time, the default system boots with three applications: Theme Manager, Audio Player and Window Factory. The Theme Manager is used to modify the colors of the system theme, the Audio Player to stream audio files stored on an SD card and the Window Factory to create new windows.

Software? Check out the infographics below for a quick breakdown.

Hardware? Just the basics – an ATmega1284p microcontroller, a uVGA-II VGA controller, a MAX233 level converter and a Microsoft Serial Mouse.

“I have maintained a Git repo on my laptop containing all of this code, [although] I am not 100% happy with it yet. I need to work on the UART driver some more and polish up some documentation before uploading it,” Rossignol added.

Having fun with Atmel’s AVR32 microcontroller

We all know that Atmel’s versatile AVR32 microcontroller lineup can be used for a wide range of serious applications.

But what if you wanted some R&R time with the microcontroller? As the program Joshua, programmed by Professor Falken in WarGames famously asked: “Shall we play a game?”

I know I would. And although playing “Global Thermonuclear War” with a link to WOPR is probably not an option, there are at least two other titles that are – as you can see in the videos below.

The first game lacks sound (the audio track is obviously overlaid), although it is definitely fun to watch. The second – Space Pong – is somewhat more interactive and does appear to boast real-time audio.

What’s that you say? Digital games simply aren’t your thing? Well then, how about a nice physical game of chess with the ATMega32-powered Buttercup?

Atmel @ the Silicon Valley Maker Faire – Sarge the home patrolbot

So the 2013 Silicon Valley Maker Faire was held this past weekend in sunny California, with Atmel’s microcontrollers taking center stage in many creations, both big and small.

Although it is practically impossible to list all the devices at the Faire with Atmel microcontrollers under the hood, we’ll be taking the next few days to highlight a number of projects we came across while walking the rather expansive Faire grounds.

In this article, we’ll offer up a closer look at Sarge the home patrolbot, designed by the RoboRadix crew. Sarge’s basic function is to roam around a home or apartment, deftly avoiding pesky obstacles and keeping an electronic eye on things when its owners are out and about.

Currently, the good Sarge is a work in progress, but we were able to get a basic rundown from the folks at the Faire. Unsurprisingly, the ‘bot is built around the versatile Arduino UNO (ATmega328) or MEGA (ATmega1280), both of which are powered by Atmel microcontrollers.

Additional specs include two 12 Volts DC motors from an old lawn mower, a Linksys wireless IP camera, one Piezo Buzzer, two 12 Volts DC motors from an old lawn mower, one Pololu dual VNH5019 motor driver shield, one ultrasonic range sensor, two Sharp IR distance sensors, one Breadboard and power supply, one DC/DC power supply single Output 3A 15W 5-pin, one Power-Sonic 12V SLA battery and two 9V battery holders and 9V battery.


Oh, and yes, a special shout-out to the cool R2D2 unit (courtesy of Camp Peavy and their home-brewed robots) that was sharing the same exhibit table as Sarge. Sorry Sarge, we didn’t mean to make you feel inadequate, but we just couldn’t pass up the opportunity to gawk at our favorite Star Wars droids.

Atmel’s AVR ATmega644 powers this 8-bit retro gaming console

Written by Andreas Eieland

Do you remember reading comic books while waiting for your Amiga 500 to load the latest game, or the joy you felt when the first 8-bit Nintendo hit the streets?

© Bill Bertram 2006, CC-BY-2.5

I still do, and nostalgically remember a time when many of the games and hardware were simpler (streamlined), easy to understand and mod. I guess I’m not the only one who appreciates that the Amiga was equipped with sockets for the biggest components, making them easy to swap in and out.

Clearly I am not alone with my nostalgic thoughts, as a couple of years ago we had a “retro data party” at the Atmel office and people showed up with all kinds of old, dusty machinery. After drinking some beers and borrowing some components from our apps-lab we had almost all of them working and playing our old favorite games.

Now there is someone who has taken this concept a bit further with the creation of an open source 8-bit retro minimalist game console which is based on an Atmel’s AVR ATmega644.

The project is called the UZEBOX. It is easy to put together if you do not want to build the hardware from scratch, and uses a split software approach where sound and video generation are background tasks. Meanwhile, the games end-users develop in C exploit the complete interrupt system and numerous other resources. They have over-clocked the CPU “slightly” from 20 to 28MHz, but at room temperature, and not used in a life critical application like an airbag controller or Airline autopilot, this is really not a big deal.

As you can see above, there are several videos of the games on YouTube, and the UZEBOX crew even has a game design coding challenge going on right now.

Evil Mad Science and Atmel at the 2013 Maker Faire

Many Atmel employees will be at our Maker Faire booth this weekend. I will be there both days and open-source guru Eric Weddington has flown in as well. The Atmel booth is right next to the Arduino booth, so we should be easy to find. Be sure to bring your sun hats and sunscreen since many attractions are outside and it is easy to get burned.

I also wanted to give a shout out to my pals Lenore and Windell from Sunnyvale kit maker Evil Mad Science. We met at the eFlea and I have visited their shop. I have bought two Alpha-5 clocks from them, knowing that the super-accurate real-time-clock combined with an Atmel processor will keep precise time.

I went to an open-house they had last year, and got these snaps. Be sure to visit their booth and check out their really cool kits. Here are some pictures:


Here is Windell showing off his latest project— The Digi-Comp, a ball-bearing operated mechanical computer.


Evil Mad Science does not re-sell cheap imported junk. They design, test, and package their kits right here in Silicon Valley.


Here are just a few of the kits Evil Mad Science sells. They all have great style, panache and entertainment value.


Every engineer needs a powerful CO2 laser cutter.


I wanted to show Windell’s bench, since we all can relate. Even young guys like Windell need microscopes to work on modern electronics.


They have this awesome CNC router at Evil Mad Science. That is one of their motion-sensitive LED panels on the bed. You wave your hand over it, and the lights modulate.


Here is a close-up of the light panel. I am pretty sure they use Atmel chips in it.


Typical Maker—Windell spent months designing and perfecting this custom cabinet, rather than buying some chipboard stuff from Ikea.


Here is Lenore, the co-founder of Evil Mad Science. She is holding up my pal Ron Quan’s new book on building your own transistor radio.


And here is Ron, who came down to the open house at Evil Mad Science because he is a maker as well as a brilliant engineer with 65 patents and membership in SMPTE, IEEE, and the AES.

Hope you like the peek inside Evil Mad Science. I will be writing up experiences at Maker Faire as well as keeping you up to date on Ron and Atmel and my other pals.

Hardware Innovation Workshop kicks off the run-up to Maker’s Faire

Maker’s Faire can probably best be described as the ultimate DIY electronics show. Held at the San Mateo County Fairgrounds, the event is a huge science fair for the general public, where Do-It-Yourselfers take center stage and roam around unleashed (usually on their segways), wearing propeller beanies and flashy LED pins.

Atmel will be attending the festivities, so be sure to check us out at booth #625 where we’ll have MakerBot demos and an “IoTorium” – an emporium of awesome Internet of Things devices. We’ll also be showcasing PuzzleBox’s brain-controlled helicopters, alongside the cool riders from Faraday Bikes, smart watches and hackable Hexbugs.

In the meantime, we thought you’d enjoy a quick rundown of the Hardware Innovation Workshop, which kicked off the Maker Fair festivities last night. A number of startups were on the premises showing off their impressive wares, including Spark Devices, Dash Robotics, Nano Satisfi and Lockitron.

The Spark Core is an Arduino-compatible, Wi-Fi enabled, cloud-powered development platform designed to simplify the development of Internet-connected hardware.


The device, which recently tipped up on Kickstarter, managed to hit its initial funding goal within 75 minutes and has thus far raised $276,420 – with 17 days to go.

Meanwhile, Dash is the world’s first foldable, programmable, origami robot that you can build yourself. Inspired by nature, the lightweight Dash runs like the world’s fastest animals and fits in the palm of your hand.


NanoSatisfi strives to offer affordable access to space exploration with the baseline ArduSat (Arduino – satellite). Essentially, Nano Satisfi is the first open platform allowing the general public to design and run their own space-based applications, games and experiments – all while steering onboard cameras and snapping pictures.


The baseline model of the satellite uses Arduino Nanos mounted on a custom PCB, although the NanoSatisfi crew is also eyeing the most recent Arduino models like Leonardo, Due and Megas.

And last, but certainly not least, the aptly named Lockitron allows users to secure their doors from anywhere in the world with their smartphones, while allowing instant access to be shared with family and friends via a two-button app.


Lockitron can be controlled by API endpoints, or programmed directly thanks to its Arduino-compatible ATMega microcontroller.

Achieving a secure lockdown with Atmel’s ATSHA204

Despite its obvious importance, security often takes a backseat when it comes to designing a device or electronic component.

Perhaps one of the most shocking examples of security failure in the electronic world was highlighted last year during the Black Hat conference when a hacker demonstrated how he used a simple microcontroller to compromise hotel room doors by accessing 32-bit keys.

Unfortunately, the above-mentioned breach is hardly an isolated incident, as hacks for poorly secured hardware can be found swirling around the internet ether where they are routinely bought and sold by less-than-savory elements.

While it may seem somewhat daunting, securing a device can be made easier with an optimized authentication chip like Atmel’s ATSHA204 which includes a 4.5Kb EEPROM. This array can be used for the storage of keys, miscellaneous read/write, read-only, password or secret data. As expected, access to various sections of memory can be restricted in a variety of ways, with the configuration locked to prevent changes.

The chip also boasts a number of defensive mechanisms specifically designed to prevent physical attacks on the silicon itself or logical attacks on the data transmitted between the chip and the system. Plus, each ATSHA204 ships with a unique 72-bit serial number. By using the cryptographic protocols supported by the chip, a host system or remote server is able to prove the serial number is authentic and not a copy.

In addition, the ATSHA204 is capable of generating high-quality random numbers and employing them for any purpose, including usage as part of the crypto protocols of the chip. Access to the silicon is granted via a standard I²C interface at speeds up to 1Mb/sec. And last but certainly not least, it is compatible with most UART or serial IO controllers.

So that’s the physical spec rundown, but what about specific attacks ATSHA204 is designed to shield against? Well, the authentication chip is capable of helping to protect devices from a variety of nefarious threats, including algorithmic, protocol, microprobe, environmental, timing, bug, dumpster diving, emissions, fault and power cycling.

Meanwhile, a secure boot system prevents unauthorized modification of host firmware and protects against hackers enabling extra features without payment. And last, but certainly not least, the ATSHA204 helps thwart illicit system copies, piracy and code reverse engineering.

So while securing a device may seem like somewhat of a daunting task, especially in the face of so many critical threats, Atmel’s ATSHA204 is a comprehensive hardware-based solution that offers full applications support for both AVR and ARM systems, while helping to streamline and optimize the lockdown process.

Arduino-powered environmental sensors deployed at Google I/O

Google has teamed up with the O’Reilly Data Sensing Lab to deploy hundreds of Arduino-based environmental sensors at its upcoming annual I/O conference.

Using software built with the Google Cloud Platform, Mountain View will be collecting and visualizing ambient data about the conference, including temperature, humidity and air quality – all in real time. Altogether, the sensors network are slated to provide approximately 4,000 continuous data streams over a ZigBee mesh network managed by Device Cloud by Etherios.

In addition, the Arduino-powered sensors will be capable of detecting fluctuations in noise level, with some attached to footstep counters in an attempt to analyze and understand collective movement around the conference floor.

“As a key goal of Google I/O is to promote innovation in the open, the project’s Cloud Platform code, the Arduino hardware designs, and even the data collected, will be open source and available online after the conference,” explained Michael Manoochehri, Google Developer Programs Engineer.

“Networked sensor technology is in the early stages of revolutionizing business logistics, city planning, and consumer products. We are looking forward to sharing the Data Sensing Lab with Google I/O attendees, because we want to show how using open hardware together with the Google Cloud Platform can make this technology accessible to anyone.”

With the help of the Maps DevRel team, Google will also be displaying visualizations of trending data on several screens around the conference. Meanwhile, members of the Mountain View’s Data Sensing Lab are scheduled to be on hand in the Google I/O Cloud Sandbox to show off prototypes and talk to attendees about open hardware development.

As previously discussed on Bits & Pieces, Atmel microprocessors are the chips of choice for the Arduino platform, both in their AVR flavor and ARM varieties. Arduino has democratized hardware in a way that allows anyone – young or old, engineer or not, rich or poor – to create anything they can imagine.

As Arduino’s founder, Massimo Banzi puts it, “You don’t need anyone’s permission to create something great.”