2022-03-02 05:55 AM
Hello,
I have three GPIOs output configured. I'm having some strangeness on two of these that I don't quite understand.
I'm using a nucleo STM32L432KC, and I have some custom circuitry attached to the GPIOs (detailed below)
The situation I am experiencing is as follow.
When I set the 3 GPIOs like so, I have expected results.
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_7, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_6, GPIO_PIN_SET);
PB7,PA5 are low and PA6 is high.
The next condition I test:
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_7, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_6, GPIO_PIN_RESET);
Should show PB7 low, PA5 high ad PA low.
But instead I see this:
PA5 appears to be bouncing all over the place, and once in a awhile PB7 does as well.
(This is short sample, of like 5 seconds)
Finally, when I do this:
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_7, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_6, GPIO_PIN_RESET);
I see these results:
Both PB7 and PA5 are high, and steady.
Each circuit is tied to a 10k pulldown resistor.
PA6
PA5
PB7
I don't quite understand a) why won't PA5 stay up, and how is PB7 somehow tied to PA5.
If anyone has some ides, I'd appreciate it.
Solved! Go to Solution.
2022-03-02 10:47 AM
Thanks! I finally figured it out,
PA and PB7 are directly connected through solder bridge on the Nucleo. I removed the bridge.
2022-03-02 06:08 AM
The npn bipolar transistors are current driven and emitter followers, so you'd need some load connected to them. What is connected at the outputs?
Regards
/Peter
2022-03-02 09:30 AM
I didn't have a load, actually. But I attached my intended load. Which are 2 24V solenoids (relays not pictured)
The behavior is the same regardless. So, I am still hunting - maybe it's hardware issue.
2022-03-02 09:46 AM
1) Check output voltages by oscilloscope (or multimeter). Probably there are "analog" values.
2) Check your GPIO settings (are GPIOs outputs ? in push-pull mode ?)
3) Check HW for short circuits (bad soldering)
2022-03-02 10:47 AM
Thanks! I finally figured it out,
PA and PB7 are directly connected through solder bridge on the Nucleo. I removed the bridge.