AVR Programming 03: Reading and compiling code

In the last installment of our tutorial series we built a simple circuit on a breadboard and programmed an ATmega168 to make it run. That proves that you know how to follow directions, but the eureka moments of doing everything yourself are on the way. This time around you will get down and dirty with the datasheet, learning where each line of the sample code came from, and give your recently installed compiler a test drive. We will:

  • Talk about bitwise operators and how they work when coding for microcontrollers
  • Discuss C code shorthand
  • Review the sample code from Part 2 and talk about what each line of code does
  • Learn to compile code

If this is the first you’ve heard about our AVR Programming series, head back to Part 1 and start from the beginning. Otherwise, take a deep breath and we’ll being after the break.

Series roadmap:

[Read more...]

AVR Programming 02: The Hardware

You may be able to write the most eloquent code in the history of embedded systems but without a way to run it on the hardware it will be worthless. In this installment of the tutorial series we will:

  • Look at some of the available AVR programmer options
  • Place the microcontroller on a breadboard and connect it to a power supply and a programmer.
  • Use programming software to send some example code to the microcontroller

If you missed Part 1 take a few minutes to review that portion of the tutorial and then join us after the break.

Series roadmap:

[Read more...]

Automated chip burning

[Alexsoulis] needed to burn the Arduino bootloader to a slew of ATmega328 chips. Instead of sitting there and plugged the chips into a programmer one at a time, he build a robotic microcontroller programmer.

It starts with the DIP package microcontrollers in a tube, with a servo motor to dispense them one-by-one. An arm swings over and picks up the chip with a fish pump powered vacuum tweezers similar to the pick-and-place head we saw recently. From there the chip is dropped into a ZIF socket and programmed by an Arduino. Once the process is complete it is moved to the side and the process repeats.

We’ve reported on using an Arduino as an AVR programmer but we’ve never actually done it ourselves (we use an AVR Dragon programmer). Take a look at the video after the break and let us know if you think the actual programming seems incredibly slow.

[Read more...]

TI makes a big bid for the hobby market

This morning Texas Instruments unveiled Launchpad, a development platform for their low-cost MSP430 line of microcontrollers. We’ve seen these chips before, most notably in the ez430 Chronos sports watch. We see this as a bid for the hobby market currently enjoyed by Arduino, PIC, AVR, and others. TI’s biggest selling point is price, but we’re going to wait to share that with you. Join us after the break to see what the package offers, then decide if the price is right.

[Read more...]

USB hub used for In System Programming

Did you order that 4-port USB hub because it was almost free but now it’s just sitting in your junk box? Why not turn it into an In System Programmer for AVR chips? [Paul] came up with HUB ISP as an answer to the chicken-or-egg problem we’ve seen with other diy programmers. It uses the data wires from four different USB cables to program AVR chips, enlisting the help of a 74HC00 NAND gate along the way. You do not need to have a programmed microcontroller as all the magic happens on the software end of things. The one caveat is that [Paul's] method currently only works on Linux machines.

USBasp: AVR programmer based on ATmega8

We love our AVR Dragon programmer but it can be nice to have a cheap and simple in system programmer on hand too. The USBasp is one such programmer that uses and ATmega8 as its only IC. It requires just a handful of components and can be purchased as a kit, or etched and assembled at home. If you source your own parts the chip does need to be programmed which makes for a chicken-or-egg scenario. We’ve used the Parallel-port dongle (schematic) from Adafruit’s Spoke POV before. It’s basically just a DAPA cable and a few resistors, a ribbon cable (use and old IDE cable if you have to) and a parallel port connector can have you up and running in no time. This is also a great way to get a friend into working with embedded systems. Order parts for a few of these and give them away to your buddies.

JTAG programming over a network

[Matt Evans] was running up against the common programming gotcha caused by disappearing parallel ports. For years he had used a JTAG parallel cable when working with FPGAs but recently realized he no longer owned any machines with that interface available. Instead of shelling out $50 for a USB programmer he a programming interface from an old router.What he’s doing is bit-banging using Linux. In this case it’s a router running a version of Linux which makes his setup Internet friendly but this could be done in the same basic manner on any Linux device with enough available I/O to connect to the device you are programming.