# A small handheld game console based on Lichuang Liangshan School.
This is a small handheld game console designed and produced with reference to the official game console expansion board. It can run small games such as the nes emulator and is full of fun.
## 1. The display
uses a 1.69-inch SPI-driven IPS high-definition rounded corner display with 240*280 pixels. It has good display effect, fine image quality, relatively simple peripheral circuits, and less control IO.
![Screen circuit.png]

Transplant the code of Zhongjingyuan Electronics to drive the screen, and use hardware SPI to improve communication efficiency.
## 2. The rocker
uses a small sliding rocker.
![Joystick circuit.png]

Use ADC to detect the output variable of the joystick.
## 3. Vibration motor
uses 3610 chip motor to provide vibration effect for the game console. Its current is small (85mA) and can be controlled by triode.
![Vibration motor.png]

![Vibration motor circuit.png]

There are two main control methods for motors, one is IO high and low level control, and the other is PWM control. The high and low level control method is simple and easy to implement, but it cannot control the intensity of vibration, and using PWM can control the intensity of the motor's vibration effect.
## 4. EEPROM
The eeprom chip is used to record data when power is lost, and it has the characteristics of not being lost when power is lost. Although a large number of MCUs currently integrate a certain capacity of eeprom, for reasons such as safety and unlimited restrictions, the eeprom chip still Widely used in various electronic products. The 24c02 is used here. The circuit is very simple. Using iic communication, only two IOs are needed for communication, and it supports multiple address settings. Only one eeprom is used here, so all address setting IOs are pulled low and grounded.
![EEPROM circuit.png]

## 5. NES transplantation
NES games are games that run on the Nintendo Famicom, and the CPU is a 6502 chip. If you want to use NES games in other environments, you need a corresponding NES game emulator (computer, mobile phone, microcontroller). Here we focus on the NES emulator on the microcontroller side.
The main online open source microcontroller-side NES simulators include: info nes (Long Yuan) stm32 nes (ye781205), stm32 nes (punctual atom). Punctual Atomic's nes is optimized based on the ye781205 open source. What is transplanted here is the punctual atomic nes simulator. !
## 6. Real object
![IMG_0887.jpg]

![Screenshot 2023-05-13 100637.png]

![Screenshot 2023-05-13 100716.png]