2020-06-17 06:04 AM
Hello! I am using STM8L051F3 with Stm8 SPL headers. I am trying to configure PC0,PC1,PC4 as output with high level:
CLK->PCKENR1 &= `CLK_PCKENR1_I2C1;
GPIOC->DDR |= (1<<0)|(1<<1)|(1<<4);
GPIOC->CR1 |= (1<<0)|(1<<1)|(1<<4);
GPIOC->ODR |= (1<<0)|(1<<1)|(1<<4);
as a result, i got high level only on PC4.
According to DS1178 Rev4 ( STM8L051f3 datasheet) p.23 PC0 and PC1 has main function as
PORT and alternate function as I2C. I think, that somehow PC1 and PC0 acts as I2C (SDA/SDL)
Please help me to configure PC0 and PC1 as ordinary port.
Solved! Go to Solution.
2020-06-21 07:03 AM
PC0 & PC1 are true open drain ports, so if you want to measure/read a 1 value on the ports you need pull-ups.
2020-06-21 07:03 AM
PC0 & PC1 are true open drain ports, so if you want to measure/read a 1 value on the ports you need pull-ups.