cancel
Showing results for 
Search instead for 
Did you mean: 

how to change between alternate functions ?

mehmet.karakaya
Associate III
Posted on August 07, 2010 at 12:22

how to change between alternate functions ?

5 REPLIES 5
greg_t
Associate II
Posted on May 17, 2011 at 14:01

Are you using Std Pheriph Library ?

mehmet.karakaya
Associate III
Posted on May 17, 2011 at 14:01

I am not using any library

I am still reading reference manual 

the manual says :

Bit 3 USART2_REMAP: USART2 remapping

This bit is set and cleared by software. It controls the mapping of USART2 CTS, RTS,CK,TX

and RX alternate functions on the GPIO ports.

0: No remap (CTS/PA0, RTS/PA1, TX/PA2, RX/PA3, CK/PA4)

1: Remap (CTS/PD3, RTS/PD4, TX/PD5, RX/PD6, CK/PD7)

but it doesnot explain how to disable other Alternate fucntion on the same pin

there are TIM5_CH3 and TIM2_CH3 alternate functions on the same pin

-----------------------------------------------

USART2_TX(8)/TIM5_CH3

ADC123_IN2/

TIM2_CH3 (8)

swhite2
Associate III
Posted on May 17, 2011 at 14:01

You enable/disable peripherals via their clock.

So in your example you enable the USART2 clock. In this particular case its to also ok to use ADC1/2/3 and/or TIM2_CH3 as long as you don't enable the output function on TIM2_CH3 (ADC is only an input and you could still convert IN2 but that wouldn't be very useful).

In short you can't enable multiple peripheral output functions on the same pin.

mehmet.karakaya
Associate III
Posted on May 17, 2011 at 14:01

if this is so ,

the ST engineers have found most unbeautiful solution to I/O mapping

I must disable TIM5 module totally just becouse TIM5_CH3 is on the same pin with

USART2_TX

what if I still want use TIM5 ?

for example with internal clock puls

either you wrong or ST design wrong !

just look at TI TMS320F2xxx - there are 2 alternate function selection bits on each I/O port bit

the 2 bits chose the 4 I/O posibilities - you dont need to disable any module

swhite2
Associate III
Posted on May 17, 2011 at 14:01

No, you're wrong. Did you not read what I wrote?

You can have multiple peripherals enabled but you cannot enable two output functions on the same port pin. ST provides the remap functionality for times when there's a conflict.