ESP32-TERM

From Land Boards Wiki
Revision as of 17:48, 16 August 2024 by Blwikiadmin (talk | contribs)
Jump to navigation Jump to search

ESP32-TERM Front 3D.png

Features

  • ESP32 Module
    • UART interface
    • Keyboard/Mouse interface
    • Drive VGA video
    • Runs FabGL ANSI/VT Terminal firmware
  • "Typical" Serial Terminal Connectors
    • Connectors down long side of the card
    • 6-bit VGA color
      • 2:2:2 R:G:B
    • PS-2 DIN keyboard connector
      • 5V PS/2 keyboard
      • 3.3V to 5V level shifters
        • Better than 5V keyboard with series resistors
      • 10K pull-ups on both sides
    • PS-2 DIN mouse connector
      • 5V PS/2 mouse
      • 3.3V to 5V level shifters
        • Better than 5V mouse with series resistors
      • 10K pull-ups on both sides
    • 5V DC on USB-B
    • Audio jack (stereo connector but mono output on both channels)
    • DE-9 Serial connector
  • "Special" connectors
    • Connectors down the short side
    • Use with cards like SIMPLE-68008 which have FTDI connections
    • FTDI connector - 6-pin
    • 5V connector
  • Programmable LED on P12
  • 145x95mm size
  • (4) 4-40 mounting holes

ESP-32 Module

ESP32 MODULE-720PX.jpg

ESP-32 Module Pinout

ESP32-Pinout.jpg

"Chip" on the module

Esp32-pinout-chip-ESP-WROOM-32.png

ESP32 Pin Usage

ESP-32 TERM Pinout Rev1.PNG

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

Connectors

P1 - VGA

  • DB-15HD connector
  • 64-colrs
  • 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
  • Voltage steps are:

VGA Sim 2R Voltage.PNG

  • Current steps are:

VGA Sim 2R Current.PNG

Video DAC LTSpice Simulation

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

VGA Sim 2R Voltage.PNG

P2 - PS/2 Keyboard

  • Purple DIN 6 connector
  • ESP32 pins
  KBDAT   => GPIO32
  KBCLK   => GPIO33

P3 - PS/2 Mouse

  • Green DIN 6 connector
  • ESP32 pins
  MSEDAT   => GPIO27
  MSECLK   => GPIO26

P4 - Audio Out

  • Wired on both pins of stereo 3.5mm Jack
  • ESP32 pins
  AUD   => GPIO25

P5 - RS-232

  • DB-9 Female
  • DCE wiring

DCE - RS-232 Connections

  • This card has a DCE connector
    • The DCE (peripheral) has the female DB-9 connector
  • The DTE (Host CPU) has the male DB-9 connector

DTE DCE.png

  • ESP-32 pins
  RX2    => GPIO34
  TX2    => GPIO2
  RTS    => GPIO13
  CTS    => GPIO35

P6 - 5V Power

  • USB-B connector
  • Power only

J1 - 5V Power Header

  • 2z3 right angle header
  • Can be used for power in or out of the card
    • Only one power source can be used with the card

J2 - FTDI Power in/out

  • Don't install jumper if an external FTDI interface is used
    • Useful to power external DTE or DCE RS-232 card

J3 - FTDI

  • Most recent (2020-02) ANSI terminal uses pin 34 for Rx
  • Pinout
  1. GND
  2. RTS (from ESP32)
  3. 5V (Power in if J2 is installed)
  4. RX (to ESP32)
  5. TX (from ESP32)
  6. CTS (to ESP32)
  • ESP32 pins
  RX2    => GPIO34
  TX2    => GPIO2
  RTS    => GPIO13
  CTS    => I35

Connections to SIMPLE-68008 Card

ESP32-TERM SIMPLE-68008
Pin Signal Pin Signal
1 GND 1 GND
2 RTS (out) 2 CTS (in)
3 +5V 3 +5V
4 RX (in) 4 TX (out)
5 TX (out) 5 RX (in)
6 CTS (in) 6 RTS (out)


Connect to FTDI card

  • Set FTDI jumper to 5V (image below shows jumper set to 5V)

FTDI rot.jpg

J5 - Serial Source Selection Header

  • Select either RS-232 connector or FTDI connector

J3 - 5V

  • 2x4 5V/GND header

Software

FabGL Arduino library

Installing the released library

FabGL Library.PNG

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

  1. 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).
  2. Move the FabGL from the Arduino libraries file folder to the desktop.
  3. Copy the FabGL from the GitHub download to the Arduino files folder (where you removed the other folder).
  4. Examples will now be the latest.
  5. Compile/download/test the new files. You know it works if you now get sound from Space Invaders.
  6. 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:

Ardino ESP32.png

Other Builds

Mechanicals

ESP32-TERM CAD REV1 bw.PNG

Assembly Sheet