My 16x2 LCD is not working.. Wot should i do? some1 help me out! 
|
|

bOtskOOl website by bOtskOOl is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 India License.
Permissions beyond the scope of this license may be available at http://www.botskool.com/contact.
bOtskOOl.com Privacy Policy - bOt-Xchange Product Listing Policy - Intellectual Property Rights (IPR) Protection Policy

I made the circuit properly and check the connection 2 tyms but lcd don't dispaly anything..only light is glowing...m using circuit and code given at this link
http://robozeal.blogspot.com/2009/08/lcd-interfacing-with-atmega16.html
plz help me....
sharang did u try changing the potentiometer which changes contrast? Its probably contrast problem
Sir here is the code i am using to interface lcd to 8052. All i am getting is blocks on lcd.
code also include rtc 12887 interfacing
can we manually change the values of high and low fuse bits to 0xE1 and 0xD9 respectively?? will it work?? i found the values using the fuse bit calculator...
its not clear to me.. can you plz xplain it a little more..
Thanl you very much.. Iwill try these things
JTAG can be disabled in many ways.
You can change the fuse-bit settings using an ISP programmer.
An IO control bit "JTD" is available. Unlike the fuses this bit can be set at run-time allowing you to disable the JTAG / OCD functionality in software during program execution.
To disable JTAG you need to write to the MCUCSR and that too twice and also it must be done within four clock cycles or it won't stick.
MCUCSR=0x80;
MCUCSR=0x80;
Make sure you include avr/io.h header file.
You can also change fuse-bit settings by using ponyprog.
You need to check the box for JTAGEN fuse in that.
Programmed fuse = 0 = checked
You can use Engbedded Atmel AVR® Fuse Calculator. This calculator will give you proper command line to execute in avrdude after you have selected appropriate settings.
Please if anybody can reply to my query...botskool please answer it... i need to know about it.
I am new to all these, so didn't have so much knowledge in deep about AVR.. still learning.
I thought you did it already. It should be in the data sheet
Can anybody tell me how to disable the JTAG interface of PORTC in Atmega16/32 microcontrollers.
Hmm, yes this happend with PICs as well, i have not been able to work with AVR/s though
I got the mistake.. I was using PORTC of uc as the output port without disabling the JTAG interface.. Now i am using PORTB for the output port.. The above code is working absolutely fine.. thanks to u all for your valuable suggestions..
Have you provided a variable resistor on contrast control pin? see that this pin does not get directly Vcc or ground. the best idea is to connect the variable terminal of 10k resistor to the contrast control pin. the other two terminals or variable resistor goes to vcc and ground. run the code and adjust the variable resistor so that you can see the characters on LCD.
Did you check the contrast setting on the LCD ??
Yes I am faproblem setting the delay.
This is my code.. please can you help me correct it..
#define F_CPU 12000000ul //F_CPU value used in hardware
#include <avr/io.h>
#include <util/delay. h>
#include<avr/delay.h>
#define dataport PORTC
#define commport PORTD
#define rs PD4
#define wr PD5
#define en PD6
int LCD_init(void) ;
int LCD_SendData(void);
int wrcomm(void) ;
int wrdata(void) ;
int main(void)
{
DDRC = 0xFF;
//PORTC=0x00;
DDRD = 0x70;
//PORTD=0x00;
LCD_init();
LCD_SendData();
return 1;
}
int LCD_init()
{
dataport = 0x38; //init. LCD 2 lines, 5x7 matrix
wrcomm(); //Right the command byte to command register
dataport = 0x01; //Clear LCD
wrcomm(); //Right the command byte to command register
dataport = 0x0E; //Display on Cursor Blinking
wrcomm(); //Right the command byte to command register
dataport = 0x80; //Cusor at line 1, position 1
wrcomm(); //Right the command byte to command register
dataport = 0x1C; //Shift Entire Display To Right
wrcomm(); //Right the command byte to command register
return 1;
}
/*********** **** <<Sending Data To LCD Display>> ************ ***/
int LCD_SendData(void)
{
unsigned char j[] = "LCD Display";
int i;
for(i = 0; i < sizeof j ; i++)
{
dataport = j[i];
wrdata();
}
return 1;
}
/******* <<Righting the command byte to command register>> ********/
int wrcomm(void)
{
commport &= ~(1 << rs);
commport &= ~(1 << wr);
commport |= (1 << en);
commport &= ~(1 << en);
_delay_ms(10) ;
return 1;
}
/********** <<Righting the Data byte to Data register>> **********/
int wrdata(void)
{
commport |= (1 << rs);
commport &= ~(1 << wr);
commport |= (1 << en);
commport &= ~(1 << en);
_delay_ms(10) ;
return 1;
}
Since your code is running properly in simulator it seems to be delay problem. Following points should be kept in mind while writing the progam -
· The Enable pin is used by LCD to latch information present at its data pins. When data is supplied to data pins a high to low pulse of minimum 450 ns wide should be applied to En pin in order for LCD to latch in the data present at data pins.
· Also a delay of minimum 250ms between two simultaneous 'writing characters/moving cursors' commands.
Have you implemented the above mentioned conditions?
As shobhitkukreti has said you should cross-check your connections again. Its the most common source of error. Also it will be better if you post your schematic/circuit diagram and program here. Have you tried running your program in a simulator?
I am interfacing 16x2 LCD with Atmega16 controller, i wrote the code which works very fine when checked in AVR Studio simulator, but didn't work on my circuit, my circuit connections are perfectly ok and the LCD pannel is also tested, may be i am facing delay problem and could not initialise the LCD properly. Can anyone please post a working or tested code.
Regards:
Aditya Sharma
Robotics INDIA
The most basic issue is loose connecctions. If that is ok, check the contrast of LCD and vary it.Check your delays, the controller of LCD mite be busy while you sent other command/data. Increase the delay. A schematic of your connection and the program code will make it a little easier to decipher your problem. So post that as well