STM32-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

2. Wiring diagram

STM32Voice interaction module
PB10SCL
PB11SDA
GNDGND
5V5V

image-20250226115745596

3. Program download

image-20250226120535829

image-20250226121840812

image-20250226121610987

image-20250226121917273

image-20250226122105835

4.Achievement effect

image-20250226142719229

image-20250226142653354

image-20250226144921177

image-20250226140957314

image-20250226141059562

image-20250226141240168

image-20250226141429180

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.