24-channel servo driver board

1. Learning objectives

Drive 180-degree servos through the serial port of the 24-channel servo driver board

2. Hardware connection

The servo used in this case is a 180-degree servo, which is connected to the S1 pin of the 16-channel servo driver board

24-channel servo driver board and MSPM0G3507 wiring

3. Program description

Header file that defines serial port transmission data

 

Define the serial port initialization function, the function to send one byte of data, and the serial port interrupt service function.

 

Define the serial port control function UART_Servo, where the parameter servonum has a value range of (1-24) and angle has a value range of (0-270). In the main function, assign values to the serial port control function. Use loops to achieve 0-180 value changes.

Note: The project source code must be placed in the SDK path for compilation,

For example, the path: D:\TI\M0_SDK\mspm0_sdk_1_30_00_03\1.TB6612

4

4. Experimental phenomenon

Connect the servo to the S1 interface of the 24-way servo driver board, and burn the program to MSPM0G3507. After burning, connect the MSPM0G3507 to the 24-way servo driver board according to the wiring diagram. After power on, you will see the servo rotate from 0-180 degrees. Finally, it returns to 0 degrees.