**Introduction:**
Using Lichuang·Liangshanpai GD32F470ZGT6 development board as the base board, the game console expansion board developed can realize the NES game emulator and test related handwritten programs by yourself.
**1. Hardware circuit design**
Hardware design is based on video tutorials, and simultaneous learning of GD32F470 programming and Jialichuang EDA drawing pcb design, etc.
**1. Interface planning**
The interface is based on the official interface. The official expansion board KEY_R uses PB2, but the PB2 development board has been used as BOOT, so it was changed to PB14, and subsequent programs are modified simultaneously.
![image.png]

**2. Power module**
The power module as a whole refers to the official schematic diagram. The official video tutorial is designed and welded by using the power module as a separate circuit board. Here is the circuit as a whole, together with the rest of the circuit Synchronous design.
![image.png]

**3. Display interface**
The official tutorial uses a 240x280 display, formal installation, and FPC connection method.
This expansion board uses a 240x320 display with a circuit board. The display and expansion board are connected through pin headers, which is simple and reliable.
![image.png]

**4. Buttons, headphones and other modules**
Buttons, amplifiers, headphones, eeprom and other modules are all designed with reference to the official tutorial.
![image.png]

![image.png]

**2. PCB design**
PCB design is completed using Jialichuang EDA. The 3D model and final product are as follows
![image.png]

![image.png]

![image .png]

![image.png]

![Front.jpg]

![Back.jpg]

The final product does not purchase pin sockets, and the battery power cord is directly welded to the board.
At the same time, there is a diode package that is drawn incorrectly and has a red jumper.
I don’t know how to 3D print the design yet, so the buttons don’t have caps or casings.
**3. Software design**
Since my screen is 240x320 and is installed horizontally (equivalent to 320Wx240H), it is quite different from the official 240Wx280H. All official programs need to be designed separately.
**1. Comprehensive function demonstration**
The comprehensive function demonstration is mainly to ensure full screen display and adjust the display position of each display component at the same time.
![Test picture.jpg]

![image.png]

Pay extra attention to the following two points
(1) Lcd_Init() is set to horizontal screen
![image.png]

![image.png]

(2) Lcd_PushStart needs to change the offset is 0, otherwise the screen will not be displayed in full screen
! [image.png]

**2.NES simulator transplantation**
uses the nes simulator transplantation of the official tutorial. The core is also to consider the layout changes caused by the horizontal screen of the display and the change of button direction. .
![image.png]

![image.png]

![image.png]

The final effect
![Front.jpg]

**IV. Summary and shortcomings**
This time, through expansion board design, pcb production, and software debugging, the Learned GD32F470 programming, Jialichuang EDA usage, circuit welding, NES simulator and many other aspects.
The main shortcoming is that I use a screen that is inconsistent with the official one, I cannot simply copy the official program, and my ability to debug the program is limited. This causes display problems when the NES emulator runs nes games in the SD card. I still need to continue to learn and improve. .
![WeChat picture_20230521160109.jpg]

![WeChat picture_20230521160113.jpg]