Switch branches/tags
Nothing to show
Find file History
Latest commit fe05aec Aug 24, 2018
Failed to load latest commit information.
assets Add files via upload Aug 24, 2018
examples Add files via upload Apr 19, 2018
src Add files via upload Mar 14, 2018
README.md Add files via upload Mar 14, 2018
library.properties Add files via upload Mar 14, 2018


HDMI Shield

is an Arduino compatible development board to bridge the gap between small MCUs and High Definition Television (HDTV). HDTVs or Full HD monitors with HDMI/DVI interface require a pixel clock of 148MHz for 1080p resolution. Without an Application Specific IC (ASIC) this pixel clock is out of reach from small MCUs.

HDMI shield solves this problem in two steps:

(1) A TFT controller RA8876 is used to generate RGB video in 8:8:8 format. This controller supports various AP interfaces including 4-wire SPI, 8080 16/8-bit, and I2C. Multiple display buffers in SDRAM together with 2D BitBlit engine are used to avoid direct pixel rendering. For example instead of writing individual pixels for the whole screen of 1280*720 in 16 bit-per-pixel, we only need to write simple commands (through SPI, say) to define the foreground color, window size, then finally enable a certain bit for the solid-fill register. The job of pixel rendering will be handled by hardware in a flicker-free manner. If we need to display full color pictures, there is a free image conversion tool to export binary files from jpeg/bmp/png images. The binary files can be copied to a microSD card or preloaded to Serial Flash onboard. With 256Mbit SDRAM, we can allocate 1280x720x2bytes (say) as the main window (visible region) and make the rest as frame buffer. This is equivalent to more than 16 pages for graphic assets storage. Binary data stored in microSD will be copied to frame buffer in booting phase and the data can be moved from frame buffer to the main window by 2D BitBlit, again in a flicker-free operation.There are more features like DMA transfer from Serial Flash to SDRAM, font rendering from embedded characters and Genitop font chip, picture-in-picture, and hardware accelerated shape-draw are all available for small MCUs now.

(2) HDMI encoder CH7035B is used to convert RGB video to differential signals (TMDS) required by HDMI specification. This encoder has an internal frame buffer to boost 8:8:8 RGB to Full HD 1080p (1920*1080) at 60Hz max. In this repository there are several common video formats (e.g. 640x480, 800x480, 720x576, 1280x720 etc) generated by RA8876; that RGB video will be converted to VESA/CEA-861 compatible HDTV standard. Header file videoInOutMap.h is found under /src/HDMI folder. Parameters specified in this header are used to initialize CH7035B via I2C interface for different HDMI/DVI output resolutions if you are not interested to use the Boot ROM CH9904 for 1080p output.

Remarks: Although it is possible to boost a 480x272 RGB video to 1920x1080 HDMI in theory, actual experiments showed blurry screens.
Those "in-n-out" parameters in videoInOutMap.h generate good looking result by an one-step boost.

How is the performance?

Take a look at this YouTube video

Source code includes :

RA8876 & CH7035B drivers in C++. Arduino compatible library and examples are available, and libraries for mbed and Microchip Harmony Framework will be developed. Up to time of writing the following platforms have been tested:

  1. ESP8266 on an Arduino form factor PCB (Due Zipper Board DTE20171024). With HDMI Shield stacking on this board you will be able to run all examples in this repository.
  2. ESP32-PICO-KIT wired up by jumper cables. It is messy, I know! But there are two SPI ports with ESP32, HSPI and VSPI.
    Successfully using HSPI for microSD, and VSPI for RA8876 for a significant performance boost in reading data from SD.
    Don't forget ESP32 is a WiFi and Bluetooth SoC. It is possible to develop applications for IoT with real-time data displayed on a HDTV.
  3. Arduino DUE with the same Due Zipper Board DTE20171024 by shorting 2.00mm jumpers on P13.
  4. Teensy 3.2 and 3.5 with a simple stacker PCB (Teensy Stacker DTE20171030). Teensy is providing the best Audio library for Arduino platform in my opinion. WAV file playback is used in the example Ra8876_allegro_bruce_xflash.ino for a very famous Bruce Lee movie sound track as the background music while three gif animations are played. You will need a HDTV or FHD monitor with HDMI interface to hear this.
  5. Arduino M0. This is the only M0 board with me! Single USB port for program upload and Serial Monitor onboard. As a result, some changes are required to use this board if you want to debug from Serial Monitor. Need to replace Serial with SerialUSB in *.ino file and printf.h in /src/util folder. If you have a M0 PRO board with dual USB ports no change is required. No extra hardware is required for Arduino M0. Direct stack HDMI Shield to Arduino M0/M0 PRO is OK.
  6. Arduino Genuino 101. Direct stack HDMI Shield to 101 board is OK.
    Partially work for this platform. Allegro library is not working for some unknown reason. Known bug with printf for this platform too. Leading to problems with examples Ra8876_allegro_bruce_xflash.ino, Ra8876_allegro_sprite.ino, and some debug features for Ra8876_primitive_test.ino via Serial Monitor.
  7. RA8876/77 AP Board with AP firmware preloaded with MCU STM32F103VET6 onboard.
    Firmware compatible with RAiO's official AP software has been preloaded. You can find out the display quality with direct control on RA8876 and get images from your PC displayed on HDTV of HDMI-1080p.

    Important: HDMI Shield is a 3.3V system. Don't use a 5V Arduino otherwise it will be damaged.

Folder structure :

	README.md (this file)

Start with Ra8876_primitive_test.ino Arduino example. I am using version 1.8.1 for development in my lab.
Comprehensive comments have been added in each example.
Copy this library to your library folder at C:\Users\YOUR NAME\Documents\Arduino\libraries.

Updated 14-03-2018

Written by John Leung @ TechToys Co. Hong Kong
email: john@techtoys.com.hk