2014-08-18 07:20 AM
Hello,
I'm discovering the STM32F407 with an STM32F4Discovery, in the past, I worked with a PIC32, and I see that there is many differences between those two microcontrollers.I want to understand how the UART peripheral recognizes the TX and RX pins, in the example, I saw that the initialization of TX and RX pins is the same, only the pin number is different, so how can the UART module recognizes the pin that's used for TX and for RX ??Is the order of executing HAL_GPIO_Init will decide which pin will be TX and wich pin will be RX ???In the PIC32MX795, the UART pins are fixed, so there is no problem, but here, I see that the peripheral can drive any mcu's pins.thank you to enlighten me.2014-08-18 07:41 AM
''how the UART peripheral recognizes the TX and RX pins''
It doesn't!You choose which of the available ''Alternate Function'' pins you wish to use in your application.Look at Table 9, ''Alternate function mapping'' in the datasheet:http://www.st.com/web/en/resource/technical/document/datasheet/DM00037051.pdf
2014-08-18 07:45 AM
''In the PIC32MX795, the UART pins are fixed''
How very inflexible!Most chips these days seem to have some facility to map peripheral functions (eg, UART Tx, Rx) to a choice of physical pins...2014-08-18 07:53 AM
Okay, understood !!!!! thank you very much !
2014-08-18 08:07 AM
Yes, but the PIC32MX795F512L is old, Micochip provided PPS (peripheral pin select, it's like the AF feature) in the PIC32MX mcu's that don't have many pins, like the PIC32MX220/230/250 family.
As the PIC32MX795 has many pins, they thought it's useless to add that feature to it.sorry for bad english ^^