Cov txheej txheem:

ESP32 Handheld Game Console: 21 Kauj Ruam (nrog Duab)
ESP32 Handheld Game Console: 21 Kauj Ruam (nrog Duab)

Video: ESP32 Handheld Game Console: 21 Kauj Ruam (nrog Duab)

Video: ESP32 Handheld Game Console: 21 Kauj Ruam (nrog Duab)
Video: ESP32 Handheld Console Assembly Part 1 2024, Hlis ntuj nqeg
Anonim
Image
Image
Kev Npaj Kho Vajtse
Kev Npaj Kho Vajtse

Cov lus qhia no qhia yuav siv ESP32 thiab ATtiny861 li cas los tsim NES emulator game console.

Kauj Ruam 1: Kev Npaj Kho Vajtse

Kev Npaj Kho Vajtse
Kev Npaj Kho Vajtse
Kev Npaj Kho Vajtse
Kev Npaj Kho Vajtse

ESP32 Dev Board

Lub sijhawm no kuv tab tom siv TTGO T8 ESP32 dev board. Pawg thawj coj no tau teeb tsa hauv Lipo them nyiaj thiab tswj hwm Circuit, nws tuaj yeem pab txo qis ntxiv.

Zaub

Lub sijhawm no kuv tab tom siv 2.4 IPS LCD. Tus tswj kev tsav tsheb yog ST7789V thiab kev daws teeb meem yog 320 x 240. Qhov kev daws teeb meem no zoo tshaj plaws rau NES emulator 252 x 224 daws teeb meem.

Roj teeb

Lub sijhawm no kuv siv 454261 Lipo roj teeb. 4.5 hli yog tuab ntawm ESP32 dev board, thiab 61 mm yog qhov dav ntawm pawg thawj coj saib.

Tus Pin Header

4 tus pin txiv neej hloov tus pin header thiab 4 tus pin poj niam puag ncig tus pin header rau txuas I2C gamepad.

PETG Phaj

Ib lub phaj PET/PETG me me los txhawb nqa pawg dev thiab Lipo roj teeb, koj tuaj yeem yooj yim pom nws hauv cov khoom ntim khoom.

Ntau Lub Hom Phiaj PCB

2 PCB xav tau, 1 0.4 mm tuab rau txhawb nqa Zaub, 1 1.2 mm tuab rau I2C gamepad.

Nyees khawm

A 5 cov lus qhia khawm, 2 khawm me me rau Xaiv thiab Pib thiab 2 rau A thiab B khawm.

I2C Gamepad Controller

Lub sijhawm no kuv siv ATtiny861 microcontroller ua I2C gamepad maub los.

Lwm tus

1 SMD 12 Ohm resistor, ISP programmer (piv txwv li TinyISP)

Kauj Ruam 2: Kev Npaj Software

Kev Npaj Software
Kev Npaj Software
Kev Npaj Software
Kev Npaj Software
Kev Npaj Software
Kev Npaj Software

Arduino IDE Cov

Rub tawm thiab teeb tsa Arduino IDE yog tias tseem tsis tau:

Txhawb ATTinyCore

Ua raws cov txheej txheem teeb tsa txhawm rau ntxiv kev txhawb nqa ATTinyCore yog tias tseem tsis tau:

ESP-IDF

Ua raws ESP-IDF tau pib qhia rau teeb tsa kev txhim kho ib puag ncig yog tias tseem tsis tau:

Kauj Ruam 3: Luam Ntawv 3D

3D Luam Ntawv
3D Luam Ntawv

Rub tawm thiab luam tawm rooj plaub:

Kauj Ruam 4: Kev Txhawb LCD

Kev them nyiaj yug LCD
Kev them nyiaj yug LCD
Kev them nyiaj yug LCD
Kev them nyiaj yug LCD

Txiav 24 x 27 qhov 0.4 hli PCB rau kev txhawb nqa LCD. Nco tseg tseg qee qhov chaw rau folding LCD FPC. Tom qab ntawd siv qee qhov ob daim nplaum nplaum kho lub LCD ntawm PCB.

Kauj Ruam 5: Npaj PETG Phaj

Npaj PETG Phaj
Npaj PETG Phaj
Npaj PETG Phaj
Npaj PETG Phaj

