Microprocessors are so cheap these days. If only there were a way to program them up just as cheaply...
*wavy dream-sequence lines*
In this instructable, find out how to build up a complete AVR microprocessor toolchain: compiler, programmer software, programmer hardware, and some simple demos to get your feet wet.
From there, it's just a hop, skip, and a jump to world domination.
The endpoint is not quite as swanky as Atmel's suite, but it's gonna run you about $150 less and take only a little more work to get it set up.
This instructable is based on the Atmel ATtiny 2313 chip, mostly because it's one of the smaller chips (in size) while still being beefy enough to do most anything. And at $3 a pop (non-bulk), they don't break the bank.
That said, most of the steps are applicable across the AVR family, so you'll be able to re-use most everything when your programming needs outgrow the ATtiny and you reach for the $8-$12 ATmegas.
Update Aug 24, 2007: I've gone USB! It's neither ghetto nor particularly deluxe, but a nice middle ground. If you've got a computer without a parallel port, check this http://www.instructibles.com/id/EDRQZ56F5LD8KDX/ out.
If you've got a parallel port, or are just feeling cheap, read on!
Remove these ads by
Signing UpStep 1Go Order Parts!
Atmel ATtiny2313 chip: $2.50 - $3Socket for chip: $1Parallel port connector (DB25): $3 at Radio Shack or $0.95 at SparkfunHeader Pins: $1-$2 (at least one strip each male & female, maybe 2 female)Some LEDs and resistors: $1
= Around $10, even if you go deluxe. Half that if you can find an old parallel port cable.
Add-ons
A pushbutton switch or two: $1.
A piezo speaker: $1-$5
Light sensitive photocells: $2-$6
Breadboard for making complex circuits: $8-$10(?)
Other Stuff You Oughta Have
Computer: The older the better because it needs a parallel port.
Hookup wire, solder, soldering iron
Super-duper glue
Source of ~5v DC: Batteries will work, and old computer power supplies are perfect.
I get a lot of stuff from Sparkfun because they're
fast, reliable, and fairly priced. They carry AVR chips (but seem to be out
of ATtiny13's at the moment). They've got everything on the "Necessary"
list in one place, nice website.
If you're gonna be ordering a lot of chips, you can get a deal from Digi-key or similar. For instance: ATtiny 2313 for $2.36 each. They've only got 27,853 more in stock, so order quick. (Make sure you get the DIP form-factor.)
Go order stuff now, and we can set up the software side while you wait.
The waiting is the hardest part.
| « Previous Step | Download PDFView All Steps | Next Step » |
















































An LED with presoldered 1K resistor... or even a resistor built in to the LED it's self... extra just an idea
I have seen LED's that can flash, think I would also like to see LED's that have pwm built in based on voltage so they can be dimmed with only two pins. Or maybe tri colour LED's that cycle through thier colours according to voltage.
In the picture above, you shown PIN1= Reset.
In the listing, PIN1= SCK. PIN11 = Reset.
avrdude: verification error, first mismatch at byte 0x0000
0x12 != 0x00
avrdude: verification error; content mismatch
avrdude done. Thank you.
has anyone else had this problem?
Verification errors mean that the chip didn't get the data right. Check for loose connections here or there.
Also double-check the power supply that you're using for the chip. The chips draw power in a spikey, unpredictable way, and that sometimes can cause trouble. A simple solution that often works for me is to put a buffer capacitor across the AVR's power pins. That is, take a capacitor of moderate size (0.1uF to 10uF?) and connect the positive end of the cap to the AVR's VCC pin and the negative end of the cap to the AVR's GND pin.
The capacitor acts as a little rechargeable battery, smoothing out the AVR's power demands.
(Real engineers almost always start out with a buffer capacitor in their designs for reliability. I omitted one here b/c I'm cheap and I can usually get away with it. But you should try adding it if things go wrong.)
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Parport\Parameters]
"DisableWarmPoll"=dword:00000001
Paste the above into Notepad and saveas dapa.reg
then right click MERGE intos registy. Will save you lots of problems with using parallel ports under windows with AVRDUDE for instance.
thanks
Joseph
"A Direct AVR Parallel Access, or DAPA cable, is an incredibly simple and cheap programming method. You can build one very quickly for a few bucks worth of parts, but the convenience comes with a few gotchas. The first is that you must have a parallel port on your computer; something that modern laptop and some modern desktops don’t have. But if you’ve got an old PC around that has one this will get you up and programming in no time.
In fact, the first AVR prototyping I did was with one of these cables. That is, until I discovered another gotcha. This will only program low-speed chips. If you try to run the chip’s clock at full speed (by changing fuse settings… more in Part 3) you won’t be able to use a DAPA cable to talk to it any longer. There’s also the possibility of damaging your parallel port or worse if you do something wrong. But if you want to go for it anyway, here’s how I built mine"
I got this info from here: http://hackaday.com/2010/10/25/avr-programming-02-the-hardware/
Does this mean that if i modify the speed of the internal oscillator at the first programming, the programmer won't program the chip anymore?
Only some of the AVR chips have bootloader capability, though, so you should check the datasheet to make sure. I know the Mega88 does, for instance, but the M48 doesn't.
The Tiny2313 does bootload, but you'll want to use a small bootloader like this one: http://www.avrfreaks.net/index.php?module=Freaks%20Academy&func=viewItem&item_type=project&item_id=625
www.atmel.com/dyn/resources/prod_documents/2535s.pdf
I think I just 'fried' 2 attiny2313 :(
The only thing not quite equal from your instructable is that my led has the resistor (330r) on the + pin of the led, so i connected the ground pin of the led to ground and the other + resistor to PD4, then the avrdude stoped working, not recognizing the chip anymore...
What could have 'fried' my AVR????
Generally, it shouldn't matter whether the resistor is on the + or - side of the LED -- it limits the total current flow just fine in either location. Something else is going on...
Double-check your wiring? Do you have all the programming lines going to the right places?
Another possibility is that you've got flakey power supplied to the chip. The solution is to buffer the power supply. That is, place a 1uF - 10uF capacitor across the positcheap trickive and negative power rails, or even better across the Tiny's VCC and GND pins. This will smooth out voltage spikes in the power line that might be accidentally resetting your chip.
Can u please fwd ckt dig+c/hex file on suyog.mahajan14@gmail.com?
@brooklynlord
while programming getting 5V from the USB-Port is the most direct approach so I think you are talking about the running project.
well i only used atmega 168 till now but I think other chips work pretty much the same. You can power the chip with lower than 5V the only disadvantage is you can't run it at the same speed (less MHz). look at the datasheet of your processor.
ebay