Taiko-Input/Sampling-MCU
AnalogDragon e5fb8aac07 update md
2023-07-06 17:27:45 +08:00
..
8chV3_WithCH552_V1.1 Initial commit 2023-04-19 20:18:28 +08:00
img update md 2023-07-06 17:27:45 +08:00
.gitignore Initial commit 2023-04-19 20:18:28 +08:00
README_EN.md update md 2023-07-06 17:27:45 +08:00
README.md update md 2023-07-06 17:27:45 +08:00

Sampling MCU Project

Sampling Microcontroller Software
MCU: stm32g030, IDE: KEIL 5

Chinese Version

Home

Dual Drum Version and Single Drum Version

Differentiate the software between dual drum and single drum hardware using macros in /main.h/.
It is important to note that the software compiled for single drum hardware cannot be used on dual drum hardware due to differences in initialization.

Single Drum Version:

¡­
#define IS_4CH_MODE 
¡­

Dual Drum Version (comment out this line of code):

¡­
//#define IS_4CH_MODE 
¡­

Digital Signal Processing

Digital signal processing mainly involves trigger handling, debouncing, and determining if there is signal crosstalk.
Since the drum contains a physical structure, vibrations can cause signal misfires. Therefore, it is necessary to determine and output the signals received at the same time.

Processing Flowchart

Data Flow Data flow diagram

After the signal is sampled, it is recorded as a waveform array, and a trigger function is used to determine if there is a signal with the expected strength.
The delayed output ensures that when a signal arrives, it does not miss the trigger of other sensors. If other channels are triggered during the delay, the triggered values will also be recorded.
The arbitration function determines the maximum strength among the triggered channels during the delay and is used to reset the states of other functions.
The output signal is sent to the USB microcontroller by the output device.

Signal Triggering and Crosstalk Detection

When multiple signals are input simultaneously, the channel with the higher amplitude will be triggered.
The drum sensors are fixed on several relatively independent boards. Typically, the signal obtained by directly striking the board has a much higher strength than the signals caused by vibration interference or crosstalk.

The approach here is to wait for a small delay after the initial trigger to allow other channels to trigger. If multiple channels are triggered during this period, then the channel with the strongest signal among them is output.

Triggering Triggering illustration

Software Flowchart

Data Flow Data flow diagram

The software can be configured for speed-priority triggering (setting the period to 0) or maximum peak triggering.
The longer the number of cycles, the longer the calculated period. When the number of cycles is set to 0, triggering is performed in a speed-priority manner.

Configuring Sampling Parameters

Sampling parameters are configured through the upper computer software

Upper Computer Software

Data Output

Data is sent to the computer using a USB microcontroller

USB MCU Software