Why does setting pin 0 of port A to analog mode cause an error?
STM32F407VGT6
Why is access to the Microcontroller broken after this code?
The MODER register after this code should look like this: 00000000000000000000000000000011
this is Analog mode for pin 0 of port A.
int main(void)
{
RCC->AHB1ENR|=RCC_AHB1ENR_GPIOAEN;
GPIOA->MODER=0x3;
while (1)
{
}
}
Same but with port B or C does not throw an error
RCC->AHB1ENR|=RCC_AHB1ENR_GPIOBEN;
GPIOB->MODER=0x3;
-----------------------------
RCC->AHB1ENR|=RCC_AHB1ENR_GPIOCEN;
GPIOC->MODER=0x3;
----------------------------
Port A is compatible with Analog mode
A user button is connected to pin 0 of Port A, but it is not pressed, which means it does not interfere with the execution of the code.
