cancel
Showing results for 
Search instead for 
Did you mean: 

What could make a specific GPIO (PA12 and PA11) on STM32L073V8T6 work when configured as an Input but not work when configured as output?

oolor.1
Associate II

I have a static LCD, a couple of other GPIOs configured as output and SWD which are all working fine. PA12 does not work when I configure it in output mode and i toggle the pin. I have tried using PA11 also with no success. The .ioc file of my project is attached. Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
6 REPLIES 6

> PA12 does not work when I configure it in output mode and i toggle the pin.

Do you do this in debugger? Read out and post all GPIOA registers.

Do you observe *directly* on the pin, e.g. using oscilloscope probe touching the pin?

What is connected to that pin, physically? Is this some kind of a "known good" board such as Nucleo or Disco (in which case make sure you removed all jumpers and solder bridges associated with this pin), or your board?

JW

S.Ma
Principal

Use debuggr and stop the code while it is running and look at GPIOA registers values.

Possible causes:

  • Open drain (put a SW pull-up too see something?)
  • GPIOA register clock not activated (all registers are 0x0000)
  • Alternate function enabled (as input)
  • Analog input

Thanks. I'm trying to develop a product with the chip... so it is on my PCB design. The pin is connected to an NPN transistor meant to control an active buzzer. I have removed this transistor so I can run a direct check on the GPIO.

I observed the pin directly with an oscilloscope.

Theses are the readings on the GPIOA registers:

When low:

MODER: 0xA9EAACAB

OTYPER: 0x0

OSPEEDR:0xC000000

PUPDR: 0x24000000

IDR: 0x6000

ODR: 0x0

BSRR: 0x0

LCKR: 0x0

AFR[0]: 0x11001110

AFR[1]: 0x10000111

BRR: 0x0

When high:

MODER: 0xA9EAACAB

OTYPER: 0x0

OSPEEDR:0xC000000

PUPDR: 0x24000000

IDR: 0x7000

ODR: 0x1000

BSRR: 0x0

LCKR: 0x0

AFR[0]: 0x11001110

AFR[1]: 0x10000111

BRR: 0x0

Thanks.

  • I have tried using S/W pull-up. No changes.
  • The register clock for GPIOA is enabled as well as the clock for the other ports I'm using.
  • I'll check up on this... though I'm sure the GPIO is configured as output. I don't know if SWD and LCD being enabled on the other pins of the port is causing a conflict.
  • Same as above.

0690X00000D8iLkQAJ.png

This was the cause of the problem because on my board VDD_USB was floating because I thought it powered only the USB. :see_no_evil_monkey:

Thanks so much.