Txiav tawm 62 mm x 69 mm PETG phaj rau dev board thiab Lipo roj teeb txhawb nqa.

Kauj Ruam 6: Txhim Kho ESP32 Dev Board

Txhim kho ESP32 Dev Board
Txhim kho ESP32 Dev Board

Siv ob sab nplaum daim kab xev txhawm rau txhim kho dev board ntawm PETG phaj.

Kauj Ruam 7: Txhim Kho Lipo Roj Teeb

Txhim Kho Lipo Roj Teeb
Txhim Kho Lipo Roj Teeb

Siv ob sab nplaum daim kab xev txhawm rau txhim kho Lipo roj teeb ntxiv rau pawg dev.

Kauj Ruam 8: Txuas Roj Teeb & Dev Board

Txuas Cov Roj Teeb & Dev Board
Txuas Cov Roj Teeb & Dev Board

Kauj Ruam 9: Npaj Zaub Pins

Npaj Zaub Pins
Npaj Zaub Pins

Cov zaub LCD muaj ntau yam kev hloov pauv rau cov neeg muag khoom sib txawv. Thov tau txais cov ntaub ntawv raug thiab nyeem nws ua ntej ib qho kev txuas thiab txuas.

Qee tus pin tau tshwj tseg rau kov vaj huam sib luag. Txij li lub LCD no tsis muaj kov vaj huam sib luag, tsuas yog txiav tawm cov pins tuaj yeem txo qhov cuam tshuam.

Kauj ruam 10: Txuas GND Pins

Txuas GND Pins
Txuas GND Pins
Txuas GND Pins
Txuas GND Pins

Feem ntau, muaj ob peb tus pin xav tau txuas rau GND. Txhawm rau txo kev siv dag zog, kuv txiav daim kab xev tooj liab kom mus txog txhua qhov GND pins thiab tom qab ntawd siv tag nrho.

Kauj ruam 11: Txuas Vcc Pins

Txuas Vcc Pins
Txuas Vcc Pins

Muaj 2 tus pin xav tau txuas rau Vcc, LCD zog thiab LED zog. Raws li cov ntaub ntawv, lub zog LCD tuaj yeem txuas ncaj qha rau dev board 3.3 V tus pin tab sis LED lub zog ua haujlwm qis dua 3.3 V. Yog li nws zoo dua ntxiv SMD resistor hauv nruab nrab, piv txwv li 12 Ohm tus tiv thaiv.

Kauj Ruam 12: Txuas LCD & Dev Board Support

Txuas LCD & Dev Board Support
Txuas LCD & Dev Board Support

siv daim kab xev txuas LCD txhawb nqa thiab dev pawg txhawb nqa ua ke. Ob qho kev txhawb nqa yuav tsum tseg ib puag ncig 5 hli qhov sib txawv rau folding.

Kauj Ruam 13: Txuas SPI Pins

Txuas SPI Pins
Txuas SPI Pins

Nov yog cov ntsiab lus sib txuas:

LCD ESP32

GND -> GND RST -> GPIO 33 SCL -> GPIO 18 DC -> GPIO 27 CS -> GPIO 5 SDI -> GPIO 23 SDO -> tsis txuas Vcc -> 3.3 V LED+ -> 12 Ohm resistor -> 3.3 V LED - -> GND NPE

Kauj Ruam 14: Flash Program

Flash Program
Flash Program
Flash Program
Flash Program
Flash Program
Flash Program
Flash Program
Flash Program
  1. Rub tawm qhov chaws ntawm GitHub:
  2. Hauv qab qhov chaws cov ntaub ntawv, khiav "ua menuconfig"
  3. Xaiv "Nofrendo ESP32-tshwj xeeb teeb tsa"
  4. Xaiv "Kho vajtse kom khiav ntawm" -> "Custom Hardware"
  5. Xaiv "LCD Hom" -> "ST7789V LCD"
  6. Sau tus pin teeb tsa: MISO -> -1, MOSI -> 23, CLK -> 18, CS -> 5, DC -> 27, RST -> 33, Backlight -> -1, IPS -> Y
  7. Tawm thiab Txuag
  8. Khiav "ua -j5 nyem"
  9. Khiav "sh flashrom.sh PATH_TO_YOUR_ROM_FILE"

