2023-11-08 12:51 AM
Hi,
i Pin PC8 is configured as GPIO, but unfortuately, after execute following codes
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_8, GPIO_PIN_SET) and
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_8, GPIO_PIN_RESET) , the pin status didn't change,
always keeps in High status. other GPIOs like PD2 wroks with the same way.
Debug MCU configuration register (DBGMCU_CR) is in default setting (0x0).
CUBEIDE Version: 1.13.2
could you please let me know what is wrong?
2023-11-08 01:30 AM
Did you actually *verify* the GPIO register contents (in particular MODER, OTYPE, ODR, IDR) after the calls of HAL_GPIO_Write_pin against expected contents? LCD controller used?
2023-11-08 01:42 AM
Hello @Owenlu,
Please:
Check if you have already enabled GPIOC RCC clock.
Check if you've already configured the pin PC8 in output push-pull.
Check if there is something connected to PC8 pin that forces it to that level.
Check the content of ODR register after writing to the pin PC8.
2023-11-08 07:18 PM
Check if you have already enabled GPIOC RCC clock.
A:Clock enabled:(RCC_AHB2ENR= 0x4200f)
Check if you've already configured the pin PC8 in output push-pull.
A: GPIOC_MODER value 0xf2a1595d, MODER8 is 0x1, output
GPIOC_OTYPER is 0, output push-pull, No PULL up/Down.
Check if there is something connected to PC8 pin that forces it to that level.
A: PC8 now is isolated from PCB, no other connection
Check the content of ODR register after writing to the pin PC8.
A: after setting GPIOC_ODR=0x100
2023-11-08 07:23 PM
yes, registers value is as expected.
there is no LCD interface/controller used in the project.