Categories
Uncategorized

Getting Started with the Atmega32u4 Breakout Board+

Atmega32u4 Breakout Board+

I’ve talked about Adafruit’s Atmega32u4 Breakout Board+ before, first in my post Teensy vs. Atmega32u4 Breakout Board+ and then in the post The Future of Open Source (Part II), so I figured I should actually get a Atmega32u4 Breakout Board+. (Also, I’m just going to call it the Atmega32u4 from now on.)

Now as far as AVR development, I’m a guy who doesn’t like to stray too far from the Arduino world, partly because I find it fun and comfortable, and it does most of what I’ve needed so far. That said, I did end up dabbling with the Teensy for The Button.

Don’t get me wrong, the Teensy is awesome for what it does, and what it is, but occasionally my open source bias takes hold and it bothers me (just a little bit) that the Teensy is not open source. Of course, Adafruit’s Atmega32u4 is open source, which gives it a few more points in it’s favor. Price-wise, the Teensy is $16.00 and the Atmega32u4 is $20.00. Consider it the “open source tax” if you will. (Or buy 100 of them and they’re only $16.00 each then!) (Update: Actually, the Teensy with pins is $19.00 and the Atmega32u4 Breakout Board+ with pins is $20.00, which is even closer in price. You can buy the Teensy without pins at $16.00 but you can’t buy the Atmega32u4 Breakout Board+ without pins.)

So with an Atmega32u4 in hand, and from the perspective of someone who used a Teensy successfully, here’s my review.

Atmega32u4 Breakout Board+ (Close-Up)

You’ll want to start with the Atmega32u4 product page. Without that, I’d still be watching a pulsating LED and swearing.

Read the section titled “Why not use a Teensy” and decide if you really want to use the Atmega32u4 instead. Done? Good. If you still want to use the Atmega32u4, continue reading!

The next section I’d call your attention to is the Using Teensyduino section. As I said, I’m an Arduino guy, so I wanted to give Teensyduino a try. Teensyduino is a software add-on for the Arduino IDE. It adds the ability to build and run sketches on the Teensy. If you don’t want to install avrdude or deal with command line stuff, this is another option. I’m not against using avrdude, but I wanted to try to parallel my Teensy experience, so Teensyduino was part of the toolchain.

I had already installed Teensyduino for use with the Teensy, so the section on that topic was where I jumped in. I walked through the changes, from editing boards.txt to restarting the Arduino IDE. It didn’t work.

But wait! There’s a line that says “Download the Arduino IDE from arduino.cc – as of this tutorial, IDE v21 works best – its not the latest one so scroll down to find it.” And yes, I’m running IDE v22. I’m not sure if that’s what broke things, but rather than download version v21 and try the edits again, I just grabbed the “ready to go” dmg that Adafruit supplied. Since I already had the Arduino IDE in my applications folder, I just renamed it to “ArduinoAtmega32u4” and ran it. It worked!

So the software installation/configuration part was a bit more difficult for the Atmega32u4 than for the Teensy, at first, but not much of an issue in the end.

Atmega32u4

So here’s a simple blink sketch, slightly modified from one that worked with the Teensy. The one issue with the Atmega32u4 is that you need to press the reset button on the board before you upload a sketch. Each time. Adafruit mentions this, so it’s not a surprise, but you just need to remember to do it. If you use a Teensy or an Arduino all the time, you might forget.

Atmega32u4

So the next test was to make the Atmega32u4 emulate a USB keyboard, just like the Teensy can do. You’ll need to change the menu options, but besides that, it worked well. At this point, with everything working, the differences between the Teensy and the Atmega32u4 seem pretty minimal. Granted, I’m not doing anything complex here, but it’s good to know that I could easily swap out the Teensy for the Atmega32u4 in some situations.

Here’s the code I used, which prints a space, similar to what the Teensy does for The Photo Booth:


void setup() {
  Serial.begin(9600);
  delay(4000);
}

void loop() {
  // Your computer will receive these characters from a USB keyboard.
  Keyboard.print(" "); 

  // typing too rapidly can overwhelm a PC
  delay(2000);
}

So now that I’ve got an Atmega32u4, and know what it can do, the only thing left is to let the hacking begin! :)

Categories
Uncategorized

The Future of Open Source (Part II)

Open Source

In our first piece, The Future of Open Source, I talked a bit about hardware, and touched on community, as well as mentioned a few specific companies. This time I’ll talk about specific pieces of hardware.

Let’s start with the Arduino. The Arduino is probably the most successful piece of open hardware. There’s an estimate of 300,000 Arduinos “in the wild” as it were, and if that does not count “official” Arduinos, I can see that number easily being double.

Recently Phillip Torrone published an article titled: Why the Arduino Won and Why It’s Here to Stay:

While it’s nice that Arduino is open source, and commercial use is allowed if you make a clone, it’s not the biggest reason, which is why it’s down near the end of the list. However, that isn’t to say it doesn’t matter at all. Specialized derivatives can be made without paying someone or asking anyone. It’s open source hardware so a company or school can use it without any per-seat licensing. There’s no risk that it will be discontinued and the software gone forever. If you want a new feature, you can spend the time and get it added. When thousands of people have a small stake in something, or ownership, they care more. Does anyone even debate if open source software is a good idea any more?

