Basic AVR Breadboard set-up

From ProjectPages
Jump to: navigation, search

Programmer

In order to start using the AVR micro it was necessary to build a programmer.
Always keen to use the quickest route I chose to use the Serial Programmer from Electronics-DIY.com

Serial Programmer

Breadboard

I then just plugged the micro into the breadboard. It only needed the 5v Regulator, and the programmer and chip were talking! In order to get some output, I bought this 4-line LCD from EBay and, hey presto, I can get feedback from my programs.

ATMega8 Breadboard

Having looked at the photo I decided that the breadboard needed re-wiring. Really pleased with the result. So much easier to see the wiring now and much less likely to pull something out by accident! The wires that seem to go nowhere are to attach my serial programmer.

ATMega8 Breadboard - Re-wired!

Here is the schematic

ATMega8 - LCD Schematic

I am using a C library for the LCD from ScienceProg. You just do a tiny bit of editing in the lcd_lib.h program to define which AVR Port pins you are using and whether you are using 4 or 8 data lines.

//******************************************
#define LCD_4bit
//***********************************************

#define LCD_RS	1 	//define MCU pin connected to LCD RS
#define LCD_RW	2 	//define MCU pin connected to LCD R/W
#define LCD_E	3	//define MCU pin connected to LCD E
#define LCD_D0	0	//define MCU pin connected to LCD D0
#define LCD_D1	1	//define MCU pin connected to LCD D1
#define LCD_D2	2	//define MCU pin connected to LCD D1
#define LCD_D3	3	//define MCU pin connected to LCD D2
#define LCD_D4	4	//define MCU pin connected to LCD D3
#define LCD_D5	5	//define MCU pin connected to LCD D4
#define LCD_D6	6	//define MCU pin connected to LCD D5
#define LCD_D7	7	//define MCU pin connected to LCD D6
#define LDP PORTD	//define MCU port connected to LCD data pins
#define LCP PORTD	//define MCU port connected to LCD control pins
#define LDDR DDRD	//define MCU direction register for port connected to LCD data pins
#define LCDR DDRD	//define MCU direction register for port connected to LCD control pins
.


I am using the Driving LCD demo project to show the progress bar running. The project is complete with the Makefile so I just edited that to suit my Breadboard and it was up and running.


My latest plan is to start experimenting with connecting the AVR via USB. I added a 12MHz crystal, but couldn't get the clock to run at that speed. After lot's of head scratching I went back to the datasheet and found I have an ATMega8L. The 'L' variant will not run faster than 8MHz. Time to get another AVR methinks! See V-USB Project.

What Next

Next idea is to turn this breadboard into a minimal Arduino using this method

I have designed a general purpose PCB so that the breadboard is freed up for new peripherals. Once I make this I will post pictures and circuit diagrams.

Links

Making PCBs at home
Youtube video of DIY Surface Mount
Another site for DIY surface mount
Making an ATTiny2313 into an Arduino