Simple demo for the Raio RA8875 Based Display with a 4-wire SPI interface.
RA8875 Based Display Controller
This page shows a simple demo program for a graphics library supporting a low cost display from buydisplay.com. While the module can be configured for support via I2C, 3-Wire SPI, 4-Wire SPI, 8-bit Parallel or 16-bit Parallel, the companion library only supports the 4-Wire SPI.
You can also find this display on the Components | RA8875 page.
Library
Display Pictures
While this image is sharp, the camera/lighting washed out the colors somewhat.
With careful study of the image below, you can see a number of solder-blob jumpers. These jumpers are described quite well in the manual, and configure the many different options. The specific unit shown here is the "entry point" model, it does not have touchscreen, SD card, extra Font memory, or the key pad interface. As you see in the top left, it is wired with an 8-signal ribbon cable (but note in the schematic that it only needs 6 as the two power and two ground are internally connected together in the module).
Also note, that some configuration changes go beyond the jumpers. I decided to switch my configuration to 4-Wire SPI and had to remove R1, R2, and R3 (which were zero-ohm that shorted the SPI input pins to +v!). I also changed some of the solder-blob jumpers, but that was easy. Had I ordered the display with the support for 4-Wire SPI, that would not have been necessary.
Schematic
The library should be able to work with any SPI port, and the Chip Select pin is a simple DigitalOut pin, chosen from the unused pins on my baseboard.
Sample Program
#include "mbed.h" #include "RA8875.h" Serial pc(USBTX, USBRX); int main() { pc.baud(460800); // I like a snappy terminal, so crank it up! pc.printf("\r\nRA8875 Test - Build " __DATE__ " " __TIME__ "\r\n"); RA8875 lcd(p5, p6, p7, p12, NC, "tft"); // MOSI, MISO, SCK, /ChipSelect, /reset, name lcd.puts(0,0, "RA8875 lcd(p5, p6, p7, p12, NC, \"tft\");\r\n\r\n" "lcd.circle( 400,25, 25, BrightRed);\r\n" "lcd.fillcircle( 400,25, 15, RGB(128,255,128));\r\n" "lcd.ellipse( 440,75, 35,20, BrightBlue);\r\n" "lcd.fillellipse( 440,75, 25,10, Blue);\r\n" "lcd.triangle( 440,100, 475,110, 450,125, Magenta);\r\n" "lcd.filltriangle( 445,105, 467,111, 452,120, Cyan);\r\n" "lcd.rect( 400,130, 475,155, Brown);\r\n" "lcd.fillrect( 405,135, 470,150, Pink);\r\n" "lcd.roundrect( 410,160, 475,190, 10,8, Yellow);\r\n" "lcd.fillroundrect(415,165, 470,185, 5,3, Orange);\r\n" "lcd.line( 430,200, 460,230, RGB(0,255,0));\r\n" "for (i=0; i<=30; i+=5)\r\n" " lcd.pixel(435+i,200+i, White);"); lcd.circle( 400,25, 25, BrightRed); lcd.fillcircle( 400,25, 15, RGB(128,255,128)); lcd.ellipse( 440,75, 35,20, BrightBlue); lcd.fillellipse( 440,75, 25,10, Blue); lcd.triangle( 440,100, 475,110, 450,125, Magenta); lcd.filltriangle( 445,105, 467,111, 452,120, Cyan); lcd.rect( 400,130, 475,155, Brown); lcd.fillrect( 405,135, 470,150, Pink); lcd.roundrect( 410,160, 475,190, 10,8, Yellow); lcd.fillroundrect(415,165, 470,185, 5,3, Orange); lcd.line( 430,200, 460,230, RGB(0,255,0)); for (i=0; i<=30; i+=5) lcd.pixel(435+i,200+i, White); while (1) ; }
History
Pick up a bug-fix on jpeg rendering
2020-03-29, by WiredHome [Sun, 29 Mar 2020 18:14:58 +0000] rev 21
Pick up a bug-fix on jpeg rendering
Breaking change update to RA8875 Library. Improved APIs, Improved Portrait Mode, Code Cleanup.
2020-03-28, by WiredHome [Sat, 28 Mar 2020 15:30:29 +0000] rev 20
Breaking change update to RA8875 Library. Improved APIs, Improved Portrait Mode, Code Cleanup.
Update demo to latest lib
2019-07-28, by WiredHome [Sun, 28 Jul 2019 02:45:20 +0000] rev 19
Update demo to latest lib
Update RA8875 Lib to add GSL1680 support.
2019-03-04, by WiredHome [Mon, 04 Mar 2019 12:09:46 +0000] rev 18
Update RA8875 Lib to add GSL1680 support.
Update libs. RA8875 v148, mbed v137.; Any newer mbed lib works ok for graphics, fails for file write to local file system for printscreen.
2017-08-06, by WiredHome [Sun, 06 Aug 2017 15:06:08 +0000] rev 17
Update libs. RA8875 v148, mbed v137.; Any newer mbed lib works ok for graphics, fails for file write to local file system for printscreen.
Updates verified with mbed v128, RA8875 v148
2017-08-06, by WiredHome [Sun, 06 Aug 2017 13:40:24 +0000] rev 16
Updates verified with mbed v128, RA8875 v148
Update to latest libraries and test with both 480x272 and 800x480 screens.
2016-08-06, by WiredHome [Sat, 06 Aug 2016 14:50:48 +0000] rev 15
Update to latest libraries and test with both 480x272 and 800x480 screens.
Updated RA8875 and mbed libraries
2016-05-03, by WiredHome [Tue, 03 May 2016 10:52:01 +0000] rev 14
Updated RA8875 and mbed libraries
Updated libs and tested both 8 and 16-bpp.
2016-03-05, by WiredHome [Sat, 05 Mar 2016 19:24:18 +0000] rev 13
Updated libs and tested both 8 and 16-bpp.
update libs
2016-01-23, by WiredHome [Sat, 23 Jan 2016 17:55:47 +0000] rev 12
update libs