I think part of the reason the Arduino (and its clones) have flourished is due to the community built around it. Thanks goes out to the people who are really into doing things with Arduinos, and sharing their work with others, and helping out on the forums, and teaching classes, and basically connecting with others and evangelizing the Arduino platform.

The first Arduino I purchased was the “official” Arduino Uno, which I acquired from Adafruit Industries. I remember finding out about Adafruit from the web site ladyada.net, run by Limor Fried (Lady Ada) who runs Adafruit. The fact that she had shared so many project details online led me to her business, and I became a customer. My Uno is what I consider my “top of the line” Arduino, and I feel pretty confident that it will work with any shield I get, not have any weird quirks to work around, and that buying it supported the Arduino project. Chances are when a new “official” version of the Arduino comes out, I’ll but that one as well.

I do have other Arduinos, like the Boarduino, also purchased from Adafruit. I wanted another Arduino, at a lower cost, that I could dedicate to a project. It fit the bill, and supporting Adafruit was something I felt good about doing. I’ve also got a Diavolino, from the folks at Evil Mad Scientist Laboratories. As I mentioned in my blog post, The Diavolino comes in at about $13—less than half the cost of an Uno—though there are some compromises with the Diavolino. If these compromises don’t affect you, it’s a nice little Arduino board. And as for the folks at Evil Mad Scientist Laboratories, they’re pretty awesome, just like Adafruit, and I feel good supporting them.

Now we move away from the US and over to China. I’ve got two “Seeeduinos” from Seeed Studio. I know some people would prefer not to buy from China, and if these were cheap knock-off products from a questionable company, I’d agree, but Seeed Studio seems to be a pretty well respected member of the open hardware community. They were a sponsor of Maker Faire, they helped with the radiation detection project after Japan’s Fukushima incident, and they actually develop a number of innovative products. If all they did was make a cheaper Arduino, I probably wouldn’t be as supportive of their efforts. As it is, I think they provide some friendly competition for others in the Arduino space, and do plenty of other things to be a good citizen of the open hardware community.

I’ve already mentioned the Evil Mad Scientist Laboratories gang, and their Diavolino, but I’ll also talk about the Egg-Bot. I bought the Egg-Bot kit because I think it’s awesome. Here’s the description of it: “The Eggbot is an open-source art robot that can draw on spherical or egg-shaped objects.” See? Awesome! (I’m sort of a fan of art robots.) Now, the Egg-Bot is awesome, but it’s an open & shared kind of awesome. Every time I demo it, I explain to people that it’s an open source device, and you can download the software for free, and you can download the plans to build your own for free. I’ve see a SphereBot, a Completely printable Eggbot, a Fischer Technik Eggbot, and an EggBot Makerbot Attachment over on Thingiverse, as well as many Egg-Bot design files. (Heck, you could even make an Egg-Bot out of LEGOs.)

The point of all this is, the Evil Mad Scientist guys aren’t out to crush anyone who tries to make an Egg-Bot… they encourage it. They’ve grown a community of users who help each other out, sharing what they’ve learned along the way. This helps make people fans of Evil Mad Scientist Laboratories, and the Egg-Bot, and be more willing to support their future endeavors.

But hardware, just like software, and life itself, is often a compromise, consisting of grey areas, like the Teensy. While I used a Teensy for The Button, and it was perfect for it, I still hope to move to an open source alternative if possible. I covered most of this in my Teensy vs. Atmega32u4 Breakout Board+ post. I’ll get my hands on an Atmega32u4 Breakout Board+ and see how it stacks up against the Teensy for future projects.

So where does that leave us, and the future of open source? Personally, I see open hardware as a choice sort of like buying food. You can choose to support companies you know, like, and trust, and you can even go to the local farmer’s market and talk to the people who make the food. I hate to use the word “sustainability” (only because I think it gets overused) but I think it fits. A sustainable future through open source. Works for me…

Categories
Uncategorized

The Future of Open Source

Open Source

Open source software has been around for a long time, and I’ve been following it’s evolution for the past 10 years or so, and in that time I’ve seen it grow from a small idea known only to those in the software world, to something much larger, where everyday people like Aunt Tillie use open source software and think nothing of it.

In the past year since I’ve started working more with hardware, and following the great work of the Arduino team, Adafruit Industries, and others, I’ve seen the rise of open source hardware. Take a look at the Open Source Hardware (OSHW) Statement of Principles and Definition v1.0 and the Open Hardware Summit site for more info.

There’s a great comment by Chris Anderson, highlighted in this blog post at Adafruit. Here’s just a small excerpt:

This is the classic open source hardware model. Software, which costs nothing to distribute, is free. Hardware, which is expensive to make, is priced at the minimum necessary to ensure the healthy growth of a sustainable business to ensure quality, support and availability of the products. All intellectual property is given away, so the community can use it, improve it, make their own variants, etc.

