STC8A8K64D4 seems to be the first MCU of STC to support LCD_DMA function, so a separate development board was drawn. The board size was originally drawn according to TK032RB422 (Tiky's store on Taobao), but I didn't understand the driver IC LG4573A, so I used the code written for another 5-inch ILI9806G driver screen from his company.
If anyone has studied the IC LG4573A and can give me a C51 routine reference, I would be very grateful. For the time being, the code only runs through the basic LCM_DMA function, plus a font call.
The code can be found at: https://github.com/XanaduNWH/8051/tree/main/STC8A8K64D4/Tiky_LCD_TEST_board The STC official website provides software library functions and application examples, but the DMA naming still uses the BMM before the update, and some places do not match the new version of the header file, so the official function library is not used.
The PCB board routing is very unprofessional, and I hope the master can give me some advice.
[ChangeLog]
2022/03/29
Corrected the wiring error of the transistor in the buzzer circuit
2022/03/25
Updated the GT30L32S4W package error problem;
swapped P54 and P55, P54 was changed to a button and a current limiting resistor was added, and P55 was changed to a pin lead;
swapped P37 and P42, P37 (INT4) was changed to a pin lead, and P42 was changed to a button;
power + download The download circuit
board uses CH340C to make the download circuit, which is more expensive than CH340G, but there is one less crystal oscillator in the circuit. Use TYPE-C interface for unified power supply.
If the automatic download fails, you can increase C7 for better results.
CH340C uses USB for direct power supply, and the entire board uses AMS1117 to step down to 3.3 for power supply. Extended lead-out a 5V power supply interface.
The LED circuit board
carries two IO-controlled LEDs, and P11 is the output port of hardware PWM1_2.
The key circuits
P33 and P37 correspond to INT1 and INT3, INT0 is used for the touch screen interrupt
; P51 is a normal IO key;
P54 is the NRST pin, although this pin is used as a standard IO by default;
the expansion interface
H1 is the hardware LCM_DMA channel corresponding to the LCD interface pin (LCMIFCPS[1:0] = 00; LCMIFDPS[1:0] = 00;);
there are D16~D23 on the silk screen, but the pins are not wired because the MCU's LCM_DMA function only supports up to 16 bits wide.
BL is directly connected to P1.0;
the screen touch interrupt is connected to P32 (INT0);
CN1 leads to the hardware SPI interface (P_SW1 = 0x00), sbit ex_cs = P1^2;
CN2 leads to the hardware I2C interface (P_SW2 = 0x00);
CN3 leads to UART4 (P_SW2 = 0x04);
CN4 leads to P6, which is the interface of PWM*_3;
CN5 is some IO that has nowhere to go;
CN6~8 are 3V3 power supply interfaces;
the font chip
GT30L32S4W chip
provides 12, 16, 24, 32 dot size GB2312 characters, 4 sizes of GB extended characters, and multiple ASCII character sets.
SPI interface (P_SW1 = 0x00 )
sbit zk_cs = P1^7;
Flash chip
W25Q64
SPI interface (P_SW1 = 0x00)
sbit flash_cs = P1^6;
EEPROM chip
AT24C128N
I2C interface (P_SW2 = 0x00)
Clock chip
DS3231
I2C interface (P_SW2 = 0x00)
INT/SQW = P3^6;
Miscellaneous
A CR1220 battery holder, retaining the traditional VRTG 4-wire download interface.
VID_20220319_150335.mp4
BOM Download
PCB_PCB_STC8A8K64D4 LCM_DMA Development Board_2022-09-24.pdf
PCB_PCB_STC8A8K64D4 LCM_DMA development board_2022-09-24.json
PCB_STC8A8K64D4 LCM_DMA development board_2022-09-24.pcbdoc
Gerber_PCB_STC8A8K64D4 LCM_DMA development board.zip
PCB_TK032RB422 Verification Board_Draft_2022-09-24.pdf
PCB_TK032RB422 verification board_draft_2022-09-24.json
TK032RB422 verification board_draft_2022-09-24.pcbdoc
Gerber_TK032RB422 verification board_draft.zip
PCB_TK032RB422 verification board_2022-09-24.pdf
PCB_TK032RB422 verification board_2022-09-24.json
TK032RB422 verification board_2022-09-24.pcbdoc
Gerber_TK032RB422 verification board.zip
Schematic_STC8A8K64D4 LCM_DMA Development Board_2022-09-24.pdf
SCH_STC8A8K64D4 LCM_DMA Development Board_2022-09-24.json
Verification version_2022-09-24.schdoc
61452
#The7thLiChuangElectricityContest#USB voltage and current meter
Introduction: USB voltage and current meter based on N32 microcontroller
Note: * is a required field,
please fill it in during the registration stage↓
* 1. Project Function Introduction
Follow the training camp to design a USB voltage and current meter
Note: The topic is not limited, it can be a solution to a problem in life/work, a solution designed for a certain group of people/scene, a graduation project/course design/DIY project/purely cool project, etc. Mainly talk about what problem you solved by what means.
*2. Project Attributes
Follow the training camp to learn design
Note: Please indicate whether the project is publicly disclosed for the first time; whether the project is original; whether the project has won awards in other competitions, if so, please describe the details of the award; whether the project has participated in the defense at school.
* 3. Open Source Agreement
GPL3.0
Note: Altruism is self-interest, please read the following content carefully.
Embrace open source and give unlimited value to the project. It is recommended that more than 80% of the core functions of the project be open source;
if a part of the function is irreplaceable and the project cannot solve the corresponding problem after deleting it, then the function implemented by this part is the core function of the project; for example, if an electronic load is designed and a host computer software is designed to monitor power changes, the electronic load is the core function and the host computer software is an auxiliary function; for example, an isolated 485 module is used in the electronic load to communicate with the host computer, then the communication function implemented by this 485 module is an auxiliary function;
the project should choose an open source protocol that suits it. If the project references other open source projects, the source should be indicated and the original author's open source protocol should be followed; the original project is recommended to use the GPL3.0 open source protocol;
the functions implemented by directly referencing the original circuit or original code of the open source project cannot be used as the core functions of your own project, and the functions directly implemented by using the general modules on the market cannot be used as the core functions of your own project.
Please fill in the following in the competition stage↓
*4. The hardware part
converts the current into a voltage value through a sampling resistor and a current sensing amplifier chip, collects the actual voltage value through a resistor divider, and transmits it to the corresponding IO port respectively, and then calculates the real-time power. OLED display is realized through single-chip microcomputer control.
Note: It is recommended to use Jiali Chuang EDA. If you choose other EDA tools, please upload the schematic diagram in PDF format, the PCB drawing in PDF format, and the PCB file in Gerber format in the attachment. Here you can explain in detail the implementation principle and mechanism of your project, precautions, debugging methods, testing methods, etc. It is recommended to introduce your ideas to others in the form of pictures and texts.
*5. The software part
uses the official code. After modifying the actual voltage and the displayed voltage ratio, everything is displayed normally. Use ST-LINK to burn the program
. Note: If your project involves software development, please upload the corresponding engineering source code in the attachment. Here you can explain in detail your software flow chart, functional module block diagram, explanation or popularization of related algorithms, source code structure, compilation environment construction and configuration, source code compilation method, program burning method, etc. It is recommended to introduce your ideas to others in the form of pictures and texts.
*6. BOM list
ID
Name
Designator
Footprint
Quantity
Manufacturer Part
Manufacturer
Supplier
Supplier Part
Price
1
4.7u
C1
C0805
1
2
0.1u
C2,C3,C4,C5,C8,C9,C10,C11
C0805
8
3
22u
C6,C7
C0805
2
4
1206L350SLTHYR
F1
F1206
1
1206L350SLTHYR
Littelfuse
LCSC
C207042
1.0939
5
HDR-F-2.54_1x4
H1
HDR-F-2.54_1X4
1
LCSC
C225501
0.5575
6
HDR-M-2.54_1x2
J1
HDR-M-2.54_1X2
1
LCSC
C124 375
0.1366
7
HDR-M-2.54_1x6
J2
HDR-M-2.54_1X6
1
LCSC
C190819
0.2414
8 LED
-0805_R LED1
LED0805_RED
1
17-21SURC
/S530-A3/TR8 EVERLIGHT ( Taiwan Everlight )
C72037 0.103
9
XC62
20B331MR - G Q1
SOT
- 25-5_L3.0
-W1.8 - P0.95 - LS3.0 - BR
1 R0603 3
13
1k
R6
R0603
1
14
TS-1101-BW
SW1
KEY-SMD_2P-L6.0-W3.6-P7.4-LS8.0-L
1
TS-1101-BW
XKB Enterprise
LCSC
C500065
0.2555
15
N32G430C8L7
U1
LQFP-48_L7 .0-W7.0-P0.50-LS9.0-BL
1
N32G430C8L7
Nations
LCSC
C3032170
5
16
INA199B1DCKR
U2
SC-70-6_L2.2-W1.3-P0.65-LS2.1-BL
1
INA199B1DCKR
TI(Tex as Instruments)
LCSC
C398920
1.984
17
USB-212-BCW
USB1
USB-A-SMD_USB-212-BCW
1
USB-212-BCW
XUNPU
LCSC
C720521
0.4562
18
U-USBAS04P-F000
USB2
USB-A-SMD_USB-302S
1
U-USBAS04P-F000
Shenzhen Cankemeng
LCSC
C386735
0.5705
Note: BOM list involved in the project. Please upload a screenshot of the BOM in this location. Please upload the list details in PDF format to the attachment. It is recommended to include model, brand, name, package, procurement channel, purpose, etc. Specific content and The format should be based on the clear expression of the project composition.
*7. For the competition logo verification

, please upload a project image containing the competition logo. The logo is printed on the PCB in the form of silk screen.
Click zip to download the competition logo! (Contest logo).zip
* 8. Demonstrate your project and record it into a video.
Video requirements: Please shoot horizontally, with a resolution of no less than 1280×720, in Mp4/Mov format, and a single video size limited to 100M;
Video title: Lichuang Electronics: {project name}-{video module name}; such as Lichuang Electronics: "Autonomous Driving"-Team Introduction.
More details: https://diy.szlcsc.com/posts/d76d9cb41705430e9a54e7a5feed07a5
Lichuang Electric Race: USB Voltage and Current Meter - Operation Demonstration.mp4
USB voltage and current meter program code.zip
BOM Download
PCB_PCB_#The 7th Lichuang Electric Competition#USB Voltage and Current Meter_2022-09-24.pdf
PCB_PCB_#The 7th Lichuang Electric Competition#USB voltage and current meter_2022-09-24.json
PCB_#The 7th Lichuang Electric Competition#USB Voltage and Current Meter_2022-09-24.pcbdoc
Gerber_PCB_#The 7th Lichuang Electric Competition#USB voltage and current meter.zip
Schematic_#The 7th Lichuang Electric Competition#USB Voltage and Current Meter_2022-09-24.pdf
SCH_#The 7th Lichuang Electric Competition#USB Voltage and Current Meter_2022-09-24.json
Sheet_1_2022-09-24.schdoc
61459
#The7thLiChuangElectricityContest#USB current measurement
Introduction: A simple USB power meter based on National Technology N32, which does not support the fast charging protocol. The reserved input and output pins can be used for current and voltage detection.
National Technology N32 MCU
USB Power Meter
Lichuang Summer Camp
Power Indicator


There are two LEDs, one 3.3V and one 5V
Voltage conversion

XC6220B331MR-G is used to step down the input 5V voltage to 3.3V to power the MCU and current detection chip Current
detection
INA199



Voltage detection
Simple resistor voltage division
It must be noted that the voltage must be less than 3.3V (VADC)

The extended UART port can be used to transmit data
There is a 0Ω resistor in the schematic diagram to isolate GND.
The following link talks about the role of 0Ω resistor
https://www.bilibili.com/read/cv15681591/
video_20220821_160627.mp4
BOM Download
PCB_PCB_#The 7th Lichuang Electric Competition#USB Current Measurement_2022-09-24.pdf
PCB_PCB_#The 7th Lichuang Electric Competition#USB Current Measurement_2022-09-24.json
PCB_#The 7th Lichuang Electric Competition#USB Current Measurement_2022-09-24.pcbdoc
Gerber_PCB_#The 7th Lichuang Electric Competition#USB current measurement.zip
Schematic_#The 7th Lichuang Electric Competition#USB Current Measurement_2022-09-24.pdf
SCH_#The 7th Lichuang Electric Competition#USB Current Measurement_2022-09-24.json
Sheet_1_2022-09-24.schdoc
61463
【CW32】Brushless motor
Introduction: Brushless motor driver board. I learned a lot from following the training camp. I learned about CW32 microcontroller and brushless motor driver, and the concepts of sensor and non-sensor.
Learn how to use brushless motors and get familiar with CW32 microcontrollers. This is my first time using brushless motors.
video_20220615_173502.mp4
BOM Download
PCB_PCB_【CW32】Brushless Motor_2022-09-24.pdf
PCB_PCB_【CW32】Brushless Motor_2022-09-24.json
PCB_【CW32】Brushless Motor_2022-09-24.pcbdoc
Gerber_PCB_【CW32】Brushless Motor.zip
Schematic_【CW32】Brushless Motor_2022-09-24.pdf
SCH_【CW32】Brushless Motor_2022-09-24.json
【CW32】Brushless Motor_2022-09-24.zip
61464
electronic