cancel
Showing results for 
Search instead for 
Did you mean: 

Confused with Alternate functions and remaps

vik
Associate II
Posted on April 02, 2008 at 15:28

Confused with Alternate functions and remaps

4 REPLIES 4
vik
Associate II
Posted on May 17, 2011 at 12:28

Hi,

I am having a hard time understanding STM32's port mapping system even after going through Chap 5 [GPIO and AFIO] in STM32's ref manual. We are planning to use 48pin version of the STM32's 103 performance line.

I have the following questions:

- I see that I can switch from GPIO to AFIO function with the help of GPIOx_CRL and GPIOx_CRH registers. But most of the pins seem to have more than 1 default alternate function (or at least thats how I understand from Pg 21 to 25 in STM32 103's datasheet). For example PA0..PA3's Alternate function can be USART2, ADC or TIM2. Now I only want to use it as USART2 and not as the other two. I can set bit 3 in AFIO_MAPR to not to remap USART2. But TIM2 I do not want to remap, I do not want to use it at all. What registers do I need to set so that PA0..PA3 is only USART and not ADC or TIM2.

- My Second Question, now using AFIO_MAPR I remap some alternate function to another pin. When I use the pin in AF mode, will it work with the default AFIO or the new remap AFIO function.

- My third is more a wish, I want to use UART1, USB and I2C1 too. I see USART1 and USB share some of PA8..PA12 pins. I do not want to remap USART1 to PB6 and PB7, as its already taken up by I2C1. I only need Tx and Rx of USART1 .. so can I put PA9 and PA10 in USART1 mode and PA11 and PA12 USB mode.

I would be grateful for any help. Thanks in advance

- Vikram

[ This message was edited by: vik on 02-04-2008 01:05 ]

lanchon
Associate II
ostheim
Associate II
Posted on May 17, 2011 at 12:28

It might help if you read also the new errata sheet ...

vik
Associate II
Posted on May 17, 2011 at 12:28

Glad to see I am not the only one struggling at this.

I was able to find output disables for the other peripherals but it was like finding a needle in a hay stack.

Thanks for the help lanchon and ostheim