1323 views|8 replies

968

Posts

0

Resources
The OP
 

When using the GPIO port to simulate the IIC bus, should the input and output direction of the SDA port be set to input or output? [Copy link]

邀请:@led2015   @vincentc543   @吾妻思萌   @wangerxian   参与回复

When using the GPIO port to simulate the IIC bus, should the input and output direction of the SDA port be set to input or output?

This post is from stm32/stm8

Latest reply

IIC bus SDA bidirectional When data is sent, it is configured as output Configured as input when data is received   Details Published on 2023-8-21 23:03
 

3

Posts

0

Resources
2
 
SDA is used for both input and output. It is configured as output when sending data and as input when receiving data.
This post is from stm32/stm8

Comments

ox!!!!!!  Details Published on 2023-8-12 20:51
 
 

5998

Posts

6

Resources
3
 

The SDA port is set to input when inputting and output when outputting.

This post is from stm32/stm8
 
Personal signature

在爱好的道路上不断前进,在生活的迷雾中播撒光引

 

968

Posts

0

Resources
4
 
shenyang_ posted on 2023-8-12 15:20 SDA input and output will be used. When sending data, configure it as output, and when receiving data, configure it as input

ox!!!!!!

This post is from stm32/stm8
 
 
 

1462

Posts

0

Resources
5
 
The SDA pin of the IIC bus has both input and output. It is configured as output when sending data and as input when receiving data.
This post is from stm32/stm8
 
 
 

2w

Posts

341

Resources
6
 

SDA is a data line that is configured according to the SCL timing. There is no fixed
setting. How can it be set to input or output?

This post is from stm32/stm8
 
 
 

6742

Posts

2

Resources
7
 

It is set as output at the beginning and as input when reading data.

This post is from stm32/stm8
 
 
 

6062

Posts

4

Resources
8
 
This post was last edited by damiaa on 2023-8-16 22:09

Depends on the timing regulations of I2C:

SCK is an output

SDA Sometimes input, sometimes output

For example, start stop bit

When ISCL is at a high level, SDA changes from high to low. This signal is the start signal .

ISCL is at a high level, and SDA changes from low to high. This signal is a stop signal. Output

Data sampling occurs during the SCL high level period. Except for the start and stop signals, during data transmission, when SCL is high level, SDA must remain stable and is not allowed to change. It can only change when SCL is low level. Output

Response: When the slave receives data from the host, it will reply with a response signal to inform the host that it has received the data.

The acknowledge signal appears after one byte is transmitted, that is, in the 9th SCL clock cycle. The host needs to release the SDA bus and give the bus control to the slave. Due to the pull-up resistor, the bus is high. If the slave correctly receives the data sent by the host, it will pull SDA low to indicate an acknowledge response .

No response signal

During the 9th SCL clock cycle, SDA remains at a high level, indicating a non-acknowledgement signal.

The non-response signal may be generated by the master or the slave .

This post is from stm32/stm8
 
 
 

26

Posts

0

Resources
9
 

IIC bus SDA bidirectional

When data is sent, it is configured as output

Configured as input when data is received

This post is from stm32/stm8
 
 
 

Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list