Lcd 16*2 displays black box in 1st line while using standalone atmega 328

I used the exact code and atmega as standalone and in uno.The uno displays without any issue but while using it's atmega as standalone the lcd displays black box. I used the code and diagram from https://docs.arduino.cc/learn/electronics/lcd-displays.


I saw a video where a guy put a 10mf cap between the 5v and gnd.This didn't work for me.
https://youtube.com/watch?v=tetcMQ24bqA&si=enIiQzboZr8r4UNi

A line of boxes is what you see on an LCD when it hasn't been initialized yet. If you've just removed the programmed processor from the Uno (where it was working), I would imagine that either a) the processor isn't running because there's a problem in your wiring or b) the LCD isn't seeing the commands the processor is sending because there's a problem in your wiring.

I'd suggest adding code to your sketch to blink an LED in loop() and seeing if that works. That would tell you whether or not the processor was running and allow you to concentrate on which part of the circuit is the problem.

All I.C. Vcc pins require a de-coupling 100nF ceramic capacitor.

Your images are too dark, and we need different views.

Yes the led is blinking

Are you sure your Vo pot is wired correctly? It appears to be 1 row off.
Have you tried adjusting it?

1 Like

Yes adjusting it adjusts the contrast of the boxes

Post your code.
Are you intending to use A2-A5 for LCD D4-D7?

One line of boxes sometimes means "initializing, but not finished" when connected to an Arduino (the board).

That seems to be the case i saw the pinout from google and assumed the pins to be digital instead of analog i will try correcting it thank you


My bad with the wiring thanks guys

My guess is you intended to use D2-D5 and just picked the wrong pins. That's an easy mistake to make with multi function pins. Too much information on each pin.

Honor me with the solved, solution, or whatever it is. I rarely get one correct :smiley:

Now go have fun

My 1st time here so i have no idea what that is

LOL I understand

Below post #8, where I mentioned A2-A5, you should find a check box labeled "Solution", or something like that. I get brownie points on this forum for helping you solve your problem by you checking the box. I get a virtual gold medal by accumulating brownie points.

Thank you.
I'm one step closer to being somebody someday, maybe.

Now get back to your LCD work.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.