Welcome to AI Voice Interaction Module repository
For MSPM0G3507
MSPM0G3507Z motherboard iic communication
Note: The voice interaction module needs to be burned with factory firmware. If the voice chip has not been flashed with firmware after receiving it, it does not need to be burned
1. Experimental preparation
- MSPM0G3507
- Voice interaction module
- Dupont line
2. Wiring diagram
| mspm0g350 | Voice interaction module |
|---|---|
| PA0 | SCL |
| PA1 | SDA |
| GND | GND |
| 5V | 5V |

3. Program download
- Connect mspm0g3507 to the computer using a download cable

- Open the burning software UniFlash 8.8.1.exe, select the corresponding model mspm0g350, and then click start

- Open the attachment and select the hex file in the Objects folder under the mspm0g350 source code in your own computer environment.

- Click Browse

- Pull down to see the corresponding port number, and select the baud rate you set, here is 9600.

- Long press the BSL button, then short press the RST button for one second, release both buttons, and then click Load Image can burn the firmware

- The following picture appears, indicating that the program is written normally, and you don’t need to pay attention to the warning

- Hearing the voice module broadcast "I am ready", it means that the program is successfully written.
4.Achievement effect
- You can select the broadcast content by modifying the code in the program as shown below


- The broadcast content can be viewed according to the Command Word Broadcast Word Protocol List V3_EN file provided in the attachment.
The first and second bytes AA FF represent the frame header of the protocol, the third byte FF represents the broadcast function, and the fourth is the ID of the broadcast content. Here you can see "I am ready" is hexadecimal 67, so the program sends 0x67 to register 0x03 to broadcast the corresponding content. The fifth byte is the end frame.

- Open the serial port debugging assistant provided in the attachment, select the corresponding port, and set the baud rate to 9600

- Click open to see that the terminal will print the received command word ID

- After I say the wake-up word to wake up, I say "close light" and the debugging assistant will reply with the receiving ID: 10

- At this time, you can open the attached Command Word Broadcast Word Protocol List V3_EN file to view the "Turn off the light" protocol

The first and second bytes AA FF represent the frame header of the protocol, the third byte represents the ID of the ten function words of the chip, and the fourth is the command word ID. Here you can see "close light" is 0A in hexadecimal, so the decimal will return 10. The fifth byte is the end frame.
- Say other command words, the serial port debugging assistant will also print the corresponding command word ID, you can try it yourself