1˵
     1TIM1 CH4ADCעOPAĵѹݣTIM1COMP1ɲ
2ʹû
     KEIL MDK-ARM V5.30.0.0
     Ӳ      N32G031C8L7-STB V1.0
3ʹ˵
     ϵͳã
         1ʱԴ
                    HSE=8M, PLL=48M, AHB=48M, APB1=48M, APB2=48M, ADC CLK=48M/16, ADC 1M CLK=HSE/8,OPA CLK=48M, COMP CLK=48M, TIM1 CLK=48M, TIM8 CLK=48M
         2жϣ
                    ADCעжϴ򿪣ȼ0
                    ȡת
         3˿ã
                    PA0ѡΪģ⹦OPA VP
                    PA6ѡΪģ⹦OPA OUT
                    PA1ѡΪģ⹦COMP1 INP
                    PA4ѡΪģ⹦COMP1 INM
                    PA12ѡΪģ⹦COMP1 OUT    
                    PA8ѡΪTIM1 CH1
                    PA9ѡΪTIM1 CH2
                    PA10ѡΪTIM1 CH3
                    PB13ѡΪTIM1 CH1N
                    PB14ѡΪTIM1 CH2N
                    PB15ѡΪTIM1 CH3N
                    PA6ѡΪADC_CH6ͨ
        4OPA
                    OPAѹܣVM
        5ADC
                    ADCעģʽɨתTIM1 CC412λҶ룬עתOPAģѹ
        6COMP
                    COMP1 INPѡPA1INMѡPA4TIM1TIM8ɲ
        7TIM
                    TIM1 6·򿪣ɲʹҴжϣCH4
    ʹ÷
        1򿪵ģʽʾ߼ǹ۲TIM1κADCȡĲɼ
        2ıCOMP1 ״̬ɲTIM1ıOPAѹԸıADCȡ
4ע
    


1. Function description
    1. TIM1 CH4 triggers ADC to inject the voltage data of sampled OPA, and TIM1 output is controlled by COMP1 brake
2. Use environment
    Software development environment: KEIL MDK-ARM V5.30.0.0
    Hardware Environment: Developed based on the development board N32G031C8L7-STB V1.0
3. Instructions for use
    System Configuration;
        1. Clock source:
                    HSE=8M, PLL=48M, AHB=48M, APB1=48M, APB2=48M, ADC CLK=48M/16, ADC 1M CLK=HSE/8,
                    OPA CLK=48M, COMP CLK=48M, TIM1 CLK=48M, TIM8 CLK=48M
        2. Interrupt:
                     Enable the ADC injection interrupt, priority 0
                     Read conversion result
        3. Port configuration:
                    PA0 is selected as analog function, OPA VP
                    PA6 is selected as analog function, OPA OUT
                    PA1 is selected as analog function, COMP1 INP
                    PA4 is selected as analog function, COMP1 INM
                    PA12 is selected as analog function, COMP1 OUT
                    PA8 is selected as TIM1 CH1 output
                    PA9 is selected as TIM1 CH2 output
                    PA10 is selected as TIM1 CH3 output
                    PB13 is selected as TIM1 CH1 output
                    PB14 is selected as TIM1 CH2 output
                    PB15 is selected as TIM1 CH3 output
                    PA6 is selected as ADC_CH6 channel input
        4. OPA:
                    OPA voltage follower function, VM no pins
        5. ADC:
                    ADC injection mode, scan conversion, TIM1 CC4 trigger, 12-bit data right-justified, injection conversion OPA output analog voltage data
        6. TIM:
                    TIM1 6-channel complementary open, brake enable and open interrupt, CH4 trigger output
    Instructions:
        1. After compiling, open the debug mode, and use an oscilloscope or logic analyzer to observe the output waveform of TIM1 and the acquired data read by the ADC
        2. Changing the output state of COMP1 can brake TIM1, and changing the input voltage of OPA can change the data read by ADC
4. Matters needing attention
   None