Author Topic: 40x4 LCD not working  (Read 1728 times)

0 Members and 1 Guest are viewing this topic.

Offline JuanGgTopic starter

  • Regular Contributor
  • *
  • Posts: 193
  • Country: es
    • My personal blog
40x4 LCD not working
« on: February 06, 2020, 08:38:48 pm »
I have purchased a character LCD from here: https://www.buydisplay.com/40x4-lcd-module-datasheet-commands-arduino-pinout-hd44780-black-on-yg



Following the datasheet, I tried to initialize it manually using dip switches, but I could not get it to work.
The LCD uses the standard Hitachi interface, with two enable pins.
On power up, the usual black squares do appear, and contrast adjustment works fine.


I tied the second enable low, and connected the first one (E1) to a de-bounced switch.
With E1 high, I tied RS and R/W low, wired the data bus to 00111000, and changed E1 to low. That should initialize the display, but I see no changes on the screen, I suppose it should go blank. (I've moved the contrast pot around).
I've checked the connections a dozen times, soldered some decoupling capacitors right to the connector, but no luck.
I don't know how to proceed. It could have been damaged by ESD, but in such case, would it even show the initial squares?
Any ideas are welcome.


    Juan

Offline rhodges

  • Frequent Contributor
  • **
  • Posts: 364
  • Country: us
  • Available for embedded projects.
    • My public libraries, code samples, and projects for STM8.
Re: 40x4 LCD not working
« Reply #1 on: February 06, 2020, 09:00:38 pm »
Okay, 0x38 chooses 8 bit mode and display lines. That is what I use, except mine uses 4 bit mode (0x28).
Here is my init code: (RS pin is low)
    lcd_comd(0x28);             /* 4-bit mode, 2 lines */
    lcd_comd(0x0e);             /* turn on diplay and cursor */
    lcd_comd(0x06);             /* auto increment and move cursor */
Then send characters with RS pin high.

My code for STM8 might be of some help:
https://github.com/unfrozen/stm8_libs/blob/master/lib_lcd.c
Currently developing embedded RISC-V. Recently STM32 and STM8. All are excellent choices. Past includes 6809, Z80, 8086, PIC, MIPS, PNX1302, and some 8748 and 6805. Check out my public code on github. https://github.com/unfrozen
 

Offline JuanGgTopic starter

  • Regular Contributor
  • *
  • Posts: 193
  • Country: es
    • My personal blog
Re: 40x4 LCD not working
« Reply #2 on: February 07, 2020, 10:15:03 pm »
Thanks. Found the issue in the end. I copied the pinout on a piece of paper and missed the order of the data bus...It's working now.
    Juan

Offline JonInPalawan

  • Newbie
  • Posts: 1
  • Country: ph
Re: 40x4 LCD not working
« Reply #3 on: July 09, 2022, 04:09:56 am »
How did you get contrast adjust to work? My display is Surenoo, and I tried to follow their conflicting instructions. Can't make the faint 5x8 dot pattern to adjust out. 
Initializing was easy. Just set the required data, then pull both enables low then high again. Repeat for next data. The two controllers work independently, though they share the common data bus.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->