STM32L052 USART: Problem Switchover from Output- to UART - TX - functionality produces a disturbing H/L - edge on TX
Two Usart - TX - lines shall be used either in PP- output- or in Usart - TX - mode.
The switchover from a normal output pin to a Uart - TX - pin produces
an High/ Low edge on TX followed by an interrupt on TX side.
On RX- side this H/L edge causes an unwanted Interrupt too. And that is the actual problem.
The cause is the following sequence
u32ModeBack = GPIOA->MODER;
u32ModeBack &= ~(GPIO_MODER_MODE2_Msk | GPIO_MODER_MODE15_Msk);
u32ModeBack |= (0x02ul<<GPIO_MODER_MODE2_Pos); //Alternate output function
GPIOA->MODER = u32ModeBack;
Is there a possibility to avoid this additional output of pulses?
