Step 3: Breadboard it!

Hopefully you are following along. We are now going to put all of our pieces on the breadboard and get ready to go over the program.

This should take about 5 minutes.

I have included a schematic and a photo, but I will also talk you through it

1. Set up your power supply - a 7805 with a >5V power supply or battery pack. 100uF and 0.1uF capacitors are recommended to stabilize the input. See Schematic.
2. Place the ATtiny2313 on the board
3. Wire up the GND, +5V, and reset switch with the 10K resistor going to +5V and the switch going to GND.
4. Wire up the INT0 interrupt trigger switch from PORTD 2 to the switch with the 1K resistor from from the switch to GND. Also put the second 10K resistor from PORTD 2 to +5V so it's tied high until you hit the button. You can also parallel a small capacitor (0.1uF) across this to help debounce it.
5. Here's the smooth part, Place the LCD on the board so that the header pins on the LCD match up so pin 15 (LED backlight +5v) of the LCD plugs into pin 11(VCC +5V) of the ATtiny2313. This will line everything up nicely.  It's great because you barely have to do any wiring and all the LCD data pins are aligned with PORTB.
6. Then you will use jumpers to wire up the control lines from PORTD and put the 330 resistor from GND to pin 16 of the LCD (GND for backlight). Refer to the schematic.

I didn't show it but you will need to hook up your programmer as well. You should know the drill on that part. VCC, GND, SCK, MISO, MOSI, and RESET.

Take a look at the picture and schematic and get things wired up accordingly.

I have included the schematic with the code download on the Intro page in case you can't see it here.

<p>Thanks. I am still learning from this example, but I made a few changes to the code because 'A winner is you' was not showing up for me. I did not have a button so I just stuck a wire to ground.</p>
<p>Super instruction! I run it on ATMega48 with 1MHz because I want to build nAmeter. But I was encountered problems because I mess with wires 8 and 9 which goes from IC.. Be carefull with theese ones o_O!!! Anyway great instruction! 2 hours and all was working!</p>
<p>Hey! Great tutorial, I'm planning to use it for my 16x2 on an ATtiny84.</p><p>I got a question though, I got only 6 pins available for the LCD and I saw somewhere that it is possible to use only 6 pins.</p><p>That some of the data bits are not needed, is it true? How can I do it?</p><p>Thanks.</p>
<p>If someone need ASM code to be short as it can be then please upload modification of Roznerd code in ASM to display just &quot;Yo&quot;. I needed LCD for other purposes than Winner game and it would be spent of time to coppy Winner game. My code works on ATMEGA48 but as with Roznerd code, you can make it run on other AVR such as Attiny2313. Maybe you also must change call instruction to rcall if some AVR is not supported call. Good luck!</p>
<p>Also please delete &quot;call ledon&quot; line and ledon proc. It was just using for debuging code! Thanx</p>
Thanx man!, I'm new in all this electronic stuff but it's a great explanation....I'll try to do it soon. Cheers from Mexico
This would be perfect for using in a trivia type handheld game.
Love your instructions - you really helped me get going. Thank you. I ran into trouble a couple times though - I found some terrible avr-objcopy flags on some other website that stymied me for days. The AVRFreaks finally figured out the problem - I wasn't copying the .data section into the hex file! Would you consider adding a little section with an example Makefile or even a simple gcc/objcopy inline example so noobs like me don't make the same mistake again?<br><br>Also, I've taken what you taught me and created my own instructable:<br>http://www.instructables.com/id/AVR-LCD-Namebadge/<br><br>Cheers!
Thanks for the instructable. I''m trying to follow your instructions but I think there is a problem with the bottom two pinouts on the lcd diagram LCD_Schematic.png. Shouldn't one of those go to ground?
Thanks for the comment. Good Catch! The VSS is the GND pin and VDD is the +5V. I have updated the schematic in the ZIP and in Step 3. I hope you have luck getting it working. Thanks - Roznerd

About This Instructable




Bio: Mechanical Engineer
More by roznerd:DIY Cubicle Clips - Cheap and Easy How to use a 74HC595 Shift Register with a AVR ATtiny13 How to control a 16x2 LCD using an AVR ATtiny2313 
Add instructable to: