2010-08-07 03:22 AM
how to change between alternate functions ?
2011-05-17 05:01 AM
2011-05-17 05:01 AM
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_CH3ADC123_IN2/
TIM2_CH3 (8)
2011-05-17 05:01 AM
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.2011-05-17 05:01 AM
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 module2011-05-17 05:01 AM
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.