2010-05-03 02:25 AM
STM8S103F3 PB5/SDA behaves incorrect when used as GPIO
2011-05-17 06:08 AM
Hi Dennis,
The I2C pins are configured as true open-drain I/O internally, (P-buffer and protection diode to VDD are not implemented) so is not possible to use them as output pins can you please check with external pull-up 4.7k on these I/O. Regards mozra2011-05-17 06:08 AM
Thanks, Mozra.
I am not using the I2C pin to drive 74AC164M now, but with other normal GPIOs. Everything is all right. But I am still using the I2C pins(GPIO mode) to drive other components, currently they work ok. Concerning to your reply ''The I2C pins are configured as true open-drain I/O internally, (P-buffer and protection diode to VDD are not implemented)so is not possible to use them as output pins
'', I don't know if I am right, is there any underlying risk to use I2C pins as output? Thanks and Regards2011-05-17 06:08 AM
// Setup Port D
/* [2]101 7 6 5 4 3 2 1 0 | | | | | | | | | | |___________ SCL (Output) Push pull output | |_____________ SDA (I/O ) Push pull output DDR 0 1 1 0 0 0 0 0 CR1 0 1 1 0 0 0 0 0 CR2 0 0 0 0 0 0 0 0 */ GPIOD->DDR = 0x70; GPIOD->CR1 = 0x70; GPIOD->CR2 = 0x00;Does the STM8S103F3 support 8051 MCU quasi-bidirection mode ?
2011-05-17 06:08 AM
Dennis,
Do you mean that STM8S103F3 PB.4/PB.5 can be used as normal Open Drain pins ? Could you tell me how to configure their regisers ? // Init Port B /* [2]101 7 6 5 4 3 2 1 0 | | | | | | | | | | | |_________ I2C SCL (Output) Open drain output | | |___________ I2C SDA (Output) Open drain output DDR 0 0 1 1 0 0 0 0 CR1 0 0 0 0 0 0 0 0 CR2 0 0 0 0 0 0 0 0 */ GPIOB->DDR = 0x30; GPIOB->CR1 = 0x00; GPIOB->CR2 = 0x00; Are they correct ? What did I miss else ?