MY EXPERIENCE IN PROGRAMMING ATMEL AVR MICROCONTROLLER USING WINAVR/AVRGCC

INDEX
Introduction to Atmel AVR
Start programming atmega32
Makefile creation for winAVR
Atmel AVR programmer
Troubleshooting tips for BSD programmer and winAVR
Fuse Bits for Atmel AVR
LCD interfacing with Atmel AVR
H bridge L293D interfacing with Atmel AVR(DC motor)
Stepper motor driving with AVR
Key encoder(74922) interfacing with Atmel AVR
7 segment LED display interfacing with AVR
Digital IC tester with Atmel AVR micrcontrollers
Testing UART of Atmel AVR
RS-232 (serial port) interfacing of Atmel AVR
Hyperterminal of WindowsXP
Troubleshooting tips for Atmel AVR interface with computer
Serial port of computer interface AVR interfaced with LCD
Temperature measurement with Atmel AVR using LM35
Important Troubleshooting tips for Atmel AVR
Embedded Ethernet using Atmel AVR
Links about Atmel AVR



INTERFACING LCD WITH AVR MICROCONTROLLER

LCD used: JHD162A(see in my parallel port book for more about it)

 
hex file for lcd program for avr microcontroller(atmega series) lcd jhd162a interface for atmel avr microcontroller in zip file
     

This is the simple schematic without using backlight and contrast pins. Here control
pins are connected to PORTD and datapins to PORTA. See the figure below.

/*----------------------------------------------------------------
-------------CONNECTION BETWEEN LCD AND ATMEGA32-----------------
-----------------------------------------------------------------*/
#define DATA_DDR DDRA
#define DATA_PORT PORTA
#define CONTROL_DDR DDRD
#define CONTROL_PORT PORTD
#define Enable_Pin 6
#define RegSelect_Pin 4
#define ReadWrite_Pin 5
#define CONTROL_MASK 0X70
Here are the declaration I am using. Here CONTROL_MASK is used so that remaining pins can be used for other purpose. Change the port settings here so that you can use same code for all ports. When you program you should program in such a way that port pins are not wasted and same program can be used irrespective of ports. So do this at the beginning of the program for better understanding of the program and portability. Practice this when you do programming. Rest program remain same as that I had given my previous book for parallel port.