Kauj Ruam 15: I2C Txuas Txuas

I2C Txuas
I2C Txuas
I2C Txuas
I2C Txuas
I2C Txuas
I2C Txuas

Txiav tawm I2C pins, ESP32 default I2C pins yog:

Pin 1 (SCL) -> GPIO 22

Pin 2 (SDA) -> GPIO 21 Pin 3 (Vcc) -> 3.3 V (tsis muaj 5 V lub zog thaum siv roj teeb Lipo) Pin 4 (GND) -> GND

Kauj Ruam 16: Sib dhos Tshooj 1

Image
Image

Ua raws cov vis dis aus cov kauj ruam kom nyem thiab nyem tag nrho cov ntu rau hauv rooj plaub.

Kauj Ruam 17: Daim Qauv I2C Gamepad

Tsab ntawv I2C Gamepad
Tsab ntawv I2C Gamepad
Tsab ntawv I2C Gamepad
Tsab ntawv I2C Gamepad

Qhov kev zov me nyuam rau I2C Gamepad yog qhov yooj yim heev, tsuas yog 15 kab kab ntawv. Tab sis nws yog qhov nyuaj me ntsis los rov ua dua ATtiny861 tom qab siv tas, yog li nws zoo dua sim nws ntawm lub khob cij ua ntej.

Rub tawm, ua ke thiab nyem qhov program los ntawm GitHub:

Kauj Ruam 18: Tsim I2C Gamepad

Tsim I2C Gamepad
Tsim I2C Gamepad
Tsim I2C Gamepad
Tsim I2C Gamepad
Tsim I2C Gamepad
Tsim I2C Gamepad

Nov yog cov ntsiab lus sib txuas:

ATtiny861 Khawm

GND -> Txhua tus khawm ib tus pin Pin 20 (PA0) -> Up khawm Pin 19 (PA1) -> Down khawm Pin 18 (PA2) -> Sab laug khawm Pin 17 (PA3) -> Txoj cai khawm Pin 14 (PA4) -> Xaiv khawm Pin 13 (PA5) -> Pib khawm Pin 12 (PA6) -> A khawm Pin 11 (PA7) -> B khawm Pin 6 (GND) -> I2C txiv neej tus pin header pin 4 Pin 5 (Vcc) -> I2C txiv neej tus pin header tus pin 3 Tus pin 3 (SCL) -> I2C tus txiv neej tus pin tus pin 1 Tus pin 1 (SDA) -> I2C tus txiv neej tus pin header tus pin 2

Kauj Ruam 19: Sib dhos Tshooj 2

Image
Image
Yeem: Suab Breakout Pins
Yeem: Suab Breakout Pins

Ua raws cov vis dis aus cov kauj ruam rau nruab lub npog thiab I2C gamepad rau lub cev tseem ceeb.

Kauj Ruam 20: Tsis teb los tau: Suab Breakout Pins

Image
Image
Yeem: Suab Breakout Pins
Yeem: Suab Breakout Pins

ESP32 dev board Pin 25 thiab 26 tab tom tso tawm lub suab sib xws, nws yooj yim heev rau kev tawg ntawm 2 tus pin no thiab tseem muaj lub hwj chim pins (3.3 V thiab GND) nyob rau sab saum toj. Tom qab ntawd koj tuaj yeem kho lub pob ntseg kom ntsaws rau nws. Lossis txawm tias koj tuaj yeem ntxiv lub suab ua suab nrov nrog tus hais lus los ua kom nrov nrov.

Kauj Ruam 21: Dab Tsi Ntxiv?

Dab Tsi Ntxiv?
Dab Tsi Ntxiv?

NES emulator tsis yog qhov txaus nyiam tshaj plaws uas koj tuaj yeem ua nrog ESP32. Piv txwv li koj tuaj yeem tsim lub micro python console nrog nws. Ib qho khoom siv uas koj xav tau hloov yog los ntawm I2C gamepad mus rau I2C keyboard. Kuv xav tias nws tsis nyuaj li ua nrog ATtiny88 tus tswj hwm. Koj tuaj yeem ua raws kuv li twitter kom pom cov xwm txheej.

Pom zoo: