NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » Lcd not displaying writing

January 06, 2011
by dgikuljot
dgikuljot's Avatar

i just got the nerdkit yesterday. I wired everything up to use it for the first time. The lcd power ups, but it displays black scares throughout the whole screen and not any text. i have checked all my connections multiple times and they are fine. Once again the lcd powers up and is displaying all rows/collums full of black squares instead of text. Could this be that the microcontroller got shipped to me without the welcome program flashed to it. Thanks

January 06, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi dgikuljot,

It is possible that your chip went out without a program on it, but its very unlikely given the way we test and package our kits. If your program wasn't sending any instructions to the LCD it would probably display only the 1st and 3rd lines all black. Given that you are seeing all black, it leads me to believe there is a problem with your contrast resistor, or your they wiring on your power connections. If you include some good close up pictures of your setup we would be glad to take a look and see if we spot anything.

Humberto

January 06, 2011
by dgikuljot
dgikuljot's Avatar

Hi,I will post some pictures as i am not home right now. i did measure the contrast resistor i used and it is 1k ohm. Besides the connections, is there anything else that could be wrong.

January 06, 2011
by dgikuljot
dgikuljot's Avatar

No worries. Just discovered my mistake. I had the voltage regualor plugged in, but i had accidentally sent 9 volts unregualted into the circuit. I think i fryed the mcu. Is there any way i can get a repalcemnt mcu. I cant believe such a simple mistake.

January 06, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi dhikuljot,

It is possible you fried your chip, but I would say it is not very likely, the chips are surprisingly resilient. Try connecting it correctly and give it a try. If you post those pictures of your setup there still might be little errors you missed that we can catch.

You can also try continuing on and trying to program the chip. It is possible your wiring mistake corrupted the initial program but not the bootloader and it might take the new program just fine.

Humberto

January 06, 2011
by dgikuljot
dgikuljot's Avatar

Ok guys,, I finally got everything working. Thanks for all your help. I just have 2 more questions. First of all if i dont have a 33ohm or less resistor is it safe for me to wire the lcd backlight without a resistor. Second, i have a ac power adapter that says 6volts and 300ma but a multimeter shows its actually outputting 9.6 volts. If i want to use that as my power adapter what is the biggest capaciator i can use to filter out the noise in terms of microfarads. Can i safely use a 25volt 220 microfarad capaciator in series to filter eveythting out. Thanks.

January 06, 2011
by mongo
mongo's Avatar

Don't wire in the backlight without a resistor. Pretty much anything between 33 and 100 ohms will work fine. It just night not be as bright with the bigger resistors.

January 06, 2011
by dgikuljot
dgikuljot's Avatar

Ok Thanks Mongo, I finally have 1 more question. I have moved on to the step where i attempt to program the microcontroller my self. so i have installed eveyrthing, and eveyrthing is wired up correctly. i open cmd and type

dir DesktopCodeCodeinitialload it tells me the 2 files in the folder then i type in "make" It says no target and no makefile found stop.

So any clues on what could be wrong

January 06, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi dgikuljot,

It looks like you are calling dir with the full path you want to list, which will work correctly and tell you what is in the directory Desktop/Code/Code/initialload/, however when you run "make" it is running make in the current directory, which is still your default home directory. You should instead be using the cd command to change directory into the initialload folder. I think it would be something like

cd Desktop
cd Code
cd Code
cd initialload

Then you can just do

dir

to list the files in the current directory. If those look right, then you can do make.

Humberto

January 06, 2011
by dgikuljot
dgikuljot's Avatar

Ok this time it says something like upload error 1. I will mess around with it tommorow and email you if i need help.Thanks for the very quick reponse

January 07, 2011
by dgikuljot
dgikuljot's Avatar

Hi Guys, I have gone over the setup several times and everything seems fine. I have set the make file to the correct com port. Now i am have touble programming the chip. It is giving error 1. I have include a link to the image of the error. I dont know how to embed it.

http://img818.imageshack.us/i/compilererror.png/ Please help as this is very frustrating.

January 07, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi dgikuljot,

This error is probably happening because you either managed to delete the include statements on top of your initialload.c code, or you managed to delete part of all of the LINKEDOBJECTS line in your Makefile. If you post your Makefile for us to check out, and the top part of your initialload.c file (just the first 10 lines or so) we would be happy to take a look see if we see anything.

It can be frustrating to get started with new fields like microcontrollers, but its during debugging that most of the awesome learning happens!

Humberto

January 07, 2011
by dgikuljot
dgikuljot's Avatar

Hey Humberto, I didnt even edit the code file. I will though put the make file up here. Could this error be due to the mcu being damage when i sent the 9 volts unregulated into the mcu.

GCCFLAGS=-g -Os -Wall -mmcu=atmega168 LINKFLAGS=-Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt -lm AVRDUDEFLAGS=-c avr109 -p m168 -b 115200 -P /COM4/libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

all: initialload-upload

initialload.hex: initialload.c make -C ../libnerdkits avr-gcc ${GCCFLAGS} ${LINKFLAGS} -o initialload.o initialload.c ${LINKOBJECTS} avr-objcopy -j .text -O ihex initialload.o initialload.hex

initialload.ass: initialload.hex avr-objdump -S -d initialload.o > initialload.ass

initialload-upload: initialload.hex avrdude ${AVRDUDEFLAGS} -U flash:w:initialload.hex:a This is everything in the make file. Please help

January 07, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi dgikuljot,

This particular error is not due to your potentially frying the MCU. This error is happening when avr-gcc is trying to compile the code, it has not yet attempted to upload the code. Looking over your Makefile however it looks like you did manage to mess with the LINKOBJECTS line of the makefile. There should be 4 distinct lines at the top of the Makefile, it should read like this

GCCFLAGS=-g -Os -Wall -mmcu=atmega168
LINKFLAGS=-Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt -lm
AVRDUDEFLAGS=-c avr109 -p m168 -b 115200 -P COM4
LINKOBJECTS=../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

Remember the com port needs to be checked every time, and possibly changed.

Humberto

January 07, 2011
by dgikuljot
dgikuljot's Avatar

well i copied that into the makefile and changed port to com3( thats the current port this time). When i run it it says no target eror stop. So with this makefile it doesnt even attempt to compile.

January 07, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi dgikuljot,

I highly recommend you take a step back and slow down a little. This could again mean many things but we need more information to find out what is going on. This either means that you didn't cd your way into the right folder (the one where the Makefile is) or that when you pasted in the lines I suggested for you, you deleted other things form the Makefile. If you post the full error you are getting, as well as your new full Makefile I will be glad to take a look. This time please indent your Makefile as a Code block after you copy it in so that it is easier to read.

Humberto

January 07, 2011
by dgikuljot
dgikuljot's Avatar

Hey Humberto, Thanks for all your effort. I got it working. Misake was In the make file as It is very sensitive to slightest change. Thanks everyone. For the led backlight the lowest resitor I have is about 90-100 ohms. Should I use that or wieeit up straight

January 07, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi dgikuljot,

Do not just wire it up straight. Like mongo already mentioned, this is a bad idea and could damage your LCD and other components. A 100 ohm resistor will do just fine, it just won't be as bright.

Humberto

Post a Reply

Please log in to post a reply.

Did you know that the printf format string "%.3f" will show three digits after the decimal point? Learn more...