- This topic has 4 replies, 2 voices, and was last updated 11 years, 6 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
|
Microcontroller › AVR › Interfacing LCD with ATMEGA 8
Hello friends,
Can i use the code LCD interfacing provided in Engineers garage for ATMEGA 8?
The circuit is given for ATMEGA 16… Should i modify the code fot ATMEGA 8?
Pls help…
Hi Prajwal,
Which code are you using, 4-bit mode or 8-bit mode?
Take the case of 4-bit mode, the LCD is entirely connected to portA of atmega16, but in atmega8 there is no portA.
You have to modify your code according to the microcontroller you are using.
Thanks for the reply sir I will try it and post you back soon
hello sir i modified the 4 bit mode code to atmega 8. the code is like this
#include<avr/io.h>
#include<util/delay.h>
#include<inttypes.h>
#define rs PB0
#define rw PB1
#define en PB2
void lcd_init();
void dis_cmd(char);
void dis_data(char);
void lcdcmd(char);
void lcddata(char);
int main(void)
{
unsigned char data0[11]=”ENGINEERS”;
unsigned char data1[10]=”GARAGE”;
int i=0;
DDRD=0xFF;
lcd_init();
while(data0!=’