-->
Page 1 of 1

Wemos D1 Mini with 1.8 Inch ST7735

PostPosted: Thu May 24, 2018 7:37 am
by CTB
Hi all,

I recently bought a 1.8 Inch ST7735 screen and I am trying to connect it to a Wemos D1 Mini.
After 4 days of connecting wires and trying demos, I gave up so I've come to ask for your help.

The ST7735 has an unusual pins naming and even after extensive online search I can't figure out what to connect with what.
Here's the screen:

Image

SCREEN > Wemos D1 Mini
5V >
RESET >
RS >
MOSI >
SCK >
CS >
MISO >
SD/CS >
BLED >
GND >

If you have used this specific screen with the D1 Mini, could you please help me with the wiring and drivers required? I am only interested in its functionality as a screen, the microSD slot will be left unused. Using the Adafruit ST7735 and GFX libraries, these are the connections I've done so far, but they doesn't work, the screen stays off:

SCREEN > Wemos D1 Mini
5V > 3V3
RESET > D0
RS > D4
MOSI > D7
SCK > D5
CS > D8
MISO > nothing
SD/CS > nothing
BLED > 3V3
GND > G

Ideally, and since I am new to this, I would appreciate if someone pointed me to a direction on how to learn to figure out these connections myself. Is there a guide that explains what's what? I found this schematic but I can't quite understand what it means and how to use it.

Image

Thanks in advance

Re: Wemos D1 Mini with 1.8 Inch ST7735

PostPosted: Wed Jun 06, 2018 4:37 am
by Anti Reiljan
Start by connecting 5V to 5V instead of 3,3V

Re: Wemos D1 Mini with 1.8 Inch ST7735

PostPosted: Wed Jun 06, 2018 7:30 am
by QuickFix
Anti Reiljan wrote:Start by connecting 5V to 5V instead of 3,3V

Normally (with other TFT-screens) that isn't actually required. :idea:
You can get these displays working at 3.3V if you close a specific jumper, generally J1 (on the boards I have), in this case jumper J2 looks like the one (though I don't own this display).

Please remember that, if you short that jumper, the display can't be used on 5V (unless you un-short the jumper again).

This is what the pins do
  1. 5V - Vcc (required)
  2. RESET - Reset (optional, but can be connected to the reset-line of the µC)
  3. RS - Register Select (AKA DC or Data/Command) (required)
  4. MOSI - Master Output/Slave Input (required)
  5. SCK - Serial Clock (required)
  6. CS - Chip Select (AKA SS or Slave Select) (optional)
    When you only want to use the display, you can pull this permanently LOW, when you also want to use the SD-card interface (see pin 8) (or when your setup also has other SPI-devices on the same bus) every SPI-device needs its own CS-line
  7. MISO - Master Input/Slave Output (optional, not really needed with displays)
  8. SD/CS - Chip Select for the SD-card interface
    You can pull this line permanently HIGH if you don't want to use it or give it its own CS-line on the µC
  9. BLED - Background LED (required, or you'll see nothing)
    If you have a spare port, you can connect it to that port and use PWM so you'll be able to adjust the backlight by software (you ought to use a power-transistor for the current of the LED is usually too high for an ESP).
    When you don't have a spare port or don't care for backlight control, just connect it to Vcc.
  10. GND - Power ground (required)
So, where does this bring us:
  • 5V -> 3.3V (pin 8)
  • RS -> GPIO2 / D4 (pin 17)
  • MOSI -> GPIO13 / D7 (pin 7)
  • SCK -> GPIO14 / D5 (pin 5)
  • CS -> GND / G (pin 15)
  • SD/CS -> 5V / 5V (pin USB)
  • BLED -> 5V / 5V (pin USB)
  • GND -> GND / G (pin 15)
Next, take a demo that comes with the ST7735 library and set the correct define-values for the used GPIO-ports.
Compile and flash... and it *should* work.

If it doesn't, recheck the define-values of the ports and use actual GPIO-numbers (0 ~ 16) instead of port-numbers (D0 ~ D8)
Compile and flash... and it *should* work.

If it doesn't, I might have got the CS-lines wrong (I'm pretty sure, but doing this from the top of my head) and you'll have to set CS (of the display) to HIGH and SD/CS (of the SD-card) to LOW.

Good luck. ;)