Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: The Serial Port Remapping of STM32F103  (Read 3580 times)

0 Members and 1 Guest are viewing this topic.

hiroshima

    Topic Starter


    Newbie

    • Experience: Familiar
    • OS: Windows 7
    The Serial Port Remapping of STM32F103
    « on: June 20, 2017, 03:13:46 AM »
    Recently I am researching STM32,and I bought one from site. I would like to sharing the process about serial port weight map of STM32F103C4T6A here.

    This is the datasheet of SRM32F103C4T6A which I used to do experiments. The weight mapping step is given below:
    1). First,open the remapping clock and pin clock accross I/O pot after USART remapped.
                                 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO,ENABLE);
    2). I/O pot is starting to remap.
                                 GPIO_PinRemapConfig(GPIO_Remap_USART1,ENABLE);
    3). Configure Remapping pins,it need I/O which is configured after remapping.
                                 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
                                 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
                                 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
                                 GPIO_Init(GPIOB, &GPIO_InitStructure);


                                  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
                                  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
                                   GPIO_Init(GPIOB,&GPIO_InitStructure);