0

I'm trying to use the TTGO TS 1.0 display with a demo app from a different source. The demo app wants the following to be configured:

#define PIN_NUM_MISO 17     // SPI MISO
#define PIN_NUM_MOSI 23     // SPI MOSI
#define PIN_NUM_CLK  5      // SPI CLOCK pin
#define PIN_NUM_CS   26     // Display CS pin
#define PIN_NUM_DC   17     // Display command/data pin
// ** If you want to use them, set them to some valid GPIO number
#define PIN_NUM_RST  0      // GPIO used for RESET control

According to the TTGO readme the following wiring is used:

CS:16 DC:17 SDA:23 SCK:5 RST:9

My guess is:

PIN_NUM_MISO ?
PIN_NUM_MOSI 23
PIN_NUM_CLK  5
PIN_NUM_CS   16
PIN_NUM_DC   17

How to update the demo app to match with this? Reset is optional in the demo and there is 1 additional pin there as well which I can't figure out...

  • Sounds like your demo code is for an SPI screen, but you have an I2C screen. – Majenko May 26 '18 at 14:20
  • Maybe silly question, can this be used somehow say, with a software I2C to SPI adapter? – haxpanel May 26 '18 at 14:24
  • You can re-write your demo code to use I2C instead of SPI. There's no such thing as a "software I2C to SPI adapter" – Majenko May 26 '18 at 14:25
  • Although, looking at the code that's in that repo it may in fact be uni-directional SPI (MOSI and SCK but no MISO, which is quite common). – Majenko May 26 '18 at 14:27
0

If it is, as I think it may be now I have dug into the code a little, simply an SPI interface with no MISO (which is quite common for TFT screens) you just map the pins 1:1 and ignore MISO.

  • PIN_NUM_MISO => Ignore
  • PIN_NUM_MOSI => SDA
  • PIN_NUM_CLK => SCL
  • PIN_NUM_CS => CS
  • PIN_NUM_DC => DC
  • PIN_NUM_RST => RST or Ignore

If the demo code insists on there being a MISO pin you can just assign that to any unused GPIO pin. You don't need to connect it to anything.

The majority of TFT and OLED driver code only ever writes to a screen and never reads from it, so MISO is not needed to actually control the screen.

  • Unfortunately the display doesn't work with this config. Which doesn't necessary mean the answer is wrong, I'll try to confirm it somehow. – haxpanel May 29 '18 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.