Learning to use the V-USB (AVR USB firmware) library

posted Feb 9th 2012 9:58am by
filed under: Microcontrollers

The V-USB library is a pretty handy piece of code that lets you add USB connectivity to ATtiny microcontrollers (it was previously named tinyUSB). But if you’ve ever looked into adding the library to your own projects you may have been stymied by the complexity of the code. There are many examples, but there’s a lack of a concise quick-start for the uninitiated. [Joonas Pihlajamaa] has been working to correct that shortfall with his four-part V-USB tutorial series. It’s not for the absolute newbie; you should already be comfortable working with AVR chips but that’s the only real prerequisite we can see.

He starts the series with a look into the hardware considerations. USB provides a 5V power rail but the data lines expect 3.3V logic so this must be accounted for. With the test rig built on a breadboard he moves on to pick apart the code, covering various user-defined variables that you’ll need to set based on your project’s needs. We’re going to keep this on the back burner and hopefully the Troll Sniffing Rat will get a makeover (although we must say comments have been a lot nicer as of late… keep it up!).

We’ve embedded links to all four tutorial parts after the break.

Read the rest of this entry »

So you wanna learn FPGAs…

posted Dec 30th 2011 1:11pm by
filed under: hardware, how-to

FPGAs are the bee’s knees. Instead of programming a chip by telling it what to do, FPGAs allow you to tell a chip what to be. Like everything though, a new skill set is needed to fully exploit the power of FPGAs. [Mike Field] decided to give back to the internet community at large and put up a crash course in FPGA design.

Right now, [Mike] has a couple of modules up that include subjects like binary math, busses, counting, and of course setting up the FPGA hardware. The recommended hardware is the Papilio One, although the Digilent Nexys2 is what [Mike] has been using so far.

We’ve seen a ton of awesome stuff that uses FPGAs, like the emulated Mac Plus, breaking HDCP, and an Ocarina of Time. [Mike]‘s tutorials look like a great starting point for some FPGA work. [Mike] is also looking for some feedback on his tutorials, so if you’ve got an idea of what he should cover be sure to drop him a line.

EDIT: The server was running on an FPGA and we can’t find a cache anywhere. If you’ve found a mirror, send a message. Apparently Amazon’s EC2 runs on an FPGA.




An introduction to stepper motors

posted Dec 1st 2011 8:01am by
filed under: how-to

If you’ve been reading Hack a Day for long enough, you know about our infatuation with stepper motors. These precious little devices put the oomph into our CNC routers, 3D printers, robots, and other miscellaneous projects. Steppers aren’t your run-of-the-mill motors, though. [Steaky] posted a great introduction to stepper motors that lets you hit the ground running building any moving project you could imagine.

Apart from identifying a stepper and figuring out if it works, [Steaky] goes over how to make these motors turn. The theory behind an H-bridge is easy enough, but theory isn’t something often presented in schematics or stepper driver datasheets.

We’ve pulled more than our fair share of steppers from flatbed scanners and old printers. There’s nothing wrong with scavenging old parts, and whether you’re making a robot band to play your kid’s birthday party, robochess, or one of the many 3D printers or CNC machines, there’s going to be a stepper motor in your future.

Beginner concepts: We’re gonna let you finish, but first this tutorial on Arduino interrupts

posted Nov 8th 2011 12:01pm by
filed under: arduino hacks, how-to

OK, year-old pop culture references aside [Kyle] dropped us a line to show us his tutorial on using interrupts with your Arduino. Given the single core nature of your average Arduino’s AVR you pretty much have two choices for monitoring occasional un-timed inputs: Either check an input at an interval (which risks missing the signal entirely) or set up an interrupt to pause the chip’s normal operation. Obviously working with interrupts saves you tons of clock cycles since you are not polling a pin over and over. [Kyle] plans on a follow up tutorial to cover timer based interrupts, which can come in handy when generating frequencies and stuff.

Looking for more Arduino Basics? How about Basic on an Arduino. Check out our other beginner concepts posts as well if you need to work on your fundamentals.

Video: Eagle CAD Layout

posted Sep 21st 2011 12:14pm by
filed under: news, video hacks

This week’s video is the last in a series of videos where we show how to use Eagle CAD. Today we will look a the Layout portion of the program and will create a circuit board from the schematic that we created previously. We start by creating a layout file and then moving all of the parts to appropriate places on the circuit board. After that, [Jack] shows how to route the traces. Along the way, he talks about the tools that he is using and various ways to use them. The end result is a prototyping board for the PIC18F44J11.

Like the others, this video is fairly long at 29 minutes, so make sure to have some time dedicated towards watching it if you do.

In next week’s video, we will be showing this board as it arrived to us from a manufacturer and will do a tutorial on how to solder.

If you have missed our previous videos, you can find them here:

Schematic part I
Schematic and Custom part creation
CAM Processor

We have also created many supplemental videos explaining how to use many of the tools in the tool palettes. You can find them on our Youtube channel:

Check out the video after the break!
Read the rest of this entry »




Build Your Own Class AB Audio Amplifier

posted Aug 14th 2011 8:00am by
filed under: how-to

[Dino Segovis] wrote in to tell us about his “hack”, making an AB Audio Amplifier. The advantage of this particular amp is that the transistors never turn off, which would cause distortion. A full schematic is given in the article as well as a parts list. A complete “bill of materials” makes any circuit building project easier, especially for the beginner.

Although this is by no means a new circuit design, (a similar setup is used in car audio equipment) [Dino] does a great job of explaining how things work in the article itself and in the video after the break. He also gives some great tips about transferring your drawn circuit to a breadboard in a neat and organized way at around 5:00 in the video. Read the rest of this entry »

Basic Animatronics Tutorial: PIC Based Servo Eyebrows

posted Aug 5th 2011 6:13am by
filed under: robots hacks

[Chris] writes in to let us know about his latest animatronics tutorial, this time on robotic eyebrows! The tutorial takes us through the process of using a fairly simple PIC  circuit to display various facial expressions. Since a wide array of facial expressions have unique and well understood eyebrow positions this simple hack can make even the most bland looking mask come to life . Animatronics is a subject near and dear to our hearts, but the simple actuation of servos can go much further than cardboard faces. This easy to follow tutorial can help you on your way to controlling all sorts of servo stuff like vent flaps or um…  fish, if you’d like. The software is not very deeply explained but it is commented and available for download from [Chris]‘s site.

From here [Chris] plans to expand the project with more tutorials that can help further animate the face. We are particularly interested in the one and two eye systems he mentions, as well as more complicated eyebrow mechanics. Also check out [Chris]‘s other servo based robotics tutorials like the Sharpie Spotifier and the Wooden Menace.

There is also a video of the eyebrows in action after the break.

Read the rest of this entry »

Understanding interrupts in PIC microcontrollers

posted Jul 26th 2011 5:01am by
filed under: Microcontrollers

Interrupts are the name of the game for more functional microcontroller firmware. [Rajendra] just posted a tutorial covering all of the interrupt types for the PIC 16F688 microcontroller. He gives an overview of all of the major points: what an interrupt is, what causes interrupts, how to read the datasheet (often overlooked) to set up interrupts, and finally he applies it to a test platform and a bit of code.

We’ve been playing around with an Arduino again over the weekend and are a bit frustrated with the restricted access to interrupts. That issue deals with AVR interrupts, a topic with which we’re already well acquainted. But we work with PIC hardware much less often and it’s fun to explore how the other half does things, both in hardware and in code.




Hack a Day serves up fresh hacks each day, every day from around the web as well as hacking related news.

Send us your hacks










     




Hacks

Resources