Datenblatt-Suchmaschine für elektronische Bauteile
  German  ▼
ALLDATASHEETDE.COM

X  

AN3422 Datenblatt(PDF) 45 Page - STMicroelectronics

Teilenummer AN3422
Bauteilbeschribung  Migration of microcontroller applications from STM32F1 to STM32L1 series
PDF  52 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Hersteller  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN3422 Datenblatt(HTML) 45 Page - STMicroelectronics

Back Button AN3422 Datasheet HTML 41Page - STMicroelectronics AN3422 Datasheet HTML 42Page - STMicroelectronics AN3422 Datasheet HTML 43Page - STMicroelectronics AN3422 Datasheet HTML 44Page - STMicroelectronics AN3422 Datasheet HTML 45Page - STMicroelectronics AN3422 Datasheet HTML 46Page - STMicroelectronics AN3422 Datasheet HTML 47Page - STMicroelectronics AN3422 Datasheet HTML 48Page - STMicroelectronics AN3422 Datasheet HTML 49Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 45 / 52 page
background image
AN3422
Firmware migration using the library
Doc ID 018976 Rev 2
45/52
5.4.4
Alternate function mode
In STM32F1 series
1.
The configuration to use an I/O as alternate function depends on the peripheral mode
used, for example the USART Tx pin should be configured as alternate function push-
pull while the USART Rx pin should be configured as input floating or input pull-up.
2.
To optimize the number of peripheral I/O functions for different device packages, it is
possible by software to remap some alternate functions to other pins, for example the
USART2_RX pin can be mapped on PA3 (default remap) or PD6 (by software remap).
In STM32L1 series
1.
Whatever the peripheral mode used, the I/O must be configured as alternate function,
then the system can use the I/O in the proper way (input or output).
2.
The I/O pins are connected to onboard peripherals/modules through a multiplexer that
allows only one peripheral’s alternate function to be connected to an I/O pin at a time.
In this way, there can be no conflict between peripherals sharing the same I/O pin.
Each I/O pin has a multiplexer with sixteen alternate function inputs (AF0 to AF15) that
can be configured through the GPIO_PinAFConfig () function:
After reset all I/Os are connected to the system’s alternate function 0 (AF0)
The peripherals’ alternate functions are mapped by configuring AF1 to AF13
Cortex-M3 EVENTOUT is mapped by configuring AF15
3.
In addition to this flexible I/O multiplexing architecture, each peripheral has alternate
functions mapped onto different I/O pins to optimize the number of peripheral I/O
functions for different device packages, for example the USART2_RX pin can be
mapped on PA3 or PD6 pin
4.
Configuration procedure
Connect the pin to the desired peripherals' Alternate Function (AF) using
GPIO_PinAFConfig() function
Use GPIO_Init() function to configure the I/O pin:
- Configure the desired pin in alternate function mode using
GPIO_InitStructure->GPIO_Mode = GPIO_Mode_AF;
- Select the type, pull-up/pull-down and output speed via
GPIO_PuPd, GPIO_OType and GPIO_Speed members
The example below shows how to remap USART2 Tx/Rx I/Os on PD5/PD6 pins in
STM32F1 series:
/* Enable APB2 interface clock for GPIOD and AFIO (AFIO peripheral is used
to configure the I/Os software remapping) */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD | RCC_APB2Periph_AFIO, ENABLE);
/* Enable USART2 I/Os software remapping [(USART2_Tx,USART2_Rx):(PD5,PD6)] */
GPIO_PinRemapConfig(GPIO_Remap_USART2, ENABLE);
/* Configure USART2_Tx as alternate function push-pull */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOD, &GPIO_InitStructure);
/* Configure USART2_Rx as input floating */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOD, &GPIO_InitStructure);



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52


Datenblatt Download

Go To PDF Page


Link URL



War ALLDATASHEET hilfreich?  [ DONATE ] 

Über Alldatasheet   |   Werbung   |   Kontakt   |   Privatsphäre und Datenschutz   |   Link zum Datenblatt    |   Linktausch   |   Hersteller
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com