I recently got my hands on a Nokia 3310/5110 display and since u8g supports it (pcd8544_84x48_hw_spi), I had to try hooking it up to a Wemos D1 Mini ... but I just can't manage to get it to work. Backlight works fine, but all I get is "snow", i.e. random pixels activated (black) once I run the u8g initialization function.
My wiring:
- LED to 3v3
- RST to D2 (physical GPIO 19)
- CS to D1 (20)
- D/C to D6 (12)
- DIN to D7 (GPIO 13, MOSI)
- CLK to D5 (GPIO 14, CLK)
- VCC to 3v3
- G to Ground
Here's the script I run to test the setup (tried both via luatool.py and serial):
-- SPI setup as in various examples
spi.setup(1, spi.MASTER, spi.CPOL_LOW, spi.CPHA_LOW, 8, 8)
cs = 1
dc = 6
res = 2
disp = u8g.pcd8544_84x48_hw_spi(cs, dc, res)
-- now i get random pixels
disp:begin()
-- display doesn't change, still random pixel snow
disp:drawLine(1, 1, 20, 20)
-- still same random pixels, no line
I tried two different Wemos D1 Minis. I tried different pins for RST, CS and D/C, also pulling down the CS pin (since some examples do this), but all I get is a snow-like random pixel pattern (with about 10% or so of pixels active, sprinkled all over the display). I have no problems lighting LEDs, talking to various sensors (e.g. a BME280) and the like, so I guess it's not something fundamental. The display works fine on a Raspberry Pi Zero.
The firmware I use is a float one from the build service with 18 modules (bme280, file, gpio, i2c, mdns, mqtt, net, node, pwm, rotary, rtctime, sntp, spi, tmr, u8g, uart, wifi, ws2812) and three fonts, built a few days ago against master.
I'm a bit stuck, any advice or suggestions?
Thanks!
Regards,
Felix