|
Research & Learning Class pages
Shop Admin
ITP Help Pages |
Arduino BreadboardOverviewThis tutorial is about building an Arduino compatible breadboard with an ATMEL8 AVR microcontroller and FTDI FT232 breakout board from Spark-fun. The two skematics this is based on are here and here created June 2, 2006 by Carlyn To do this, you'll need:Basic Parts for wiring up Arduino
Parts for wiring up USB communication with computerHere you have 2 options, the slightly cheaper build your own breakout board and USB connector option, or a ready made adapter from Spark Fun. We don't have the ready-made adapter yet, but we will follow up with that when we get it Option 1:This is the option we are using in the below tutorial and it involves surface mounting the FTDI Chip on the the board yourself and making a little adapter for the USB connector because they are really annoying to hand solder directly on to wires...
Option 2:
Step 1: Power the boardIf you've already worked with microcontrollers, it is likely that you already have a preferred way to wire up a power supply to your board, so go ahead and do it that way. In case you need some reminders, here are some pictures of one way to go about it. (We are going for a 5V regulated power supply)
Add the 7805 power regulator and the lines to power the board. The regulator is a TO-220 package where the in-line from the external power supply goes in on the left, ground is in the middle and the 5V out is on the right (when facing the front of the regulator). We're putting lines across the board to have a little more room for our power supply down the road. You should also add wires to both side-strips of the breadboard leading from the rows that are the "ground" and "out" of the power regulator.
These capacitors and power regulator aren't strictly necessary if you're only ever going to power the board from the USB port. They are convenient to have in place just in case you need to wire up a motor or are running a program that doesn't need to be actively communicating with the computer, etc.
Here there is an LED to signal that the board is getting power on the bottom left. Some people like to power the led across the foot of the board so you can see that both sides are wired up correctly.
Now that the power-basics are done we are ready to load on the chip!
Step 2: ATMEGA8 BasicsLike other microcontrollers, the AVR chips also need that trusty 10k Ohm resistor "up" (to power) on their master-clear / reset pin in order to prevent the chip from resetting itself during normal operation. The RESET pin reboots the chip when it is linked to ground. We are going to use that feature later, but for now we just want the chip to run steadily so we hook it up with a high-valued resistor to power.
Basic power and ground lines. You can get more information from the Summary Datasheet or the 300 page Long Version
16 MHz external clock with two 22 pF capacitors running to ground.
The chip I'm using on this board is actually already programmed using the blink_led program that comes with the Arduino software. If you already have an Arduino printed circuit board running it is a good idea to go ahead and check the breadboard version you are building with a chip you know works. The blink_led program blinks pin 13. Pin 13 on the Arduino is NOT the AVR ATMEGA8-16PU pin 13. There is a nice little picture of the Pin Mapping on the Arduino site.
At this point if you had already programmed your chip somewhere else and didn't need this breadboard circuit to reprogram the chip, you could stop here. But part of the fun is in-circuit programming so keep going to really make a full USB-Arduino-circuit on a breadboard!
Step 3: Arduino-ReadyThis is where we take advantage of the RESET pin as the way to prepare the chip to recieve a new program from the Arduino sotware. In this step we add a little momentary button and hook it up so that when it's pressed the RESET pin gets exposed to ground. The chip then reboots and listens for any signal being sent to it via the USB port that might represent a new program.
Here we've already gone ahead and mounted the surface mount chip on the spark-fun breakout board listed in the materials, stuck it into the breadboard and added the power and ground lines. You can look at the FT232R Datasheet. The pins down the left of the breakout board are conveniently the pins down the left of the chip as pictured in the datasheet.
Here we connect the AVR ATMEGA8 RX (pin 2) to the FT232 TXD (pin 1) and the ATMEGA8 TX (pin 3) to the FT232 RXD (pin 5)
Now take your USB socket and put it on the board. You will definitely want to check the data sheet of any USB socket you buy to make sure you know how the pins line up because they are determined by industry standards. The USB cable is going to put power out where it puts power out, not where you decide to put the red wire! In the "Type B" kind we use it goes kinda like this.
So once you get your USB port straightened out - you can connect it to the FTDI 232RL like this:
You may find that you have to run this breadboard version of things directly from the computer or a well powered hub.
And there you have it... ready to be plugged in, powered up and programmed!
|