This is my first time interfacing with the lcd module with an atmega328p.I couldn't find the error as it was complied successfully but the LCD screen is blank.please do help.
the code is attached.
thanks in advance.
Successful compile does NOT guarantee successful operation!
Do you have a correct contrast control voltage applied? Or, for that matter, even the proper LCD supply voltage? And the proper pin connections?
Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net
You need to read up on bit manipulation. Specifically the use of |=
I can’t see overall how your code would work -?it looks like you use 4 bit mode, but there’s no 4 bit operations. Why not start with known good code?
There are at least a billion examples of LCD code on the net, a few can even be found here on AVR freaks!
Do a google search for Fleury and LCD. while your there pick up his I2C and Serial code too! It will save much hair pulling!
Mission: Improving the readiness of hams world wide : flinthillsradioinc.com
Interests: Ham Radio, Solar power, futures & currency trading - whats yours?
This is my first time interfacing with the lcd module with an atmega328p
So are you familiar with interfacing LCD modules with other microcontrollers?
And are you familiar with doing other stuff with an atmega328p?
If neither of the above, then perhaps you should take a few steps back, and start with the basics ... ?
How to properly post source code to the forum: https://www.avrfreaks.net/comment... (including, for future reference, how to post images)
As far as i know to work on the 4 bit functionality of lcd i have to mask the lower 4 bits in my command write and data write functions and shift the lower nibble to higher nibble.also i looked up the datasheet and it mentioned that i shoud use different hex commands for 4 bit and 8 bit functionality.(0x38 for 8 bit and 0x28 for 4 bit).do correct me if i went wrong.
thanks in advance
i double checked my pinouts from the lcd to the microcontroller's pinout and have hooked up a 10k pot for contrast control of the lcd
Start with one of the many correct drivers for this LCD hardware that already work, and use that to verify that your hardware is correctly set up. Then you can debug your code while being confident that the other parts of the setup are correct.
hooked up a 10k pot for contrast
But have you "hooked it up" correctly ?
Post Your schematic.
Also post some good, clear, in-focus photos of your setup.
Again, the instructions are here: https://www.avrfreaks.net/comment...
How have you proven basic functionality?
eg, blinked LED ?
© 2018 Microchip Technology Inc.