In this tutorial we are going to explain the steps for displaying custom characters on an alphanumeric LCD using the avr codevision compiler and interfacing LCD to atmega 16.
DOWNLOAD LCD CUSTOM CHARACTER BUILDER HERE
2- Select char0 and then in the green area draw your custom char as shown in the following figure :
3- Then select char1 and press generate code and you will find that a code is generated for char0 according to the character you draw in the green box in step 2 (you can make up to 8 different characters ) .
4- Copy the generated code (but dont copy the last comma in the code ) and past it in the following program :
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* the LCD is connected to PORTC outputs */
#asm
.equ __lcd_port=0x15 ;PORTC
#endasm
/* include the LCD driver routines */
#include <lcd.h>
typedef unsigned char byte;
/* table for the user defined character
arrow that points to the top right corner */
flash byte char0[8]={PASTE THE GENERATED CODE HERE};
/* function used to define user characters */
void define_char(byte flash *pc,byte char_code)
{
byte i,a;
a=(char_code<<3) | 0x40;
for (i=0; i<8; i++) lcd_write_byte(a++,*pc++);
}
void main(void)
{
// LCD module initialization
lcd_init(16);
/* define user character 0 */
define_char(char0,0);
/* switch to writing in Display RAM */
lcd_gotoxy(0,0);
/* display used defined char 0 */
lcd_putchar(0);
while (1) {};
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
In the above program it's assumed that LCD is connected to PORTC of Atmega 16 microcontroller and for more details on how to interface LCD to atmega 16 CLICK HERE
You can repeat this piece of program to display more than one character .
To see how can you display more than one character you can download the following code and it's simulation using proteus software.
Steps :
1- First we want to draw our custom character and convert it to the code to be send to the LCD . To do this we use a software called LCD custom character builder.
DOWNLOAD LCD CUSTOM CHARACTER BUILDER HERE
3- Then select char1 and press generate code and you will find that a code is generated for char0 according to the character you draw in the green box in step 2 (you can make up to 8 different characters ) .
4- Copy the generated code (but dont copy the last comma in the code ) and past it in the following program :
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* the LCD is connected to PORTC outputs */
#asm
.equ __lcd_port=0x15 ;PORTC
#endasm
/* include the LCD driver routines */
#include <lcd.h>
typedef unsigned char byte;
/* table for the user defined character
arrow that points to the top right corner */
flash byte char0[8]={PASTE THE GENERATED CODE HERE};
/* function used to define user characters */
void define_char(byte flash *pc,byte char_code)
{
byte i,a;
a=(char_code<<3) | 0x40;
for (i=0; i<8; i++) lcd_write_byte(a++,*pc++);
}
void main(void)
{
// LCD module initialization
lcd_init(16);
/* define user character 0 */
define_char(char0,0);
/* switch to writing in Display RAM */
lcd_gotoxy(0,0);
/* display used defined char 0 */
lcd_putchar(0);
while (1) {};
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
In the above program it's assumed that LCD is connected to PORTC of Atmega 16 microcontroller and for more details on how to interface LCD to atmega 16 CLICK HERE
You can repeat this piece of program to display more than one character .
To see how can you display more than one character you can download the following code and it's simulation using proteus software.
See also :
Displaying Custom Characters On Lcd ~ Software Movie And Information >>>>> Download Now
BalasHapus>>>>> Download Full
Displaying Custom Characters On Lcd ~ Software Movie And Information >>>>> Download LINK
>>>>> Download Now
Displaying Custom Characters On Lcd ~ Software Movie And Information >>>>> Download Full
>>>>> Download LINK lZ