0. Preface
I was fortunate enough to receive an invitation from Lichuang for internal testing of the Liangshan development board. I made a design based on the Liangshan development board and made it open source.

The picture above shows everything on the Liangshan development board, which is divided into two boards, the core board of the smallest system - Liangshan Pi, and an expanded version like a game console - Tiankuixing. It also comes with DAP-LINK and battery speakers.
Of course, before I had a chance to play the Tiankuixing board game that was given to me, the program had been erased by the light.
The main control of the core board is GD32F450ZGT6, which is a very powerful MCU.
As a development board/core board collector,
in addition to the development boards/core boards bought outside, there are also many development boards/core boards made by myself.

The purple PCB is really eye-catching. Except for the Liangshan development board, which is purple, There is also a w801 development version that is also purple~
When Lichuang released the FPGA development board, I immediately bought it (dog).
However, it is still a bit small as a development board, let alone a core board.
Like Punctual Atomic's Alpha, Battleship development version and Puzhong Technology's 51 development board are all in the form of a chip-on-board core board, and then lead the IO to the big board.
Liangshan uses one core board to directly plug into another finished board, which is more like making a modular product.
I hope that it can be made into a large board with a core board in the future, which will actually make development more convenient. The core board can also be removed and replaced with a board drawn by yourself.
1. Introduction

The picture above is the first version of PCB.
The picture below is an improved version of PCB

using Liangshan Pi core board (master control GD32F450ZGT6) to make a simple scoreboard. It comes with voice broadcast and can be used for a variety of competition purposes and can be expanded to an external screen.

The above version is from the beginning. The power supply was not enough, so I changed it
. The bottom part is a new board. The power battery part is independent, so the power board can be used for free. The 10x10

large screen is too big to fit on the table.
In fact, I have made a digital tube display based on Hangshun
https://oshwhub.com/Aknice/ji-yuhk32f030mf4p6-dipc-zhuang-tai-xian-shi-qi.

It didn’t seem to have any function at that time, it was just display, so This time I want to continue to improve it and make it a practical function. I happened to be missing a scorer when I was playing recently, so I made this.
2. Principle
2.1 Block

Diagram The block diagram is roughly as above. The three-wire control MAX7219 chip drives the digital tube and the serial port controls the speaker. The MCU is relatively powerful and has many IOs, so one button and one interrupt.
2.2 The drive circuit of MAX7219

is no different from before. It also has three wires to guide the DIN CLK CS (LOAD) pin.
2.3 Amplification circuit
Since the small digital tube can be driven by 5V, but the large digital tube needs 12V voltage to drive, it needs an amplifier circuit.

Since MAX7219 is It drives the common cathode digital tube, so DIG0.1.2... is low, and SEGA.BC... is high. Therefore, when designing the drive circuit above,
please note that this drive circuit drives the common anode digital tube.
You can choose a Group analysis:
Upper end: When SEG1_DIG0 is low, Q28 AO3400 is turned on, Q30 is cut off due to the 12V pull-up of R74, but now because Q28 is turned on, the base of Q30 is extremely low, so Q30 is also turned on, and SEG2_OUT_DIG0 changes from 0V to 12V. . Lower end: R57 pulls down Q20, so Q20 is cut off. When SEG2_A is high, Q20 is turned on to ground, so SEG2_OUT_A is connected to ground.
To sum up, when SEG1_DIG0 is low and SEG1_A is high, 12V will be conducted to the A picture of tube 0.
Since amplification will cause the level logic to be reversed, only MAX7219 (common cathode driver IC) can be used to drive the common anode. If you want to drive a digital tube with a common cathode or drive an IC with a common anode, you need to add an inverting circuit.
Another point is that the amplifier circuit uses MOS tubes, not transistors, otherwise the MAX7219 has insufficient driving capability.
2.4 The power supply circuit

uses a three-cell lithium battery equalizing charging circuit. This three-cell lithium battery charging circuit has been done before. Now I have taken it and added a switching circuit and a balancing circuit.
The switching circuit uses the power supply when there is power and simultaneously disconnects the battery to supply power to the system. Charge the battery. If there is no power input, use the battery to power the system. I have talked about it before, so I won’t go into details.
Use 8 pins to plug in, so that the battery board can be made for free.
But be careful not to insert it crookedly, otherwise the board will be burned.

2.5DY-SV17F voice module circuit is configured

according to the data manual.

CON1 CON2 10K goes to ground, and CON3 10K pulls up. The 3.3V
MCU serial port level requires 3.3V.
3. Imposition:
It is very expensive to make all digital tubes on a whole PCB. A large board costs 500+RMB. If you use imposition, you will save a lot of board making costs

