Difference between revisions of "ESP32-VGA"
Jump to navigation
Jump to search
Blwikiadmin (talk | contribs) |
Blwikiadmin (talk | contribs) |
||
Line 357: | Line 357: | ||
CS => GPIO13 | CS => GPIO13 | ||
</pre> | </pre> | ||
+ | |||
+ | == VGA - Ideal Drive 2:2:2 Case == | ||
+ | |||
+ | * Ideal case drive current | ||
+ | ** 1V into 75 Ohms = 13.33 mA | ||
+ | ** 3.3V driver which can drive more than 10 mA | ||
+ | ** [http://www.brannonelectronics.com/images/STANDARD%20VALUE.pdf 1% resistors] | ||
+ | *** Get closest values | ||
+ | *** R-2R values | ||
+ | ** 2/3 of the drive comes from the smaller resistor | ||
+ | ** Ideal resistor values are [https://www.mouser.com/ProductDetail/Yageo/RC0805FR-07261RL?qs=%2Fha2pyFadugqH4HCO4leff4CZT3WBMKXJZMR3j%2FknJZa3N317Wcf%2Fw%3D%3D 261], [https://www.mouser.com/ProductDetail/Yageo/RC0805FR-07523RL?qs=sGAEpiMZZMu61qfTUdNhG6gKAQVNBKOo7pp9l1AJ1rM%3D 523] ohms | ||
+ | *** 0V, 0.331V, 0.661V, 0.992 V | ||
+ | |||
+ | [[File:VGA_Sim_2R_Voltage_ESP32-IdealRes.PNG]] | ||
== FabGL GPIOs assignment summary - fabgl dev board rev2 == | == FabGL GPIOs assignment summary - fabgl dev board rev2 == |
Revision as of 14:22, 17 February 2020
Contents
- 1 Features
- 2 Video DAC LTSpice Simulation
- 3 Headers (Rev 1 board)
- 4 Connectors (Rev 1 board)
- 5 Headers (Rev 2 board)
- 6 Connectors (Rev 2 board)
- 7 VGA - Ideal Drive 2:2:2 Case
- 8 FabGL GPIOs assignment summary - fabgl dev board rev2
- 9 Software
- 10 Schematic
- 11 Rev 2 Changes
- 12 Prototype
- 13 Assembly Sheet
Features
- ESP32 Module
- 6-bit VGA color
- 2:2:2 R:G:B
- 2 x PS-2 DIN connectors
- 5V mouse/keyboard
- 3.3V to 5V level shifters
- Better than 5V keyboard with series resistors
- 10K pull-ups on both sides
- 2 x FTDI connectors
- 5V DC Jack
- 3.3V regulator (optional)
- GVS pins for extra ESP32 pins
- 95x95mm form factor
- 6-32 mounting holes
ESP-32 Module
- Uses the ESP32 DevKit ESP32-WROOM GPIO Pinout
- On board Blue LED = Arduino Pin 2
- There are various modules out there with different pinouts, but this card uses this one
ESP-32 Module Pinout
"Chip" on the module
ESP32 Pin Usage - Rev 1
ESP32 Pin Usage - Rev 2
Module Features
- Architecture: Xtensa Dual-Core 32-bit LX6
- CPU frequency: up to 240MHz
- Total RAM available: 528KB (part of it reserved for system)
- BootROM: 448KB
- Internal FlashROM: none
- External FlashROM: code and data, via SPI Flash; usual size 4MB
- GPIO: 34 (GPIOs are multiplexed with other functions, including external FlashROM, UART, etc.)
- UART: 3 RX/TX UART (no hardware handshaking), one TX-only UART
- SPI: 4 SPI interfaces (one used for FlashROM)
- I2C: 2 I2C (bitbang implementation available on any pins)
- I2S: 2
- ADC: 12-bit SAR ADC up to 18 channels
- DAC: 2 8-bit DACs
- RMT: 8 channels allowing accurate pulse transmit/receive
- Programming: using BootROM bootloader from UART - due to external FlashROM and always-available BootROM bootloader, the ESP32 is not brickable
Video DAC LTSpice Simulation
- Video DAC Simulation files
- Video is 2:2:2 - R:G:B
Summing Resistor DAC
- 5% resistors are "good enough"
- 1V into 75 Ohm VGA load
- 3.3V drive
- ESP32 has 40 mA drive
- Uses 10 mA (max)
- R4 = 1.2 mA to -10 mA
- R3 = 1.1 mA to -5.3 mA
- Output in 4 steps
- 0V
- 0.3V
- 0.65V
- 0.96V
Headers (Rev 1 board)
H1 - 3.3V SRC select
- 1-2 = Get 3.3V from ESP32 on-board regulator
- 2-3 = Get 3.3V from on-board regulator (Default)
H2 - 5V SRC Select Jumper (Rev 1 Board)
- 5V power options for the 5V to 3.3V regulator
- 2x4 header
- Care must be taken to install the correct jumpers
- USB jumper sends out 5V when a USB cable is connected to the ESP32 module
Power from DC Jack
- Do not connect USB cable when the DC jack is used
- 1-2 = VUSB - Install - Power to ESP32
- 3-4 = DCIN - Install - Power comes from DC jack
- 5-6 = FTDI5V_1 - Do not install
- 7-8 = FTDI5V_2 - Do not install
Power from USB on ESP32 module
- 1-2 = VUSB - Install - 5V comes from USB on ESP32 module
- 3-4 = DCIN - Do not install
- 5-6 = FTDI5V_1 - Do not install
- 7-8 = FTDI5V_2 - Do not install
Power from FTDI #1 (Rev 1)
- Do not use this position with "most" FTDI cards since they will drive 5V on the Rx/Tx pins
Power from FTDI #2
- Do not use this position with "most" FTDI cards since they will drive 5V on the Rx/Tx pins
Connectors (Rev 1 board)
P2/P4 = GVS - Rev 1
- Ground/Voltage/Signal lines
- GPIO13
- GPIO14
- GPIO16
- GPIO17
- GPIO35
- GPIO34
- VN
- VP
P3 - VGA - Rev 1
- ESP32 pins
HSync => GPIO23 VSync => GPIO15 R0 => GPIO22 R1 => GPIO21 G0 => GPIO19 G1 => GPIO18 B0 => GPIO5 B1 => GPIO4
J2 - FTDI #1 - Rev 1
- GND
- RTS (Not used)
- 5V (Power in if H2 is configured)
- RX (from card to External FTDI)
- TX (from External FTDI to card)
- CTS (Not used)
Connect to FTDI card - Rev 1
- Set FTDI jumper to 3.3V (unlike picture below)
- Cross-over pins 4 and 5 when connecting to FTDI card (Rev 1 only)
J6 - FTDI #2 - Rev 1
- Rev 1 board won't program or boot with FDTI #2 card attached
- This interface is in common with the USB-to-Serial interface on the ESP32 module
- GND
- RTS (Not used)
- 5V (Power in if H2 is configured)
- RX (from card to External FTDI)
- TX (from External FTDI to card)
- CTS (Not used)
Connect to FTDI card - Rev 1
- Set FTDI jumper to 3.3V
- Cross-over pins 4 and 5 when connecting to FTDI card (Rev 1 only)
J3 - PS/2 Keyboard - Rev 1
- Purple DIN 6 connector
- ESP32 pins
DAT => 32 CLK => 33
J4 - PS/2 Mouse - Rev 1
- DIN 6 connector
- ESP32 pins
DAT => 27 CLK => 26
J5 - Audio Out - RCA Jack - Rev 1
- ESP32 pins
AUD => 25
J6 - UART2 - Rev 1
- Most recent (2020-02) ANSI terminal uses pin 34
RX => 12 TX => 2
J15 - 5mm Terminal Block - Rev 1
- 5V
- Gnd
Headers (Rev 2 board)
H1 - 5V - Rev 2
- Power board from either the DC Jack or ESP32 USB power
- Do not power from 5V Power jack and connect USB cable to the ESP32 module at the same time
- ESP32 module has blocking diode to protect the module
H2/H3 - GVS - Rev 2
- 3x4 header
- Ground/Voltage/Signal lines
- GPIO35
- GPIO12
- VN/I39
- VP/I36
Connectors (Rev 2 board)
P1 - PS/2 Mouse - Rev 2
- DIN 6 connector
- ESP32 pins
DAT => GPIO27 CLK => GPIO26
P2 - PS/2 Keyboard - Rev 2
- Purple DIN 6 connector
- ESP32 pins
DAT => GPIO32 CLK => GPIO33
P3 - VGA - Rev 2
- ESP32 pins
HSync => GPIO23 VSync => GPIO15 R0 => GPIO22 R1 => GPIO21 G0 => GPIO19 G1 => GPIO18 B0 => GPIO5 B1 => GPIO4
P4 - Audio Out - RCA Jack - Rev 2
- ESP32 pins
AUD => GPIO25
J1 - 5V Power - Rev 2
- Center +5V
J2 - FTDI #1 - Rev 2
- This interface is in common with the USB-to-Serial interface on the ESP32 module
- GND
- RTS (Not used)
- 5V (Not used)
- RX (from card to External FTDI)
- TX (from External FTDI to card)
- CTS (Not used)
- Most recent (2020-02) ANSI terminal uses pin 34
RX => GPIO3 TX => GPIO1
Connect to FTDI card - Rev 2
- Set FTDI jumper to 3.3V
J3 - FTDI #2 - Rev 2
- GND
- RTS (Not used)
- 5V (Power in if H2 is configured)
- RX (from card to External FTDI)
- TX (from External FTDI to card)
- CTS (Not used)
RX => GPIO34 TX => GPIO2
Connect to FTDI card - Rev 2
- Set FTDI jumper to 3.3V
- Cross-over pins 4 and 5 when connecting to FTDI card (Rev 1 only)
J4 - SD Card - Rev 2
- Brought to GVS header pins (Rev 1)
- Brought to SD Card (Rev 2)
MOSI => GPIO17 MISO => GPIO16 CLK => GPIO14 CS => GPIO13
VGA - Ideal Drive 2:2:2 Case
- Ideal case drive current
- 1V into 75 Ohms = 13.33 mA
- 3.3V driver which can drive more than 10 mA
- 1% resistors
- Get closest values
- R-2R values
- 2/3 of the drive comes from the smaller resistor
- Ideal resistor values are 261, 523 ohms
- 0V, 0.331V, 0.661V, 0.992 V
FabGL GPIOs assignment summary - fabgl dev board rev2
I2C (not usable with VGA)
SDA => GPIO4 (conflicts with VGA B1) SCL => GPIO15 (conflicts with VGA VSync)
SPI Display - VSPI (not usable with VGA)
CLK => GPIO18 (conflicts with VGA G1) MISO => GPIO19 (conflicts with VGA G0) MOSI => GPIO23 (conflicts with VGA HSync) CS => GPIO5 (conflicts with VGA B0) D/C => GPIO22 (conflicts with VGA R0) RESET => GPIO21 (conflicts with VGA R1)
Software
Arduino Programming
- Board : "DOIT ESP32 DEVKIT V1"
FabGL
- Display Controller features/applications
- VGA
- SSD1306
- PS/2 Mouse and Keyboard Controller
- Graphics Library
- Sound Engine
- Game Engine
- ANSI/VT Terminal for the ESP32
FabGL Libraries
- FabGL - ESP32 Display Controller and Graphics Library
- FabGL Github repo
FabGL Arduino library
Installing the released library
Using Latest FabGL builds
Here's how I did it
- Install drivers via Arduino from the Library Manager. These are not the latest files. Space Invaders should run but not have sound (as of now because it's the older version).
- Move the FabGL from the Arduino libraries file folder to the desktop.
- Copy the FabGL from the GitHub download to the Arduino files folder (where you removed the other folder).
- Examples will now be the latest.
- Compile/download/test the new files. You know it works if you now get sound from Space Invaders.
- Save as where you would normally save your Arduino sketches.
MicroPython
- MicroPython Homepage
- GitHub repo (MicroPython)
ESP-IDF
Operating Systems
- FreeRTOS
- ESP32 DevKit v1
- LuaNode
- ESP32 DEVKITV1 module schematics (also helpful discussion)
Schematic
Rev 2 Changes
- Rev 1 board won't program or boot with FDTI #2 card attached
- Swap FTDI pins 4 and 5 (J2 and J6)
- Allow direct connect to FTDI card (no swap)
- Move FTDI Rx line (GPIO12 to GPIO34)
- Earlier FabGL had previos connection
- Add SD Card connector
- MISO => GPIO 16
- MOSI => GPIO 17
- CLK => GPIO 14
- CS => GPIO 13
- Remove I/O pins from GVS connector
- Replace H1/H2 with 1x2 to select/remove DC jack power
- Change ESP32 silkscreen
- SD card
- VGA High/Low lines backwards on silkscreen
Prototype
- ESP32-I2C-HUB
- VGAX49
- PS2X49
- Purple = Keyboard
- Green = Mouse
- 95mm to 49mm Adapter card
- 6-32/4-40 Standoffs, screws, nuts
- Cabling