1˵

    չʾΪӻʹI2Cշݡ   

2ʹû

   
        IDEߣKEIL MDK-ARM 5.21.1.0
    
    Ӳ
        壺N32G031C8L7-STB V1.0


3ʹ˵
	
    1ʱӣ48MHz
    2I2C1 ã
            SCL   -->  PB6          
            SDA   -->  PB7         
            CLOCK:100KHz
            
    3USART1ã
            TX  -->  PA9   
            RX  -->  PA10           
            ʣ115200
        

    4Բ
        aI2C1
        bش븴λ
        cӴڿӡϢ֤

4ע
    1. SCLSDA;
    2. I2CӻַҪʹ 0xF0 

1. Function description

     This example demonstrates the use of I2C as a slave to send and receive data.

2. Use environment

    Software development environment:
         IDE tool: KEIL MDK-ARM 5.21.1.0
    
     Hardware environment:
         Development board: N32G031C8L7-STB V1.0


3. Instructions for use

     1. Main clock: 48MHz
     2. I2C1 configuration:
             SCL --> PB6
             SDA --> PB7
             CLOCK: 100KHz
            
     3. USART1 configuration:
             TX --> PA9
             RX --> PA10
             Baud rate: 115200
        

     4. Test steps and phenomena
         a, the jumper wire connects the master I2C1
         b, compile and download the code, reset and run
         c, view the print information from the serial port and verify the result

4. Matters needing attention
     1. SCL and SDA must be pulled up;
     2. Do not use 0xF0 as the I2C slave address.