Welcome to 8-Channel Tracking Module repository
IO
MSPM0-IO Method
MSPM0-IO MethodExperimental preparationExperimental purposeExperimental wiringExperimental steps and phenomenaExperimental source code
Experimental preparation
TI's MSPM0G3519 motherboard
8-channel patrol module
Several Dupont cables
MSPM0G3519 board needs to download the IO communication source code provided in the document**
Experimental purpose
The content of this experiment is mainly to use the MSPM0G3519 master control to receive the data of the 8-channel patrol module through IO.
Experimental wiring
MSPM0G3519 connected to the serial port assistant If the type-c port of the msp does not have the function of downloading programs, you need to use a USB to TTL module to connect to the computer. The wiring is described in the following table
| MSPM0G3519 | usb to ttl |
|---|---|
| PA10 | TX |
| PA11 | RX |
| vcc | vcc |
| GND | GND |
| If the MSPM0G3519 MCU type has a download function, you can directly use the type-c to connect to the computer's serial port assistant |
| MSPM0G3519 | 8-channel line patrol module |
|---|---|
| PA28 | x1 |
| PA31 | x2 |
| PA02 | x3 |
| PB24 | x4 |
| PB20 | x5 |
| PB19 | x6 |
| PB18 | x7 |
| PA07 | x8 |
Experimental steps and phenomena
After connecting the wires, open the serial port assistant and you can see the numerical data of the infrared module. Set the baud rate to 115200. As shown in the figure below

MSPM0 developers need to build the environment before compiling and running the project Environment building tutorial: https://wiki.lckfb.com/zh-hans/dmx/beginner/install.html
Experimental source code
x//Main functionint main(void){SYSCFG_DL_init();//Wait for the infrared module to be normaldelay_ms(1000);delay_ms(1000);delay_ms(1000);delay_ms(1000);//Clear the serial port interrupt flagNVIC_ClearPendingIRQ(MYUART_INST_INT_IRQN);//Enable serial port interruptNVIC_EnableIRQ(MYUART_INST_INT_IRQN);while (1){printf_LineWalking();delay_ms(200);}}
The main function of the source code is very simple, reading the probe pins of the 8-way patrol line and printing them out.