Skip to main content
Ala
Senior
November 9, 2019
Question

PA1-6 do not HIGH/LOW

  • November 9, 2019
  • 1 reply
  • 579 views

..

This topic has been closed for replies.

1 reply

berendi
Principal
November 9, 2019
  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.

Ala
AlaAuthor
Senior
November 9, 2019

Dear berendi

berendi
Principal
November 9, 2019

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.