This display, which is extremely similar to the AdaFruit ST7735, is frequently found on ebay and is a great 1.8 inch SPI TFT display. It also includes an SD Card slot, also available via SPI. The main issue with the display is the fact that the pin out marked on the PCB solder mask is completely wrong.
Despite having pins labeled SCK/SDA, this is not an I2C device. It is an SPI device and the pin 8 marked “SDA” is actually MOSI, which would connect to Pin 11 (MOSI) on Arduino or Netduino boards. Pin 7, marked “A0” is our “device command”, or “D/C” pin.
Here is how I hook it up to my Netduino 2.
|1.8 SPI TFT Pin||Netduino 2 Pin|
|6 – Reset||8|
|7 – “A0”||7|
|8 – “SDA”||11|
|9 – SCK||13|
|10 – CS||9|
|15 – LED+||3.3V or PWM|
|16 – LED-||Ground|
Now what about software? Over on the Netduino Helpers CodePlex project you’ll find this AdaFruitST7735 library.
Unfortunately it hasn’t been updated in a while and if you try to use the referenced ExtendedSpiConfiguration on .Net MF 4.3 (or likely 4.2) you’ll get an argument null exception. Additionally the library includes some offsets in the frame buffer that must have been for some older iteration of the device, because they will cause offset or scrolling images.
I’ve gone ahead and put an updated library in GitHub here:
Usage is pretty simple – here is an example using the pin assignments I listed above:
var lcd = new HY18SPI(Pins.GPIO_PIN_D9, Pins.GPIO_PIN_D7, Pins.GPIO_PIN_D8, SPI.SPI_module.SPI1, 15000);
lcd.AutoRefreshScreen = true;
lcd.DrawCircle(10, 10, 20, (ushort)HY18SPI.Colors.Red);