Espressif made breaking changes to ESP32 Arduino Core between v2.x and v3.x which cause compilation errors in this library. The first compiler error (but not the most serious one) is:
ESP_8_BIT_composite.cpp:45:55: error: invalid conversion from 'const volatile void*' to 'volatile void*' [-fpermissive]
I am tracking the problem as issue #56 in this repository. Current workaround is to downgrade Espressif ESP32 Arduino core to v2, this library was last verified to work with v2.0.14.
The composite video generation code from SEGA emulator of ESP_8_BIT extracted and packaged into a standalone Arduino library so everyone can write Arduino sketches that output a color composite video signal. NTSC and PAL are both supported.
Huge thanks to Peter Barrett / rossumur for ESP_8_BIT, without which this library would not have been possible.
For more behind-the-scenes information on how this library came to be, see the development diary which has all the details anyone would ever want plus even more that nobody ever asked for.
- 'Newer' ESP32 (see below)
- Composite video connector to ESP32 GPIO25 video signal pin.
- Display device with composite video input port. (Usually an old-school tube TV.)
ESP32 Details
This composite video generation code is an extremely clever hack that used several ESP32 peripherals in ways they were not originally designed for. See the original author's blog documentation for details. It also means older versions of ESP32 could not run this code. I don't know exactly which Espressif errata is relevant. [UPDATE: sysytwl believes it is 3.7 Audio PLL frequency range is limited.]
Here are some data points:
- Known to work
ESP32-D0WD (revision 1)
(mine)ESP32-D0WDQ6 (revision 1)
(thanks todbot)ESP32-PICO-D4 (revision 1)
(thanks alex1115alex)
- Known to NOT work
ESP32-D0WDQ6 (revision 0)
(thanks todbot)
Chip identification obtained from ESPTool
with the command esptool chip_id
Pushing hardware limits in this manner may restrict this library to a subset of the ESP32 family. This library was developed and tested against the original suffix-free ESP32. Compatiblity with variants (ESP32-S2, ESP32-S3, etc.) are untested and unknown.
- Adafruit GFX Library available from Arduino IDE Library Manager. (Last verified to work with v1.11.9)
- Espressif Arduino Core for ESP32, follow installation directions at that link. (Last verified to work with v2.0.14)
- (Optional) AnimatedGIF, for displaying animated GIF files. (Last verified to work with v1.4.7)
- Arduino IDE of course. (Last verified to work with v2.2.1)
Here's an Arduino IDE screenshot of my ESP32 configuration:
This library is NOT compatible with the "Arduino ESP32 Boards by Arduino" board library. (thanks JLBCS for #44) Compilation will fail with the following error:
ESP_8_BIT_composite.h:48:10: fatal error: driver/dac.h: No such file or directory
#include "driver/dac.h"
^~~~~~~~~~~~~~
This library can now be installed from within the Arduino desktop IDE via the Library Manager. Listed as "ESP_8_BIT Color Composite Video Library"
It can also be installed from this GitHub repository if desired:
- Download into a folder named "ESP_8_BIT_composite" under your Arduino IDE's
libraries
folder. - Restart Arduino IDE.
ESP_8_BIT_GFX
offers high-level drawing commands via the Adafruit GFX API. Easy to use, but not the highest performance.ESP_8_BIT_composite
exposes low-level frame buffer for those who prefer to manipulate bytes directly. Maximum performance, but not very easy to use.