cancel
Showing results for 
Search instead for 
Did you mean: 

PA1-6 do not HIGH/LOW

Ala
Senior
 
3 REPLIES 3
berendi
Principal
  1. Enable the peripheral (GPIOA in this case) clock in RCC->AHB1ENR.
  2. Set the pins to output mode in GPIOA->MODER.

You can find the description of these registers in the reference manual.

Dear berendi

STM32 controllers can't be powered with 5V, they can take at most 3.6V, and usually powered with 3.3V.

You can connect pull-up resistors to the pins and set them to open-drain mode (set corresponding bits in GPIOA->OTYPER), as long as they are 5V tolerant - check the pin definitions table in the datasheet for that, PA4 and PA5 are NOT 5V tolerant, pick another pins instead.