Atmega16/32 Development Board With LCD

Introduction: Atmega16/32 Development Board With LCD

This instructable shows, how to do your own development board for Atmega16 or Atmega32 processors.The Internet is full of home made development boards, but I think that, there is room left for another one. This board have been very useful on my projects and I actually designed and made it to serve one of my project.

Step 1: The Circuit Boards

There is circuits from the both boards and the pdf-file contains print out files from these boards. You can etch your boards from these pictures. The zip-file contains all Eagle-files from these boards. Feel free to modify these how do you want.

Step 2: Etching or Milling

There is two ways to make these boards, etching or milling. I'm not a chemist, so I used the last option. I made my mill from these great instructables, so If someone have also nc-mill and want to use it for make these boards, just let me know and I will send the G-codes.

Step 3: Soldering

The picture on below will show the name of the component and where it should be on board.

Step 4: Testing

Before we can test our development board, we are going to need AVR-programmer cable. Here is good instructable about the programming cable. We need only 6 wires. SCK, MISO, MOSI, RST, Ground and +5V and that's why my connector have only 6 pins.

IMPORTANT! SCK, MISO, MOSI and RST signals needs 390 Ohm resistors which are usually soldered on board, but I wanted save some space from the board and that's why the resistors are inside the cable. Without these resistors programming won't work.

We also have to do a cable between rs232 module and the main board.

There is also couple "test wires" on the picture and these are really useful when we are going to test our board.

Step 5: Programming and Simple Test Program

Next we are going to need some "test" programs for testing our board. IMPORTANT! We have to disable JTAG from PORTC, if we don't do that, the lcd-module won't work, so it is necessary.

In Linux operating we can do it with avrdude command:avrdude -p m16 -c stk200 -U lfuse:w:0xe4:m -U hfuse:w:0xd9:m

This command disables JTAG and set 8Mhz internal oscillator up and use. Our board have external crystal, but people use different size of crystals, so this command is safe for all. If you wanna use your external crystal here is sitefor calculating correct fuses.

IMPORTATNT! Be careful with fuse programming. If you set wrong fuse values, your processor will be inoperative. There is a way recover it with external pulse, but let's hope that you don't have to do that =)

It is time to power up the board and send this little test program to processor with the winavr or what ever you wanna use.Now we can test that our ports works correctly. Put one end from the wire to the one of the leds pinhead and touch with the another end every ports spike step by step. The led should shine every time. If it not shine, then there is something wrong with the soldering. Remember test also that every led works.

Step 6: Testing Serial Port

If everything worked perfectly, it is time to test our rs232 module. There is a little program which testing that our TX and RX works.

Usage in Linux:

Create file called Makefile and copy below text in the file.The Makefile code assumes that you are using Atmega16 and your programming cable is stk200 Remember set correct permissions to your serial port /dev/ttyS0

Download atteched file serial.c and put it in the same folder where Makefile is.Power up your development board and put cable between rs232 module and main board. The leds on module should light now. Put test wire between PA0 pin and some of leds pin.Use your terminal and go to the folder where is test.c and the Makefile. Connect ISP-programmer to the board. Now it is time to send our code in the processor and it happens with terminal command: make

If everything works, it should write "works!" on the GTKterm screen when you press the "z" button and when you press "x" button the led on board should turn on and when you press "c" its should turn off.

Step 7: LCD-module Test

Now it is time to test our LCD-module. I attached a great software for controlling the LCD-screen. I downloaded the code from Scienceprog.com and modified it little. Program the processor with this code and plug your lcd-module on board.

LCD-module pin connections:

1 = VSS(Ground)2 = VDD(5V)3 = VO(Ground)4 = RS5 = R/W6 = E

11 = PC412 = PC513 = PC614 = PC7

My lcd-module contains 2 connectors(see the picture), because the text goes up side down if you put the module as it should be. I mirrored and glued new connector to other side. Now it works both ways.

Step 8: Some Videos

Comments

Great instructable ! I just purchased my new ATMEGA168 but can't seem to get it to load my first program .. I would be happy if you could give me a hand . I have the RS232 (MAX) adaptor connected to my PC and tested (loopback) . I just connected the VCC and GDM and tryed to send it a simple "blink LED" program with no sucsess . I assume when I buy a new deice it is set to internal clock (as in DS) . I assume it works by default in the RS232 in 9600 (8N1 - no hw ). Any tips ?