dhrone / pydPiper

A general purpose program to display song metadata on LCD and OLED devices
MIT License
78 stars 36 forks source link

Newhaven OLED random characters #46

Open PMu1 opened 5 years ago

PMu1 commented 5 years ago

Hi,

I have been trying to get pydPiper to work with a 16x2 OLED display, specifically this one: https://www.adafruit.com/product/823 (Newhaven NHD-0216KZW-AB5) but I cannot seem to get the display to work.

I have it connected with 4-bit parallel to the RPi3B+, but if I configure pydPiper with HD44780 I get random characters on the display, and with winter_weg I get the same thing. I tried to play with the pulseEnable time, but still got nowhere.

Is there a specific configuration I'm missing with this type of OLED?

Thanks

dhrone commented 5 years ago

Have you gotten any other sample code to work? Usually when displays don't work correctly its a wiring problem. FYI, the adafruit display appears to be the WEH001602a which is definitely supported. I'm not sure about the Newhaven.

PMu1 commented 5 years ago

I compared the datasheets for the Winstar and Newhaven and the timings are the same, only the initialization sequence is a little bit different. Connections are the following: OLED | GPIO | Rpi3 pin# 1: VSS | GND | 6 2: VDD | 5V | 2 4: RS | 7 | 26 5: R/W | GND | 20 6: E | 8 | 24 11: D4 | 25 | 22 12: D5 | 24 | 18 13: D6 | 23 | 16 14: D7 | 27 | 13

dhrone commented 5 years ago

Yes, it does appear to be compatible. Can you confirm whether you've gotten the display to work with an alternate program?

PMu1 commented 5 years ago

I just tried a basic python script to print "Hello World" on it using the RPLCD library and it works.

dhrone commented 5 years ago

Well that rules out wiring problems.

I took a quick look at RPLCD and it looks like it is purely HD44780. Why don't you try running with the hd44780 driver to see if that works. FYI, you can run the display drivers as stand alone python programs for testing.

python hd44780.py

Normally you would need to supply all of the pin assignments on the command line but you've used the same values I have for defaults. If you did need to enter them, it would look like this.

python hd44780.py -r 80 -c 16 --rs 7 --e 8 --d4 25 --d5 24 --d6 23 --d7 27

PMu1 commented 5 years ago

I tried setting it up as hd44780 previously, but I would only see “pydPiper starting” (or something similar) for about 1 second and then random characters over all the screen.