I had my project running sweetly on a UNO, including displaying data on a 16x2 LCD.
I carefully noted down all the wiring connections, showing colour and pin numbers at both ends for all 12 wires (1-6, 11-16). Then I carefully (!?) transferred all of them to a Nano, using exactly the same pin numbers, plus 5V and Gnd, and the 10k pot connection for backlight setting.
But although other aspects of the sketch worked as before, the LCD did not. It just shows the first line of 16 backlit rectangles on startup, and does nothing else. Naturally I then uploaded the simplest possible sketch, HelloWorld from the examples, and that was the same.
After an hour or so I still can't see any wiring mistake, but I suppose that's the only logical conclusion, apart from the LCD now being damaged? IOW, are the pins identical, with no special exceptions? If so then I'll tediously have to transfer it all back to the UNO as next step.
The relevant sketch is now HelloWorld which I assume you’re familiar with? Apart from adding a line of serial monitor print, nothing else was expected except the message, which failed to appear.
The only external connection, apart from the USB, is the one I mentioned, the backlight pot.
Composing this away from PC but I recall memory usage was quite modest.
Generate an annotated schematic showing exactly how you have wired it, then post it. I have a feeling by the time you finish that you will find your wiring mistook.
Thanks, I'm going ahead with removing all the wiring again anyway, and if the mistake doesn'r emerge during that I'll reconnect to UNO, then report back .
When you say “Pin Numbers” do you mean “Pin Names”. The Nano pin names are arranged in a different order than on the Uno. You did make an accurate schematic before you built this project I hope. Or at least an “as built” schematic after you got it working.
Thanks. I thought maybe you meant a 'clone', which it might well be.
I reckon I've found the cause. I'd pulled all the Nano wires before I found the culprit: the 5V end of the backlight 10k pot had broken, inside the case.
I'm not going to risk fixing it tonight.
Somewhere I bet there's a list of 'symptoms' for this popular 16x2, and I expect one of them might be something like
"Line 1 illuminates brightly on applying power. Line 2 is blank. Nothing gets printed. CHECK BACKLIGHT CONNECTIONS."
No, I'm pretty sure it's something else. The backlight appears to be working from your first photo. There is only one backlight and it illuminates the whole display, not just one line. The pot does not control the backlight. It controls the contrast. The wrong contrast does not cause one line to be all squares and the other line to be blank, it would affect both lines the same way.
The top line showing squares and the bottom line being blank is indeed a symptom of a well known problem with 16x2 LCD. It's not getting initialised. That means one or more of the data connections is incorrect/missing/faulty.