. The assembling is as above, with M3 screw holes reserved. The idea of strengthening the structure
is roughly as follows:
We can make a large digital board into a PCB board, and then print 10 sheets, and select which board it is by jumping resistors. In this way, we only need to print 10 PCB sheets once (within 10x10, 20 Yuan), and then use the right pin connection to save money.
The pins that need to be connected on the back are as follows. There is no need to solder when making a cross. The above picture is the schematic diagram of the jumper


for . The top one is to choose which tube. The bottom one is to choose chipset 1 or 2.
The corresponding figure
is SEG1/2_the number is Select the digital tube, which is a 12V common anode. You only need to solder one. The suffix ABCD is the chipset, the score number is chipset 1, and the 24-second countdown is chipset 2. You need to solder all

4. DY-SV17F voice module burning file
To use the voice module, we need to burn the voice file into the FLASH of the voice module,
insert the USB and connect it to the

computer. At this time, a U disk will appear. First delete all the files in it, and then put all the files in the attachment ZH.7z into the U disk. Place the voice file in the ZH folder

of the U disk. 5. Code analysis 5.1 MAX7219 driver code MAX7219 code principle has been discussed before. Based on the original code, many improvements and optimizations have been made, and many functions have been added. Write_Max7219(uchar num,uchar address,uchar dat,uchar dp) this function adds a decimal point to display bcd_Max7219(void)

This function sets the mode to bcd decoding mode
lum_Max7219 (uchar num, uchar lum)
sets the brightness of which group of tubes
full_Max7219 (void)
full display
fullclear_Max7219 ()
clears the screen.
However, these codes are all written in main and should be written in the new
5.2DY-SV17F voice module in the .c file.
The voice module uses serial port communication. I won’t talk about opening the serial port configuration. Let’s
take a look at the communication format of the voice module.

We use combined playback and play the scores together.
After knowing the communication format, we still need Know the voice table:

it is the number or Chinese corresponding to the voice package burned into the ZH folder of the voice module.

We need to use combined playback. The format is as above.
For example, when broadcasting: 123 vs. 321,
you can use the built-in software to generate it. The format


AA is fixed; 1B is the combination playback mode; 0E is the number of tracks played. There are only 7 tracks now, and one song occupies 2, so the bit is 14, 0E; 30 and 31 are 0 and 1 in hexadecimal, the same applies later, 33 That's 3rd grade. The last bit is the checksum, which is the lower two bits of the sum of all previously sent data.
In order for the tracks to be the same, I chose the fixed track form to fix the third position.
Consider the longest broadcast should be:? Hundred? ten? Compare? Hundred? ten? There are 11 digits in total, so the third digit length code is 22, that is,

the empty byte of 0x16 can be replaced by the empty 0.02 second blank voice in the voice table, or it can be replaced by a voice that does not exist. 0x39, 0x39 are used in the code instead, that is The 99th voice packet actually does not exist, so it will be skipped directly.

Voice combination:
There will be many special situations in actual broadcasting, such as:
0:0 broadcast: zero to zero.
Error broadcast: zero zero zero to zero zero zero
1: 2 broadcast: one to two.
Error broadcast: zero zero one to two
10: 100 broadcast: ten to one hundred.
Error broadcast: 100 to 100
101: 102 Error broadcast: 101 to 102
Error broadcast: 111 to 12
111: 110 Broadcast: 111 to 110.
Error reporting: One hundred and eleven versus one hundred and ten
require special optimization, which has already been written in the code.

For example:
the condition for broadcasting the tens digit of 0 is that the hundreds digit is not 0, and the ones digit is not 0. In this way, when 100 is broadcast, the tens digit is skipped directly, and when 101 is broadcast, the tens digit is broadcast again.
The condition for broadcasting tens digit 1 is that the hundreds digit is not 0. You can check the code for details.
Checksum:
The length we send does not exceed 26 bits at most, so it is stored in a voice array. We judge by the score and then store the corresponding voice number
(the voice array should be 25).

The serial port sending format requires us to finally One data is the lower 2 bits of the sum of all previous arrays.

We need to sum the previous 25 arrays, and then take its lower 2 bits to make the last data and send it out.

In this way, the data is sent out.
6. Note on

the resistance of DP Please strictly follow the resistance values shown in the picture above. I didn't notice before that all the resistance values should be the same as other positions.

However, there are only two diodes in the DP position, so the dots will be burned. In the video, the decimal point is burned.
In fact, the DP should be lit with 7.4V instead of 12V.
7. Summary of
Liangshan Development Board PCB coupons and mall coupons.
The video tutorial of Liangshan Development Board is clear and detailed. The information is still being improved officially. There are also areas that need to be modified in the hardware. The problems should be solved after the official launch.


How it looks like used in actual competitions