ESP32-TERM
Revision as of 09:47, 15 August 2024 by Blwikiadmin (talk | contribs) (Created page with "file:ESP32-TERM_Front_3D.png == Features == * ESP32 Module ** 18 Analog-to-Digital Converter (ADC) channels ** 10 Capacitive sensing GPIOs ** 3 UART interfaces ** 3...")
Contents
Features
- ESP32 Module
- 18 Analog-to-Digital Converter (ADC) channels
- 10 Capacitive sensing GPIOs
- 3 UART interfaces
- 3 SPI interfaces
- 2 I2C interfaces
- 16 PWM output channels
- 2 Digital-to-Analog Converters (DAC)
- 2 I2S interfaces
- 6-bit VGA color
- 2:2:2 R:G:B
- PS-2 DIN keyboard connector
- 5V keyboard
- 3.3V to 5V level shifters
- Better than 5V keyboard with series resistors
- 10K pull-ups on both sides
- FTDI connectors
- 5V DC Jack
- 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 - Revs 2, 3
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 Video Resistor DAC
- Best values (1%)
- 422, 845
- 470, 820 are close/standard values
- 0.7V into 75 Ohm VGA load
- 3.3V drive
- ESP32 has 40 mA drive
- Uses 8 mA (max)
- Output in 4 equal voltage steps
Headers
H1 - FTDI Power in/out
- Don't install jumper if an external FTDI interface is used
Connectors
P1 - VGA
- DB-15HD connector
- ESP32 pins
HSync => GPIO23 VSync => GPIO15 R0 => GPIO22 R1 => GPIO21 G0 => GPIO19 G1 => GPIO18 B0 => GPIO5 B1 => GPIO4
VGA - Resistor Selection
- ESP32 has a 3.3V driver which can drive more than 10 mA
- Ideal case drive current
- 0.7V (full scale VGA level) into 75 Ohms = 9.33 mA
- 2/3 of the current or 6.16 mA comes from the lower value resistor (digital most significant bit)
- 1/3 of the current or 3.08 mA comes from the higher value resistor (digital least significant bit)
- R-2R values
- Ideal resistor values are 417.9 ohms and 835.7 ohms
- Standard value 1% resistors
- 1% standard values are 422 (Mouser), 845 (Mouser) Ohms
- Get closest values
- 0V, 0.228V, 0.460V, 0.693V
- Voltage steps are:
- Current steps are:
P2 - PS/2 Keyboard
- Purple DIN 6 connector
- ESP32 pins
KBDAT => GPIO32 KBCLK => GPIO33
P3 - Audio Out
- Wired on both pins of stereo 3.5mm Jack
- ESP32 pins
AUD => GPIO25
J1 - 5V Power
- Center +5V barrel connector
J2 - FTDI #2
- Most recent (2020-02) ANSI terminal uses pin 34 for Rx
- Pinout
- GND
- RTS (Not used)
- 5V (Power in if H1 is configured
- RX (to ESP32)
- TX (from ESP32)
- CTS (Not used)
RX2 => GPIO34 TX2 => GPIO2
Connect to FTDI card
- Set FTDI jumper to 3.3V (image below shows jumper set to 5V which is wrong)
J3 - 5V
- 2x4 5V/GND header
J4 - SD Card
- Brought to SD Card
MOSI => GPIO17 MISO => GPIO16 CLK => GPIO14 CS => GPIO13
FabGL GPIOs assignment summary - fabgl dev board rev2
VGA HSync => 23 VSync => 15 R0 => 21 R1 => 22 G0 => 18 G1 => 19 B0 => 4 B1 => 5 Audio AUD => 25 PS/2 - Keyboard DAT => 32 CLK => 33 PS/2 - Mouse (Not used) DAT => 27 CLK => 26 SDCard - HSPI MOSI => 17 (12 on TTGO/WROVER) MISO => 16 (2 on TTGO, 35 WROVER) CLK => 14 CS => 13 UART - UART1 (USB - not used) RX => 3 TX => 1 UART - UART2 RX => 34 TX => 2 (not usable on TTGO/WROVER with SDCard active)
Software
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
- ESP32 ALTAIR EMULATOR GETS SPLIT PERSONALITY - Hackaday page
FabGL Arduino library
Installing the released library
Using Latest FabGL builds
- Fabrizio does a nice job of keeping his Arduino libraries up to date but if you want a bleeding edge experience, you can download his code from GitHub. Note, he's in active development so things often change.
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.
Arduino Programming
- Installing the ESP32 Board in Arduino IDE (Windows, Mac OS X, Linux)
- Board : "DOIT ESP32 DEVKIT V1"
- Used Board : ESP32 Dev Module with Tools > Partition Scheme > Huge APP option to run VIC-20 (2022-09)
- DOIT module does not have PSRAM
- Can't run PC Emulator without PSRAM
- If you try to upload a new sketch to your ESP32 and you get this error message “A fatal error occurred: Failed to connect to ESP32: Timed out… Connecting…“. It means that your ESP32 is not in flashing/uploading mode.
- Press the “Upload” button in the Arduino IDE to upload your sketch
- After you see the “Connecting….” message in your Arduino IDE, release the finger from the “BOOT” button:
MicroPython
- MicroPython Homepage
- GitHub repo (MicroPython)
ESP-IDF
Operating Systems
- FreeRTOS
- ESP32 DevKit v1
- LuaNode
- ESP32 DEVKITV1 module schematics (also helpful discussion)