[{"data":1,"prerenderedAt":105},["ShallowReactive",2],{"example-page-esp32-vga":3},{"id":4,"info":5,"parts":6,"wired":15,"refs":16,"nets":17,"moreNets":99,"code":100},"esp32-vga","An ESP32-DevKitC generates VGA with FabGL: I2S1 sends the picture by DMA in LCD mode, eight bits in parallel, at 25.175 MHz. Two GPIOs per colour go through the resistor DAC (270 Ω for the high bit, 470 Ω for the low one) to the DE-15 socket, HSYNC and VSYNC directly; the monitor on its cable recognises 640×400 at 70 Hz and shows the terminal in the display panel. The sketch prints a line every 500 ms; change it in the code editor (FabGL 1.0.9, GPL-3.0, with our patch for Arduino-ESP32 3.x). The scope on the VGA lines sees the colours and HSYNC sampled at the simulation step (every 50 µs) and VSYNC at 70 Hz with exact edges.",[7,10,13],[8,9],"resistor",6,[11,12],"esp32_devkitc",1,[14,12],"vga_monitor",false,{"A1":11,"J1":14,"R6":8,"R5":8,"R4":8,"R3":8,"R2":8,"R1":8},[18,26,32,40,47,54,61,68,74,80,87,93],{"name":19,"pins":20},"0",[21,24],[22,23],"A1","GND",[25,23],"J1",{"name":27,"pins":28},"VSYNC",[29,31],[22,30],"GPIO15",[25,27],{"name":33,"pins":34},"B0",[35,37],[22,36],"GPIO4",[38,39],"R6","1",{"name":41,"pins":42},"B1",[43,45],[22,44],"GPIO5",[46,39],"R5",{"name":48,"pins":49},"BLUE",[50,51,53],[25,48],[46,52],"2",[38,52],{"name":55,"pins":56},"G0",[57,59],[22,58],"GPIO18",[60,39],"R4",{"name":62,"pins":63},"G1",[64,66],[22,65],"GPIO19",[67,39],"R3",{"name":69,"pins":70},"GREEN",[71,72,73],[25,69],[67,52],[60,52],{"name":75,"pins":76},"HSYNC",[77,79],[22,78],"GPIO23",[25,75],{"name":81,"pins":82},"R0",[83,85],[22,84],"GPIO21",[86,39],"R2",{"name":88,"pins":89},"R1",[90,92],[22,91],"GPIO22",[88,39],{"name":94,"pins":95},"RED",[96,97,98],[25,94],[88,52],[86,52],0,{"file":101,"lang":102,"text":103,"lines":104,"more":15},"sketch.ino","cpp","\u002F\u002F ESP32 VGA terminal with FabGL: 640x400 at 70 Hz, 16 colours (640x480 needs more memory than an\n\u002F\u002F ESP32 without PSRAM has free: FabGL then shortens the screen). The picture comes out of I2S1 by\n\u002F\u002F DMA on the pins of the usual FabGL board: red GPIO22\u002F21, green GPIO19\u002F18, blue GPIO5\u002F4 (high bit\n\u002F\u002F first, each through the resistor DAC), HSYNC GPIO23, VSYNC GPIO15.\n#include \"fabgl.h\"\n\nfabgl::VGA16Controller DisplayController;\nfabgl::Terminal        Terminal;\n\nvoid setup() {\n  Serial.begin(115200);\n  DisplayController.begin();\n  DisplayController.setResolution(VGA_640x400_70Hz);\n  Terminal.begin(&DisplayController);\n  Terminal.enableCursor(true);\n  Terminal.write(\"\\e[44;97m\\e[2J\\e[H\");     \u002F\u002F white on blue, clear the screen\n  Terminal.write(\"\\e[1mESP32 VGA terminal\\e[0m\\e[44;97m (FabGL, 640x400, 16 colours)\\r\\n\\n\");\n  Serial.printf(\"VGA started: %d x %d\\n\", DisplayController.getViewPortWidth(), DisplayController.getViewPortHeight());\n}\n\nvoid loop() {\n  static int n = 0;\n  Terminal.printf(\"\\e[93mline %d\\e[97m  uptime %lu ms\\r\\n\", n++, millis());\n  Serial.printf(\"line %d\\n\", n);\n  delay(500);\n}",26,1796304400981]