1˵

    òʾʹUARTദģʽUARTyUARTzUART1UART2
    ȣֱUARTyUARTzĵַΪ0x10x2UARTyUARTzַ0x33UARTzյ0x33㷭תLED1LED2LED3š
    һKEY1_INT_EXTI_LINE߼⵽أEXTIжϣEXTI4_17_IRQHandlerжϴ(the ControlFlag = 0)UARTz뾲ĬģʽھĬģʽУLEDֹͣתֱKEY1_INT_EXTI_LINE߼⵽(the ControlFlag = 1)EXTI4_17_IRQHandlerжϴУUARTy͵ַ0x102UARTzLEDת


2ʹû

    KEIL MDK-ARM Professional Version 5.34

    ӲСϵͳN32G003F5S7-STB_V1.0


3ʹ˵
	
    ϵͳʱ£
    - ϵͳʱ = 48MHz
    
    UARTy£
    -  = 115200 baud
    - ֳ = 9λ
    - 1ֹͣλ
    - Уƽ
    - ͷʹ  
    
    
    UART£    
    - UART1_Tx.PA14     <------->   UART2_Rx.PA1
    - UART1_Rx.PA12     <------->   UART2_Tx.PA2    
    
    KEY1_INT_EXTI_LINE.PA11    <------->   KEY1
    
    LED1    <------->   PA6
    LED2    <------->   PA7
    LED3    <------->   PA10

    
    Բ
    - DemoKEIL±MCU
    - λУ۲LED1~3Ƿ˸״̬
    - KEY۲LED1~3Ƿֹͣ˸
    - ٴΰKEY۲LED1~3Ƿָ˸


4ע


1. Function description

    This test example demonstrates how to use the UART multiprocessor mode. UARTy and UARTz can be UART1 and UART2.
    First, set the addresses of UARTy and UARTz to 0x1 and 0x2 respectively. UARTy continuously sends the character 0x33 to UARTz. UARTz receives 0x33 and flips the pins of LED1, LED2, and LED3.
    Once the KEY1_INT_EXTI_LINE line detects the rising edge, the EXTI0 interrupt is generated. In the EXTI0_IRQHandler interrupt processing function (the ControlFlag = 0), the UARTz enters the silent mode. In the silent mode, the LED pin stops toggling until the KEY1_INT_EXTI_LINE line detects the rising edge ( the ControlFlag = 1). In the EXTI0_IRQHandler interrupt processing function, UARTy sends address 0x102 to wake up UARTz. The LED pin restarts toggling.


2. Use environment

    Software development environment: KEIL MDK-ARM Professional Version 5.34

    Hardware environment: minimum system board N32G003F5S7-STB_V1.0


3. Instructions for use

    The system clock configuration is as follows:
    -System clock = 48MHz
    
    The UARTy configuration is as follows:
    -Baud rate = 115200 baud
    -Word length = 9 data bits
    -1 stop bit
    -Verification control disabled
    -Receiver and transmitter enable
    
    
    The UART pin connections are as follows:
    - UART1_Tx.PA14    <------->    UART2_Rx.PA1
    - UART1_Rx.PA12   <------->   UART2_Tx.PA2
    
    KEY1_INT_EXTI_LINE.PA11    <------->   KEY1
    
    LED1    <------->   PA6
    LED2    <------->   PA7
    LED3    <------->   PA10

    
    Test steps and phenomena:
    -After the Demo is compiled in the KEIL environment, download it to the MCU
    -Reset operation, observe whether LED1~3 are blinking
    -Press the KEY button and observe if LED1~3 stop flashing
    -Press the KEY button again and observe whether LED1~3 resume flashing


4. Matters needing attention