2023-12-13 02:09 PM
Hi ,
I'm working on a code to collect data from a load cell wit HX711 cip. I'm using STM32CubeIDE.
I configured GPIO pin 6 as Clock output for the HX711 but when calling HAL_GPIO_WritePin the output pin PA6 does not change.
The hardware configuration is set in CubeMX .
I'm not even sure what information to provide.
I reduced the code to only couple of lines ...
I am writing code in C++ so I have a call of appMainC() that is declared as "extern C" as main() for my code. This may not influence our issue but I added it just for clarity.
And I also have the timer ElapsedCallback function call ..
I have changed 3 bluepill boards as I expected is a HW issue of the board but it the issue is the same on all 3.
I also tried by setting outputs PA3 ... PA6 as pull-up but I still measured 0V on the outputs with the oscilloscope.
Can anyone help with some idea on what could cause this issues? Or if I'm setting something wrong?
I can provide any additional information ... this seem so basic I don't know what to ask?
Best Regards,
Cristian
2023-12-13 02:21 PM
The pin is conflicted?
The pin you're probing isn't the one you think it is?
Check registers at a peripheral level, that the GPIO bank clock is enabled, that the pins are properly configured. Dig deeper into the code that's actually doing the configuration, the top level code is superficial
>>I have changed 3 bluepill boards as I expected is a HW issue of the board but it the issue is the same on all 3.
Or the HW is built consistently?
2023-12-14 01:11 AM
Well I'm not sure I'm able to go that level. I was able to trace where the code is enableing the RCC APB2 but there are many #defines ...
I also look to find on the web a way to set GPIOA in using ASM but could not find. In that case I would remove the code below with ASM ...
2023-12-14 02:27 AM
Read out and check/post content of GPIOA registers.
JW
2023-12-14 07:58 PM
More likely a HW issue as the bluepill works fine toggling PA6 on my end.
Show the schematic circuitry on how you've connected the Bluepill to the HX711