Go there now and read the whole thing.

This got me thinking that eventually open source hardware could be more successful than open source software. If you remember the old concerns about open source software by the business folks, there was always the question of how you would make money from it. You can sell “Premium Editions” or make money by charging for support, you can hire yourselves out as consultants, and offer customized software solutions for customers… The ideas were plenty. Some worked, some didn’t. There were varying degrees of success.

I see open source hardware as pushing beyond that, taking the existing model and improving upon it. The software? Free. Open. Get it rolling, get the community involved, give it away to everyone. You should expect to make no money with software. Sure, it costs money to create software, but it’s a digital good, and making one copy or 1,000 copies has almost the exact same cost.

Hardware, on the other hand, is a physical good. It’s an object, a collection of parts, or things, not just bits of ones and zeros. Hardware costs money because someone, somewhere, assembled some real world thingamabob.

I don’t want to make it sound like hardware is better than software. They’re both equally important. They both need people to design them, create them, market them, and support them. The main difference is that creating 1,000 Arduino-compatible microcontrollers is going to cost more that creating 1,000 copies of the Arduino software. That’s just the reality of digital goods. Once you have one copy, making a lot more is cheap and easy. (And the shipping costs on digital goods are pretty close to zero. I say “pretty close” because there are server costs, bandwidth considerations, and other issues, but you’re not buying boxes, and packaging materials, and paying shipping companies to move goods.

As for the clones, well, that’s just a part of open source hardware, much the same way that an open source software package has forks of the original. Again, the difference is in the support, but support goes both ways. Since open source hardware vendors typically publish everything you need to make their products, you could certainly not buy from them and either build it yourself, or find a company that makes it cheaper. Cheaper is fine. I’m a fan of cheaper, but I’m also someone who believes in supporting those that create things and add value. If it all comes down to nothing but money, we’re pretty much doomed.

(Next time I’ll talk about specific pieces of open source hardware. See you then!)

Categories
Uncategorized

Teensy vs. Atmega32u4 Breakout Board+


Photos from Adafruit Industries.

I remember seeing the Teensy when I was digging into Arduino stuff last year, and it looked interesting, mainly due to it being small and cheap. (I like cheap!) But since I’m a lot more interested in what the Arduino has to offer, I didn’t look into the Teensy very much.

The Teensy is interesting though because out of the box it functions as a USB HID device, which means it can very easily emulate a keyboard or mouse. (See this Awesome Button post for a neat example.)

If you didn’t know, I’m a big fan of Adafruit Industries, not just for their amazing customer service and great products, but for their support of the open source movement, especially the work they’ve done with open source hardware. Adafruit actually sells the Teensy, but they also came out with a product called the “Atmega32u4 Breakout Board+” (terrible name, eh?) which is like a Teensy, but not like a Teensy.

Here’s where it gets weird… or interesting… or both…

By all respects, the Teensy is pretty cool, as I said, it’s small, and cheap, and can emulate a USB HID, and if your project needs that, it’s a good fit. See the Teensy page for more info.

Now, the “Atmega32u4 Breakout Board+” (terrible name) by Adafruit is similar but different. You can check out the Atmega32u4 Breakout Board+ page for more info.

Ultimately, I think I’d prefer to use the Atmega32u4 Breakout Board+ from Adafruit, and for a good explanation, see this Adafruit blog post about the Teensy, and for extra credit, see A Brief Essay About the Benefits of Open-Source Hardware.

It’s a shame the Teensy is not open source hardware, as I’d prefer to support vendors of open source hardware.

So I’ve got a project planned, and it will use a Teensy. So why not use a Atmega32u4 Breakout Board+? The first reason is, I don’t think I’m ready for it. In reading through the Atmega32u4 Breakout Board+ docs and digging through the forums a bit, it looks like Atmega32u4 Breakout Board+ development is not exactly easy for a beginner. I’d like to get into it at some point, but right now, the Teensy seems like an easier path to completing my project, and maybe once it’s done I can look into working with the Atmega32u4 Breakout Board+.

I know this may seem like a small thing, but I’d really like to support open source hardware when I can, the same way I try to support open source software when I can. It’s always a struggle.

Categories
Uncategorized

Developer Perspective

Swirly

I’ve come to realize that when I think about some tool I want to build, it’s typically driven by that “scratch your own itch” idea, where a developer does something because they want to solve their own problem. You’ll most often hear this idea attributed to open source software. Often my ideas come about when I think about who controls my data, or the software that I use. I tend to work towards maintaining my own freedom.

But there’s a whole other side… There are developers who develop something, and it’s not because a client hired them to, but because they think it’s a great idea, and sometimes they do follow the “scratch your own itch” idea, but they also think there’s a great money making opportunity worth exploring. Some developers within this realm are fine with creating something, and either selling it off, or letting it die if it “doesn’t work” or doesn’t become popular.

I’m not suggesting that one idea is better or worse than the other, it’s just an observation. I’m really interested to hear what others think…