You have no items in your shopping cart.

Subtotal: 0.00

AVR Development Board

The AVR Development Board is specifically designed to help students to master the required skills in the area of embedded systems. The kit is designed in such way that all the possible features of the microcontroller will be easily used by the students. The kit supports In-system programming (ISP) which is done through Parallel/Printer port.

ATMEL’s AVR (Atmega8535), AVR Development Kit is proposed to smooth the progress of developing and debugging of various designs encompassing of High speed 8-bit Microcontrollers.

LCD (Liquid Crystal Display)

Liquid crystal displays (LCDs) offer several advantages over traditional cathode-ray tube displays that make them ideal for several applications. Of course, LCDs are flat, and they use only a fraction of the power required by CRTs.

They are easier to read and more pleasant to work with for long periods of time than most ordinary video monitors. There are several tradeoffs as well, such as limited view angle, brightness, and contrast, not to mention high manufacturing cost. As research continues, these limitations are slowly becoming less significant.

Today's LCDs come mostly in two flavors---passive and active. The less expensive passive matrix displays trade off picture quality, view angle, and response time with power requirements and manufacturing cost. Active matrix displays have superior picture quality and viewing characteristics, but need more power to run and are much more expensive to fabricate.

Liquid crystal displays show great potential for future growth and improvement

Interfacing LCD

Fig. 1 shows how to interface the LCD to AVR Microcontroller . We can interface either 4x20 or 2x16 character LCD interface card which supports both 4-bit and 8-bit interfacing modes, and also facility to adjust contrast through trim pot. In 8-bit interface 11 I/O lines are needed to create 8-bit interface; 8 data bits (D0 – D7), three control lines, address bit (RS), read/write bit (R/W) and control signal (E).



Interfacing LCD

Fig. 1 Interfacing LCD to AVR Microcontroller

 

Interfacing LCD with AVR

We now want to display a text in AVR Development Board by using LCD module. AVR Development Board contains the LCD connections in a single header.

In AVR Development Board we use eleven number of I/O line from the controller to the to the LCD header to make it work properly.

Pin Assignment with AVR

 

HARDWARE PIN OUT

CONNECTIONS

OUTPUT

CONTROL LINES

Connect PORTA with JP8 (LCD)

via FRC Cable

Press RESET once

Adjust the POT R14(CONTRAST)

Right or Left until the letters are

visible

The Strings “16x2 LCD

demo...” and "ATMEGA DEV

BOARD" will be displayed on

LCD.

RS

PORTC.2

RW

PORTC.3

EN

PORTC.4

DATA LINES

D0

PORTA.0

D1

PORTA.1

D2

PORTA.2

D3

PORTA.3

D4

PORTA.4

D5

PORTA.5

D6

PORTA.6

D7

PORTA.7

 



Circuit Diagram to Interface LCD with AVR



Circuit Diagram to Interface LCD with AVR

Source Code

Here is the source code to interface LCD with ATMEL’s  AVR Microcontroller .The code is developed using CodeVision AVR Software Some delay is routines are called when a single command / data is executed to maintain the timing requirement for LCD. For more details on timing requirement see LCD datasheet.

C Program to display a text in LCD using AVR

***************************************************************************************

Title : PROGRAM TO DISPLAY TEXT IN LCD

***************************************************************************************

#include 

#include 

#include 

#define RS PORTC.2

#define RW PORTC.3

#define EN PORTC.4

#define CNTRL_PORT PORTC

#define CNTRL_DIR DDRC

#define DATA_PORT PORTA

#define DATA_DIR DDRA void LCD_init(void);

void LCD_cmd(unsigned char);

void LCD_dat(unsigned char);

unsigned char i;

const unsigned char Msg1[] = " 16x2 LCD demo..";

const unsigned char Msg2[] = "ATMEGA DEV BOARD";

void main()

{

DDRA = 0xff;

PORTA = 0x00;

DDRC = 0xff;

PORTC = 0x00;

delay_ms(100);

LCD_init();

delay_ms(200);

while(1)

{

LCD_cmd(0x01);

delay_ms(500);

LCD_cmd(0x80);

for(i=0;i<16;i++)

{

LCD_dat(Msg1[i]);

delay_ms(100);

}

LCD_cmd(0xc0);

for(i=0;i<16;i++)

{

LCD_dat(Msg2[i]);

delay_ms(100);

}

}

}

void LCD_init(void)

{

CNTRL_DIR = 0xFF;

DATA_DIR = 0xFF;

LCD_cmd(0x38);

LCD_cmd(0x0c);

LCD_cmd(0x06);

LCD_cmd(0x01);

}

void LCD_cmd(unsigned char cmd)

{

RS = 0;

RW = 0;

EN = 1;

DATA_PORT = cmd;

delay_ms(3);

EN = 0;

}

void LCD_dat(unsigned char byte)

{

RS = 1;

RW = 0;

EN = 1;

DATA_PORT = byte;

delay_ms(3);

EN = 0;

}

To compile the above C code you need the CodeVision AVR software. The software has it’s own IDE and built-in AVR gcc- Compiler. They must be properly installed and a project with correct settings must be created in order to compile the code. To compile the above code, the C file must be added to the project.

In CodeVision AVR software, you can develop or debug the project without any hardware setup. You must compile the code for generating HEX file. In debugging Mode, you want to check the port output without microcontroller Board.

The AVR Code Blaster software is used to download the hex file into your microcontroller through Parallel port.

Testing the LCD Module with AVR

Give +12V power supply to  AVR Development Board; Connect the LCD Module with microcontroller  AVR Development Board. When the program is downloading into Atmega8535 in Development Board, the screen should show the text messages.

General Information

☞For proper working use the components of exact values as shown in Circuit file.

☞Solder everything in a clean way. A major problem arises due to improper soldering, solder jumps and loose joints.

☞Use the exact value crystal shown in schematic.

☞More instructions are available in following articles,

User Manual for ATMEGA Development Kit

Create & Debug a project in CodeVision AVR.