1. The Arduino Library Manager should find and install MCUFRIEND_kbv library 2. Install the Adafruit_GFX library if not already in your User libraries. 3. Insert your Mcufriend style display shield into UNO. Only 28-pin shields are supported. 4. Build any of the Examples from the File->Examples->Mcufriend_kbv menu. e.g. graphictest_kbv.ino 5. Most of them will write some text to the Serial window (9600 baud). The BMP examples require you to copy the pictures from the bitmaps/ folder to your microSD (root directory) 6. This library is only intended for UNO and these specific Shields. It will work on a MEGA2560 but not very fast. 7. The constructor takes no arguments (because it only works with these shields) 8. The examples are the standard Adafruit ones. You can see my edits by searching for "kbv" 9. Any Adafruit sketch should work with the MCUFRIEND_kbv constructor() but should allow extra ID values An Adafruit constructor(cs, rs, wr, rd, rst) IGNORES any arguments. i.e. it only uses the shield control pins MCUFRIEND_kbv inherits all the methods from the Adafruit_GFX class: https://learn.adafruit.com/adafruit-gfx-graphics-library/overview and Print class: https://www.arduino.cc/en/Serial/Print The only "new" methods are hardware related: vertScroll(), readGRAM(), readPixel(), setAddrWindow(), pushColors(), readID(), begin() readReg(), pushCommand(), WriteCmdData() access the controller registers 10. It currently supports UNO shields with "mcufriend.com" pcbs with controllers: GC9302 240x320 ID=0x9302 HX8347-A 240x320 ID=0x8347 #define SUPPORT_8347A *** Untested *** HX8347-D 240x320 ID=0x4747 #define SUPPORT_8347D HX8347-G 240x320 ID=0x7575 #define SUPPORT_8347D HX8347-I 240x320 ID=0x9595 #define SUPPORT_8347D HX8352-A 240x400 ID=0x5252 #define SUPPORT_8352A HX8352-B 240x400 ID=0x0065 #define SUPPORT_8352B HX8357-B 320x480 ID=0x8357 (shares init with 8357-D) HX8357-C 320x480 ID=0x9090 (ID has changed from 0x8357) HX8357-D 320x480 ID=0x0099 #define SUPPORT_8357D_GAMMA HX8367-A 240x320 ID=0x6767 #define SUPPORT_8347D ILI9163 128x160 ID=0x9163 #define SUPPORT_9163 ILI9225 176x220 ID=0x9225 #define SUPPORT_9225 ILI9226 176x220 ID=0x9226 #define SUPPORT_9225 ILI9320 240x320 ID=0x9320 ILI9325 240x320 ID=0x9325 ILI9326 240x400 ID=0x9326 #define SUPPORT_9326_5420 ILI9327 240x400 ID=0x9327 ILI9328 240x320 ID=0x9328 ILI9329 240x320 ID=0x9329 ILI9331 240x320 ID=0x9331 ILI9335 240x320 ID=0x9335 ILI9338 240x320 ID=0x9338 ILI9340 240x320 ID=0x9340 ILI9341 240x320 ID=0x9341 ILI9342 320x240 ID=0x9342 #define SUPPORT_9342 ILI9481 320x480 ID=0x9481 ILI9486 320x480 ID=0x9486 ILI9487 320x480 ID=0x9487 ILI9488 320x480 ID=0x9488 (weird 555 display :#define SUPPORT_9488_555) LGDP4532 240x320 ID=0x4532 #define SUPPORT_4532 LGDP4535 240x320 ID=0x4535 #define SUPPORT_4535 NT35310 320x480 ID=0x5310 (hardware must be set for 8-bit parallel) NT37502 240x320 ID=0x1602 no readGRAM() or readPixel() R61505 240x320 ID=0x1505 works like an ILI9320 R61505V 240x320 ID=0xB505 R61505W 240x320 ID=0xC505 R61509V 240x400 ID=0xB509 #define SUPPORT_B509_7793 R61520 240x320 ID=0x1520 (no Vertical Scroll) R61526A 240x320 ID=0x1526 (no Vertical Scroll) configure NVM with sketch R61580 240x320 ID=0x1580 #define SUPPORT_1580 *** Untested *** R61581 320x480 ID=0x1581 RM68090 240x320 ID=0x6809 RM68130 176x220 ID=0x6813 #define SUPPORT_9225 RM68140 320x480 ID=0x6814 #define SUPPORT_68140 S6D0139 240x320 ID=0x0139 #define SUPPORT_0139 (no Band Scroll) S6D0154 240x320 ID=0x0154 #define SUPPORT_0154 SPFD5408 240x320 ID=0x5408 SPFD5420 240x400 ID=0x5420 #define SUPPORT_9326_5420 SSD1963 800x480 ID=0x1963 SSD1289 240x320 ID=0x1289 #define SUPPORT_1289 SSD1297 240x320 ID=0x9797 #define SUPPORT_1289 (unstable readGRAM()) ST7735 128x160 ID=0x7735 #define SUPPORT_7735 (untested) ST7781 240x320 ID=0x7783 #define SUPPORT_7781 (no Vertical Scroll) ST7789V 240x320 ID=0x7789 ST7793 240x400 ID=0x7793 #define SUPPORT_B509_7793 ST7796 320x480 ID=0x7796 UC8230 240x320 ID=0x8230 #define SUPPORT_8230 UNKNOWN 320x480 ID=0x1511 (scroll directions not correct) UNKNOWN 240x320 ID=0xAC11 UNKNOWN 240x320 ID=0x2053 weird controller from BangGood (was ID=0x0000) UNKNOWN 240x320 ID=0x8031 (no Vertical Scroll) UNKNOWN 240x320 ID=0x0001 (0x9320 style) UNKNOWN 240x320 ID=0x3229 readGRAM() does not work properly. NEED DATASHEET. UNKNOWN 240x320 ID=0xE300 weird controller from BangGood. NEED DATASHEET Most of these controllers are #define SUPPORT_xxxx by default. You can save Flash memory on a Uno by commenting out the macro(s) in MCUFRIEND_kbv.cpp 11. It should run on a UNO, MEGA2560, LEONARDO, DUE, ZERO, M0-PRO, It also runs on NUCLEO-F103 and TEENSY3.2 with Sparkfun Adapter 12. These Mcufriend-style shields tend to have a resistive TouchScreen on A1, 7, A2, 6 but are not always the same rotation of direction. The TouchScreen_Calibr_native.ino sketch wiil diagnose Touch Pins, do Calibration, report to Serial Terminal. The Calibration should work with the TouchScreen.h library from Adafruit. You can always copy the local TouchScreen_kbv.h library from sketch to the global user libraries folder. 13. The graphictest_kbv.ino sketch runs the standard Adafruit tests and reports the execution time. The Scroll tests show each screen rotation, colours, scroll directions, colour inversion. Vertical scroll is up/down in Portrait modes. Left/right in Landscape Band Scroll should just move the coloured Band. ILI9320 style will always move the whole screen. The text "SOFTWARE SCROLL" should move horizontally across the screen or report a readPixel() ERROR. 14. The scroll_kbv.ino sketch should scroll a window or subwindow for most chips. Not all chips can scroll. 15. The readpixel_kbv.ino sketch should display memory in each aspect. 16. The GLUE_Demo_320x240.ino sketch uses a "GLUE" class to display a UTFT sketch on supported mcufriend shields. It is NOT perfect. Please report any problems. It is designed as a CONVENIENCE for legacy UTFT code. Please use MCUFRIEND_kbv method()s in new code. 17. If you do not have a standard Uno Shield, you can add a SPECIAL to the mcufriend_special.h Edit mcufriend_shield.h: #define USE_SPECIAL Edit mcufriend_special.h: e.g. #define USE_MEGA_16BIT_SHIELD If your "special" is write-only, the library can not read the ID. It always returns 0xD3D3 18. Please run LCD_ID_readreg.ino to verify your non-standard wiring. Paste the defines to a Forum message. 19. OPEN-SMART Shields have different wiring to regular Uno Shields: Edit utility/mcufriend_shield.h: #define USE_SPECIAL Edit utility/mcufriend_special.h: #define USE_OPENSMART_SHIELD_PINOUT_xxx e.g. USE_OPENSMART_SHIELD_PINOUT_MEGA Edit MCUFRIEND_kbv.cpp: #define SUPPORT_8352B 20. OPEN-SMART Shields can not read LM75A on a Mega because there are no SDA/SCL pins next on AREF header. Uno: LM75A on pcb works. Difficult to add external I2C devices when Shield is plugged in. Uno: All use of SPI bus should use SPI.beginTransaction(), SPI.endTransaction() Leo: I do not support USE_OPENSMART_SHIELD_PINOUT_LEO Mega: Old boards do not have SDA/SCL on AREF header. Only external I2C devices on COMMS header Due: MAX809 Reset chip interferes with 3.3V RST on SPI header. Manual reset for Upload / Run. 21. BLUEPILL Adapter standard wiring is: //LCD pins |D7 |D6 |D5 |D4 |D3 |D2 |D1 |D0 | |RD |WR |RS |CS |RST| |SD_SS|SD_DI|SD_DO|SD_SCK| //STM32 pin |PA7|PA6|PA5|PA4|PA3|PA2|PA1|PA0| |PB0|PB6|PB7|PB8|PB9| |PA15 |PB5 |PB4 |PB3 | **ALT-SPI1** Maple core: to use SPI2 for SPI. edit SPI.cpp for SPIClass SPI(2); STM Core: to use SPI2 for SPI. edit variant.h to use PA15, PB3, PB4, PB5 for SPI_SS etc Touchscreen needs XM, YP to be on Analog capable pins. Measure resistance with DMM to determine X, Y 300R pair is XP, XM. 500R pair is YP, YM. choose XM, YP from PA7, PA6. XP, YM from PB6, PB7 Run the Calibration sketch to get accurate TS_LEFT, TS_RT, TS_TOP, TS_BOT values. Ignore the XP, XM, ... values. They mean nothing on a BluePill Adafruit_Touchscreen might need: typedef volatile uint32_t RwReg; Maple core: use Touchscreen_kbv library STM Core: regular Touchscreen libraries should be ok. CHANGE HISTORY: is now in "mcufriend_history.txt"